OpenAI Parser¶
Parser for OpenAI chat completion tool call responses.
openai
¶
Parser for OpenAI chat completion tool call responses.
OpenAIResponseParser
¶
Parses OpenAI ChatCompletion responses into AgentResponse.
Handles the OpenAI format where tool calls appear at: response.choices[].message.tool_calls[]
Each tool call has: {id, type, function: {name, arguments}}.
Works with both the raw dict format and the openai SDK objects.
Usage
parser = OpenAIResponseParser() response = parser.parse(openai_raw_response)
parse
¶
parse(raw_response: Any) -> AgentResponse
Parse an OpenAI response into a normalized AgentResponse.