discourse/plugins/discourse-ai/lib/completions/endpoints
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
..
anthropic.rb DEV: update preset model versions (#39342) 2026-04-17 17:55:24 +10:00
anthropic_prompt_cache.rb FIX: update model presets to Claude 4.6 and refresh OpenRouter models (#37934) 2026-02-20 15:49:33 +11:00
anthropic_shared.rb FEATURE: Provider-native built-in tools for agents (web search) (#40809) 2026-06-16 14:37:51 -03:00
aws_bedrock.rb DEV: update preset model versions (#39342) 2026-04-17 17:55:24 +10:00
aws_bedrock_converse.rb FIX: AI: AWS Bedrock Converse image uploads were doubly base64-encoded (#39880) 2026-05-26 15:16:49 -03:00
base.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
canned_response.rb FEATURE: add agentic execution mode for AI personas (#38230) 2026-03-05 15:06:54 +11:00
cohere.rb FEATURE: native support for attachments in llms (#36415) 2025-12-09 17:28:52 +11:00
fake.rb FEATURE: add agentic execution mode for AI personas (#38230) 2026-03-05 15:06:54 +11:00
gemini.rb FEATURE: Provider-native built-in tools for agents (web search) (#40809) 2026-06-16 14:37:51 -03:00
hugging_face.rb FEATURE: native support for attachments in llms (#36415) 2025-12-09 17:28:52 +11:00
mistral.rb FEATURE: native support for attachments in llms (#36415) 2025-12-09 17:28:52 +11:00
ollama.rb FEATURE: native support for attachments in llms (#36415) 2025-12-09 17:28:52 +11:00
open_ai.rb FEATURE: Add service_tier support for OpenAI endpoints (#38359) 2026-03-09 15:05:44 +11:00
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_shared.rb FEATURE: Add service_tier support for OpenAI endpoints (#38359) 2026-03-09 15:05:44 +11:00
open_router.rb FEATURE: native support for attachments in llms (#36415) 2025-12-09 17:28:52 +11:00
samba_nova.rb FEATURE: native support for attachments in llms (#36415) 2025-12-09 17:28:52 +11:00
vllm.rb FEATURE: expand vLLM reasoning controls (#40727) 2026-06-11 07:25:28 +10:00