feat: except *-speech client type in llm provider

This commit is contained in:
Acbox
2026-04-19 14:16:01 +08:00
parent 66808f868b
commit 30ab6b4199
2 changed files with 3 additions and 13 deletions
+1 -1
View File
@@ -85,4 +85,4 @@ export const CLIENT_TYPE_META: Record<string, ClientTypeMeta> = {
export const CLIENT_TYPE_LIST: ClientTypeMeta[] = Object.values(CLIENT_TYPE_META)
export const LLM_CLIENT_TYPE_LIST: ClientTypeMeta[] = CLIENT_TYPE_LIST
.filter(ct => ct.value !== 'edge-speech')
.filter(ct => !ct.value.endsWith('-speech'))
+2 -12
View File
@@ -446,19 +446,9 @@ func IsValidClientType(clientType ClientType) bool {
}
// IsLLMClientType returns true if the client type belongs to the LLM domain
// (chat/embedding), excluding speech-only types like edge-speech.
// (chat/embedding), excluding speech-only types (any type ending in "-speech").
func IsLLMClientType(clientType ClientType) bool {
switch clientType {
case ClientTypeOpenAIResponses,
ClientTypeOpenAICompletions,
ClientTypeAnthropicMessages,
ClientTypeGoogleGenerativeAI,
ClientTypeOpenAICodex,
ClientTypeGitHubCopilot:
return true
default:
return false
}
return IsValidClientType(clientType) && !strings.HasSuffix(string(clientType), "-speech")
}
// SelectMemoryModel selects a chat model for memory operations.