(ctx context.Context, sseHandler *sse.SSEHandlerCh, backend UseChatBackend, chatOpts uctypes.WaveChatOpts, cont *uctypes.WaveContinueResponse)
| 179 | } |
| 180 | |
| 181 | func runAIChatStep(ctx context.Context, sseHandler *sse.SSEHandlerCh, backend UseChatBackend, chatOpts uctypes.WaveChatOpts, cont *uctypes.WaveContinueResponse) (*uctypes.WaveStopReason, []uctypes.GenAIMessage, error) { |
| 182 | if chatOpts.Config.APIType == uctypes.APIType_OpenAIResponses && shouldUseChatCompletionsAPI(chatOpts.Config.Model) { |
| 183 | return nil, nil, fmt.Errorf("Chat completions API not available (must use newer OpenAI models)") |
| 184 | } |
| 185 | stopReason, messages, rateLimitInfo, err := backend.RunChatStep(ctx, sseHandler, chatOpts, cont) |
| 186 | updateRateLimit(rateLimitInfo) |
| 187 | return stopReason, messages, err |
| 188 | } |
| 189 | |
| 190 | func getUsage(msgs []uctypes.GenAIMessage) uctypes.AIUsage { |
| 191 | var rtn uctypes.AIUsage |
no test coverage detected