Promote: native function-calling + svg/canvas recovery - #360
Merged
Conversation
…ction Generative tools carry a big SVG/code arg that rarely survives JSON-escaping, so models (e.g. GLM) emit the <svg> or js code block directly and parseAction fails -> 'I didn't quite catch that'. Add recoverContentAction: when parseAction fails and a scoped generative tool matches raw output (an <svg> or a js fence), run that tool on the raw content (the executor already extracts/sanitizes it).
fix(agent): recover svg/canvas artifacts when the model skips the JSON action
…ol use) Add provider.chatTools using the real OpenAI tools/tool_calls and Anthropic tool_use APIs — so big/complex args (SVG, code, multi-step plans) are encoded by the provider, not hand-formatted by the model as fragile JSON-in-prose. useAgentChat now runs a NATIVE tool loop for cloud providers (proper assistant/tool messages), falling back to the prompt-based JSON loop for on-device WebLLM. Executor running (file/param collection, chaining, param prompting) extracted into a shared runExecutor used by both loops.
feat(agent): native function-calling for cloud providers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes native function-calling for cloud providers (#359) and the svg/canvas content-recovery fix (#358) to production.