Skip to content

ResponseReasoningItem' object has no attribute 'arguments' #1741

@oegedijk

Description

@oegedijk
  • [x ] This is actually a bug report.
  • I am not getting good LLM Results
  • I have tried asking for help in the community on discord or discussions and have not received a response.
  • I have tried searching the documentation and have not found an answer.

What Model are you using?

  • gpt-3.5-turbo
  • gpt-4-turbo
  • gpt-4
  • Other (please specify 03 with code interpreter)

Describe the bug
This is a bit of a stochastic bug, so find it hard to provide a lot of context, but just leaving it just in case.

I have a a structured extraction for which I am use o3 with code interpreter mode=Mode.RESPONSES_TOOLS_WITH_INBUILT_TOOLS

response, completion = await client.responses.create_with_completion(
                    model="03",
                    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}],
                    instructions=system_prompt
                    + f"\n\nYou must call the {response_model.__name__} function to return your final extraction.",
                    input=inputs,
                    response_model=response_model,
                    reasoning={"effort": "high"},
                    max_retries=AsyncRetrying(
                        stop=stop_after_attempt(3),
                        after=lambda retry: logger.info(
                            f"Retrying code interpreter call after validation error: {retry}"
                        ),
                    ),
                )

And then every now and then I see this in the logs:

<RetryCallState 4455142688: attempt #1; slept for 0.0; last result: failed (AttributeError 'ResponseReasoningItem' object has no attribute 'arguments')>

I think calls to an .arguments attribute are mostly related at trying to extract the arguments of a function call?

So looking at this cookbook sometimes openai returns both a ResponseReasoningItem and the ResponseFunctionToolCall

https://cookbook.openai.com/examples/responses_api/reasoning_items

response.output

[ResponseReasoningItem(id='rs_68210c71a95c81919cc44afadb9d220400c77cc15fd2f785', summary=[], type='reasoning', status=None),
ResponseFunctionToolCall(arguments='{"latitude":48.8566,"longitude":2.3522}', call_id='call_9ylqPOZUyFEwhxvBwgpNDqPT', name='get_weather', type='function_call', id='fc_68210c78357c8191977197499d5de6ca00c77cc15fd2f785', status='completed')]

So seems sometimes we try to get the arguments from the reasoning instead of the function tool call?

Sorry cannot be more specific.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions