Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: disable streaming for cloudflare provider

Lyric 23c2ce49 1e6149c7

+23 -1
+6 -1
providers/uniai/client.go
··· 275 275 } 276 276 277 277 func supportsStreaming(provider string) bool { 278 - return !strings.EqualFold(strings.TrimSpace(provider), "gemini") 278 + switch strings.ToLower(strings.TrimSpace(provider)) { 279 + case "gemini", "cloudflare": 280 + return false 281 + default: 282 + return true 283 + } 279 284 } 280 285 281 286 func cloneFloat64(v *float64) *float64 {
+17
providers/uniai/client_test.go
··· 156 156 t.Fatalf("expected on_stream callback to be disabled for gemini provider") 157 157 } 158 158 } 159 + 160 + func TestBuildChatOptionsDisablesOnStreamForCloudflareProvider(t *testing.T) { 161 + req := llm.Request{ 162 + Messages: []llm.Message{{Role: "user", Content: "hello"}}, 163 + OnStream: func(llm.StreamEvent) error { return nil }, 164 + } 165 + opts := buildChatOptions(req, "cloudflare", false, uniaiapi.ToolsEmulationOff, nil, "", nil) 166 + 167 + built, err := uniaichat.BuildRequest(opts...) 168 + if err != nil { 169 + t.Fatalf("build request: %v", err) 170 + } 171 + if built.Options.OnStream != nil { 172 + t.Fatalf("expected on_stream callback to be disabled for cloudflare provider") 173 + } 174 + } 175 + 159 176 func TestBuildChatOptionsMapsDebugFn(t *testing.T) { 160 177 var gotLabel, gotPayload string 161 178 req := llm.Request{