Repository navigation
feat(boson): Turn on Boson's built-in web search and release 0.2.2 - #77
Merged
Merged
Conversation
boson({ webSearch }) sends { type: "web_search" } next to the app's function
tools, with tool_choice "auto", on connect and on every tool update. Calls Boson
runs itself (executor "server") no longer reach the runtime as tool calls, so
nothing answers them with a function_call_output or an extra response.create;
they surface as server_tool.call / server_tool.result extension events, and a
response that only made such a call ends as completed instead of tool_calls.
An app tool named web_search is refused while the built-in is on.
All packages move to 0.2.2.
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.
Description:
Fixes #xxx:
No linked issue. Boson never searched the web because vRT sent every tool as
type: "function", so Boson's built-in{ "type": "web_search" }never reached it.Behaviours Completed:
boson({ webSearch: true | { allowedDomains | excludedDomains, country } })offers Boson's built-in web search, withtool_choice: "auto", on connect (even with no app tools) and on every tool update.executor: "server") no longer reach the runtime as tool calls: nothing answers them withfunction_call_outputor an extraresponse.create, as Boson's docs require.completed, nottool_calls(which the runtime reported as "tool_calls without tool calls").server_tool.call(with arguments) andserver_tool.resultextension events for logging.web_searchis reserved: connecting with an app tool of that name fails; a later tool update leaves it out and reports a recoverableinvalid_request.Files Changed:
packages/openai-compatible/src/index.ts:builtinToolsoption, server-executed call tracking, stop reason, reserved names.packages/boson/src/index.ts:webSearchoption andbosonWebSearchTool().packages/boson/test/boson.test.ts: adapter tests and a runtime test throughstartSession.website/src/content/docs/guides/models.md: Boson web search section.package.jsonof every package and example,package-lock.json: version 0.2.2.Brief Explanation:
The OpenAI-compatible base gains
builtinTools, provider tools sent as-is after the app's function tools. Afunction_callitem markedexecutor: "server"(or named after a built-in, if a provider omits the mark) is remembered by call id. Its argument events become aserver_tool.callextension event instead oftool.call, and itsfunction_call_output(added by Boson) becomesserver_tool.result. Core is unchanged: the turn ends after the preamble, and Boson's own follow-up response starts a new turn as any provider-initiated response does.Testing:
npm run check:spec,npm run typecheck,npm test(597 tests),npm run test:e2e,npm run pack,npm run check:budgets,npm run test:consumer: all pass locally.tool.call, nothing sent back, both responsescompleted, and through the real runtime exactly oneresponse.create, nofunction_call_output, both spoken replies in the transcript.Unsure About:
webSearchis off by default, so other Boson users of vRT see no change. Turning it on by default is a one-line change if preferred.