Unified Agent + reusable Go agent core.
0
fork

Configure Feed

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

fix: disable gemini streaming

Lyric df2347ce 300887d5

+28 -2
+1 -1
internal/channelruntime/telegram/runtime_task.go
··· 354 354 if model == "" { 355 355 return false 356 356 } 357 - return modelHasPrefixOrNamespace(model, "gpt-") || modelHasPrefixOrNamespace(model, "gemini") 357 + return modelHasPrefixOrNamespace(model, "gpt-") 358 358 } 359 359 360 360 func modelHasPrefixOrNamespace(model string, token string) bool {
+7
internal/channelruntime/telegram/runtime_task_test.go
··· 254 254 } 255 255 } 256 256 257 + func TestTelegramDraftStreamPublisherStreamHandlerDisabledForGeminiModel(t *testing.T) { 258 + p := newTelegramDraftStreamPublisher(nil, nil, 42, 77, "private", "gemini-2.5-pro") 259 + if p.StreamHandler() != nil { 260 + t.Fatalf("StreamHandler() expected nil for gemini model") 261 + } 262 + } 263 + 257 264 func TestBuildTelegramHistoryMessageWithImageParts(t *testing.T) { 258 265 orig := encodeImageToWebP 259 266 encodeImageToWebP = func(raw []byte) ([]byte, error) { return []byte("webp-bytes"), nil }
+5 -1
providers/uniai/client.go
··· 246 246 if req.DebugFn != nil { 247 247 opts = append(opts, uniaiapi.WithDebugFn(req.DebugFn)) 248 248 } 249 - if req.OnStream != nil { 249 + if req.OnStream != nil && supportsStreaming(provider) { 250 250 opts = append(opts, uniaiapi.WithOnStream(func(ev uniaiapi.StreamEvent) error { 251 251 streamEvent := llm.StreamEvent{ 252 252 Delta: ev.Delta, ··· 272 272 } 273 273 274 274 return opts 275 + } 276 + 277 + func supportsStreaming(provider string) bool { 278 + return !strings.EqualFold(strings.TrimSpace(provider), "gemini") 275 279 } 276 280 277 281 func cloneFloat64(v *float64) *float64 {
+15
providers/uniai/client_test.go
··· 141 141 } 142 142 } 143 143 144 + func TestBuildChatOptionsDisablesOnStreamForGeminiProvider(t *testing.T) { 145 + req := llm.Request{ 146 + Messages: []llm.Message{{Role: "user", Content: "hello"}}, 147 + OnStream: func(llm.StreamEvent) error { return nil }, 148 + } 149 + opts := buildChatOptions(req, "gemini", false, uniaiapi.ToolsEmulationOff, nil, "", nil) 150 + 151 + built, err := uniaichat.BuildRequest(opts...) 152 + if err != nil { 153 + t.Fatalf("build request: %v", err) 154 + } 155 + if built.Options.OnStream != nil { 156 + t.Fatalf("expected on_stream callback to be disabled for gemini provider") 157 + } 158 + } 144 159 func TestBuildChatOptionsMapsDebugFn(t *testing.T) { 145 160 var gotLabel, gotPayload string 146 161 req := llm.Request{