Skip to content

feat/cherry provider#132

Merged
xiami762 merged 2 commits intomainfrom
feat/cherry-provider
Apr 16, 2026
Merged

feat/cherry provider#132
xiami762 merged 2 commits intomainfrom
feat/cherry-provider

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

feat(provider): add Cherry Provider for client-side tool calling

Add a new provider that works with OpenAI-compatible backends lacking
server-side tool-call support (e.g. vLLM without --enable-auto-tool-choice).

Instead of passing tools in the API request, CherryProvider:
- Injects tool definitions into the system prompt
- Instructs the model to emit <tool_use> XML blocks in plain text
- Converts structured tool_calls/role="tool" history back to text on
subsequent turns so the backend never sees unsupported fields

Add a new provider that works with OpenAI-compatible backends lacking
server-side tool-call support (e.g. vLLM without --enable-auto-tool-choice).

Instead of passing `tools` in the API request, CherryProvider:
- Injects tool definitions into the system prompt
- Instructs the model to emit <tool_use> XML blocks in plain text
- Converts structured tool_calls/role="tool" history back to text on
  subsequent turns so the backend never sees unsupported fields

The existing StreamProcessor already parses <tool_use> blocks, so no
downstream changes are needed.

Registration: built-in ("cherry") and dynamic via npm="@ai-sdk/cherry"
in flocks.json.

Made-with: Cursor
@xiami762 xiami762 self-requested a review April 16, 2026 07:07
@xiami762 xiami762 merged commit b932ef8 into main Apr 16, 2026
2 checks passed
@xiami762 xiami762 deleted the feat/cherry-provider branch April 16, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants