discourse/plugins/discourse-ai/lib/completions/dialects
Rafael dos Santos Silva bc39aacc3d
FEATURE: Provider-native built-in tools for agents (web search) (#40809)
Adds a fourth kind of agent tool: provider-native built-in tools that
the
LLM provider executes server-side, rather than tools Discourse runs and
feeds back. The first one is web search, supported on Gemini (Google
Search
grounding), OpenAI (web search via the Responses API) and Anthropic
(Claude
web search).

Native tools are stored on the agent's `tools` column with a `native-`
prefix, flow to the prompt as a separate `native_tools` list (never as
runnable Tool classes), and each provider dialect renders them into its
own
request payload. Response processors already ignore the server-side
tool/grounding blocks, so the bot loop never tries to execute them.

They are only selectable when the agent forces a default LLM whose
provider
supports the tool; this is enforced both in the editor UI (filtered by
the
selected LLM's `supported_native_tools`) and by server-side validation.

Also fixes the Gemini endpoint sending `function_calling_config` without
any
`function_declarations`, which the API rejects when only native tools
are
present.

---------

Co-authored-by: Sam Saffron <sam.saffron@gmail.com>
2026-06-16 14:37:51 -03:00
..
chat_gpt.rb FEATURE: extract text from document uploads for LLM prompts (#39634) 2026-05-05 08:16:23 +10:00
claude.rb FEATURE: Provider-native built-in tools for agents (web search) (#40809) 2026-06-16 14:37:51 -03:00
claude_tools.rb FEATURE: support thinking summary on responses API (#36013) 2025-11-18 07:54:14 +11:00
cohere_tools.rb
command.rb DEV: Remove unused VALID_ID_REGEX constants (#37432) 2026-02-02 16:25:04 +11:00
converse.rb FIX: AI: AWS Bedrock Converse image uploads were doubly base64-encoded (#39880) 2026-05-26 15:16:49 -03:00
converse_tools.rb FEATURE: Add AWS Bedrock Converse API provider (#38903) 2026-03-30 12:37:30 -03:00
dialect.rb FEATURE: Provider-native built-in tools for agents (web search) (#40809) 2026-06-16 14:37:51 -03:00
fake.rb
gemini.rb FEATURE: Provider-native built-in tools for agents (web search) (#40809) 2026-06-16 14:37:51 -03:00
mistral.rb DEV: Remove unused native_tool_support? (#37439) 2026-02-02 19:03:22 +11:00
nova.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
nova_tools.rb
ollama.rb
ollama_tools.rb
open_ai_compatible.rb
open_ai_responses.rb FEATURE: Provider-native built-in tools for agents (web search) (#40809) 2026-06-16 14:37:51 -03:00
open_ai_tools.rb FIX: properly terminate chains of tool calls across multiple providers (#36750) 2025-12-19 07:00:51 +11:00
xml_tools.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00