File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,28 +165,28 @@ func (ctx *HTTPRequestContext) IsLLMRequest() bool {
165165}
166166
167167// GetLLMProvider attempts to identify the LLM provider
168- func (ctx * HTTPRequestContext ) GetLLMProvider () string {
168+ func (ctx * HTTPRequestContext ) GetLLMProvider () LLMProvider {
169169 if ! ctx .IsLLMRequest () {
170- return ""
170+ return ProviderUnknown
171171 }
172172
173173 hostLower := strings .ToLower (ctx .Host )
174174 pathLower := strings .ToLower (ctx .Path )
175175
176176 switch {
177177 case strings .Contains (hostLower , "openai.com" ) || strings .Contains (hostLower , "azure.com/openai" ):
178- return "openai"
178+ return ProviderOpenAI
179179 case strings .Contains (hostLower , "anthropic.com" ):
180- return "anthropic"
180+ return ProviderAnthropic
181181 case strings .Contains (hostLower , "cohere" ):
182- return "cohere"
182+ return ProviderCohere
183183 case strings .Contains (hostLower , "googleapis.com" ):
184- return "google"
184+ return ProviderGoogle
185185 case strings .Contains (hostLower , "bedrock" ):
186- return "aws-bedrock"
186+ return ProviderAWSBedrock
187187 case strings .Contains (pathLower , "/v1/chat/completions" ) || strings .Contains (pathLower , "/v1/completions" ):
188- return "openai-compatible"
188+ return ProviderOpenAICompatible
189189 default :
190- return "unknown"
190+ return ProviderUnknown
191191 }
192192}
Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ import (
1313type LLMProvider string
1414
1515const (
16- ProviderOpenAI LLMProvider = "openai"
17- ProviderAnthropic LLMProvider = "anthropic"
18- ProviderGoogle LLMProvider = "google"
19- ProviderCohere LLMProvider = "cohere"
20- ProviderUnknown LLMProvider = "unknown"
16+ ProviderOpenAI LLMProvider = "openai"
17+ ProviderAnthropic LLMProvider = "anthropic"
18+ ProviderGoogle LLMProvider = "google"
19+ ProviderCohere LLMProvider = "cohere"
20+ ProviderAWSBedrock LLMProvider = "aws-bedrock"
21+ ProviderOpenAICompatible LLMProvider = "openai-compatible"
22+ ProviderUnknown LLMProvider = "unknown"
2123)
2224
2325// LLMRequest represents parsed LLM request data
You can’t perform that action at this time.
0 commit comments