Skip to content

Handle text-encoded tool calls from OpenAI-compatible chat completions#167

Open
paul-cayet wants to merge 1 commit into
mainfrom
fix-openai-compatible-text-tool-calls
Open

Handle text-encoded tool calls from OpenAI-compatible chat completions#167
paul-cayet wants to merge 1 commit into
mainfrom
fix-openai-compatible-text-tool-calls

Conversation

@paul-cayet
Copy link
Copy Markdown
Member

@paul-cayet paul-cayet commented May 27, 2026

Description

Adds a Chat Completions fallback for OpenAI-compatible providers that return tool calls as assistant text content, such as LM Studio-style <|tool_call>call:name{...} markers, instead of structured message.tool_calls or streamed delta.tool_calls.

The fallback is applied only when structured tool calls are absent, safely parses JSON arguments, supports streaming and non-streaming responses, and preserves normal text output on malformed markers.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant