py/plugins/openai: set raw to the full completion on the non-streaming path
Author: hilariieCreated Sep 11, 2026Updated Sep 21, 2026
Labelspython
On the non-streaming chat path the plugin has the whole ChatCompletion, so raw can hold response.to_dict() rather than the curated map custom gets, matching JS (raw: response). The streaming path only ever sees chunks and keeps the curated map. Four existing tests feed _generate bare MagicMocks (test__generate, test__generate_reports_usage, test__generate_reports_extra_token_counts, test_generate_with_tool_calls_executes_tools) and need real completions first. Follows #6261.
Source: genkit-ai/genkit