Skip to content

Commit 9d0afcf

Browse files
committed
fix: fix for failure
1 parent 2b2ee1f commit 9d0afcf

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

containers/http_processor.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff 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
}

containers/llm.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import (
1313
type LLMProvider string
1414

1515
const (
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

0 commit comments

Comments
 (0)