Skip to content

An error occurs in the Viz tool's chart interpretation when using OpenAI's gpt-5.x. #242

Description

@jnhyeon

Thank you for creating such a great package :)

When using the gemini-3-flash-preview:cloud model in ollama, chart interpretation worked well.

However, when using OpenAI's gpt-5.x model, an error occurs.

I would appreciate it if you could fix this.

< code >
from pathlib import Path

from shiny import App, ui
from querychat import QueryChat
from querychat.data import titanic
from chatlas import ChatAzureOpenAICompletions

llm = ChatAzureOpenAICompletions(
api_key="",
endpoint="
",
deployment_id="gpt-5.5",
api_version="2025-04-01-preview",
)

qc = QueryChat(
titanic,
"titanic",
client=llm,
tools=("query", "visualize"),
prompt_template=Path("prompt.md"),
)

app_ui = ui.page_fluid(qc.ui())

def server(input, output, session):
qc.server()

app = App(app_ui, server)

< Error >
('Error in Chat('querychat_CSCM_SALES_PSI_PV-chat'): Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_RB81n3Dp1VpIsCXZ3bGfHpKp", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}}', False, False)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions