Compare commits
1 Commits
main
...
fix/refusa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbd3badf8a |
@ -860,13 +860,16 @@ public enum LanguageModel: Sendable, CustomStringConvertible, Hashable {
|
||||
if case let .anthropicCompatible(modelId, _) = self {
|
||||
return !Anthropic.hasStreamingRefusalRisk(modelId: modelId)
|
||||
}
|
||||
if case let .openRouter(modelId) = self, modelId.lowercased().hasPrefix("anthropic/") {
|
||||
if case let .openRouter(modelId) = self {
|
||||
return !Anthropic.hasStreamingRefusalRisk(modelId: modelId)
|
||||
}
|
||||
if case let .together(modelId) = self, modelId.lowercased().hasPrefix("anthropic/") {
|
||||
if case let .together(modelId) = self {
|
||||
return !Anthropic.hasStreamingRefusalRisk(modelId: modelId)
|
||||
}
|
||||
if case let .openaiCompatible(modelId, _) = self {
|
||||
guard !Anthropic.hasStreamingRefusalRisk(modelId: modelId) else {
|
||||
return false
|
||||
}
|
||||
let normalized = modelId.lowercased()
|
||||
guard
|
||||
normalized.contains("claude") ||
|
||||
@ -875,7 +878,7 @@ public enum LanguageModel: Sendable, CustomStringConvertible, Hashable {
|
||||
{
|
||||
return true
|
||||
}
|
||||
return !Anthropic.hasStreamingRefusalRisk(modelId: modelId)
|
||||
return true
|
||||
}
|
||||
if
|
||||
case let .custom(provider) = self,
|
||||
|
||||
@ -175,11 +175,17 @@ struct ProviderSystemTests {
|
||||
#expect(Model.anthropic(.opus48).supportsStreaming == false)
|
||||
#expect(Model.anthropic(.fable5).supportsStreaming == false)
|
||||
#expect(Model.openRouter(modelId: "anthropic/claude-fable-5").supportsStreaming == false)
|
||||
#expect(Model.openRouter(modelId: "fable5").supportsStreaming == false)
|
||||
#expect(Model.openRouter(modelId: "anthropic/claude-opus-4-8").supportsStreaming == false)
|
||||
#expect(Model.together(modelId: "claude-fable-5").supportsStreaming == false)
|
||||
#expect(Model.openaiCompatible(
|
||||
modelId: "anthropic/claude-fable-5",
|
||||
baseURL: "https://example.test",
|
||||
).supportsStreaming == false)
|
||||
#expect(Model.openaiCompatible(
|
||||
modelId: "fable5",
|
||||
baseURL: "https://example.test",
|
||||
).supportsStreaming == false)
|
||||
#expect(Model.openaiCompatible(
|
||||
modelId: "sonnet4-local",
|
||||
baseURL: "https://example.test",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user