Fix lint issue on OpenAI field access in streaming response handler

Fabio Mora created

Change summary

internal/llm/provider/openai.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

internal/llm/provider/openai.go 🔗

@@ -342,7 +342,7 @@ func (o *openaiClient) stream(ctx context.Context, messages []message.Message, t
 					slog.Debug("Response", "messages", string(jsonData))
 				}
 
-				if len(acc.ChatCompletion.Choices) == 0 {
+				if len(acc.Choices) == 0 {
 					eventChan <- ProviderEvent{
 						Type:  EventError,
 						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
 					return
 				}
 
-				resultFinishReason := acc.ChatCompletion.Choices[0].FinishReason
+				resultFinishReason := acc.Choices[0].FinishReason
 				if resultFinishReason == "" {
 					// If the finish reason is empty, we assume it was a successful completion
 					// INFO: this is happening for openrouter for some reason