@@ -342,7 +342,7 @@ func (o *openaiClient) stream(ctx context.Context, messages []message.Message, t
342342 slog.Debug("Response", "messages", string(jsonData))
343343 }
344344
345− if len(acc.ChatCompletion.Choices) == 0 {
345+ if len(acc.Choices) == 0 {
346346 eventChan <- ProviderEvent{
347347 Type: EventError,
348348 Error: fmt.Errorf("received empty streaming response from OpenAI API - check endpoint configuration"),
@@ -350,7 +350,7 @@ func (o *openaiClient) stream(ctx context.Context, messages []message.Message, t
350350 return
351351 }
352352
353− resultFinishReason := acc.ChatCompletion.Choices[0].FinishReason
353+ resultFinishReason := acc.Choices[0].FinishReason
354354 if resultFinishReason == "" {
355355 // If the finish reason is empty, we assume it was a successful completion
356356 // INFO: this is happening for openrouter for some reason