Skip to content

[BUG] Run azure_openai_neo4j sample code bug failed. #1298

@nadazero

Description

@nadazero

Bug Description

Run sample code azure_openai_neo4j.py in project but failed.

Steps to Reproduce

Run sample code azure_openai_neo4j.py in project but failed.

Expected Behavior

Run sample code azure_openai_neo4j.py normally

Actual Behavior

Run sample code azure_openai_neo4j.py in project but failed.

Environment

  • Graphiti Version: [0.28.1]
  • Python Version: [3.11.7]
  • Operating System: [Windows10]
  • Database Backend: [Neo4j 5.26.2]
  • LLM Provider & Model: [OpenAI gpt-5]

Installation Method

Error Messages/Traceback

Request: POST https://xxx.openai.azure.com/openai/v1/responses "HTTP/1.1 200 OK"
2026-03-04 16:03:39 - graphiti_core.llm_client.openai_base_client - WARNING - Retrying after application error (attempt 1/2): not enough values to unpack (expected 3, got 1)
2026-03-04 16:03:49 - httpx - INFO - HTTP Request: POST https://xxx.openai.azure.com/openai/v1/responses "HTTP/1.1 200 OK"
2026-03-04 16:03:49 - graphiti_core.llm_client.openai_base_client - WARNING - Retrying after application error (attempt 2/2): not enough values to unpack (expected 3, got 1)
2026-03-04 16:03:55 - httpx - INFO - HTTP Request: POST https://xxx.openai.azure.com/openai/v1/responses "HTTP/1.1 200 OK"
2026-03-04 16:03:55 - graphiti_core.llm_client.openai_base_client - ERROR - Max retries (2) exceeded. Last error: not enough values to unpack (expected 3, got 1)

Configuration

Additional Context

Possible Solution

Here is AI's analysis:
Cause of error:
Base class method signature mismatch: BaseOpenAIClient._handle_structured_response() returns tuple[dict, int, int] (3 values).
Azure subclass overridden method: AzureOpenAILLMClient._handle_structured_response() only returns dict (1 value).
Caller expects 3 values: The _generate_response() method calls _handle_structured_response() on line 181 and expects a 3-value tuple to be returned.
Unpacking failed on line 245: response, input_tokens, output_tokens = await self._generate_response(...)
Root cause: The Azure OpenAI client overrode the _handle_structured_response method but failed to correctly extract and return the token count information.

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