mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 02:05:37 +08:00
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> |
||
|---|---|---|
| .. | ||
| discourse_ai/ai_bot | ||
| ai_agent_mcp_server_spec.rb | ||
| ai_agent_multisite_spec.rb | ||
| ai_agent_spec.rb | ||
| ai_api_request_stat_spec.rb | ||
| ai_artifact_key_value_spec.rb | ||
| ai_mcp_server_spec.rb | ||
| ai_secret_spec.rb | ||
| ai_tool_action_spec.rb | ||
| ai_tool_spec.rb | ||
| embedding_definition_spec.rb | ||
| inferred_concept_spec.rb | ||
| llm_credit_allocation_spec.rb | ||
| llm_credit_daily_usage_spec.rb | ||
| llm_feature_credit_cost_spec.rb | ||
| llm_model_spec.rb | ||
| llm_quota_spec.rb | ||
| llm_quota_usage_spec.rb | ||
| model_accuracy_spec.rb | ||
| rag_document_fragment_spec.rb | ||
| reviewable_ai_chat_message_spec.rb | ||
| reviewable_ai_post_spec.rb | ||
| reviewable_ai_tool_action_spec.rb | ||
| shared_ai_conversation_spec.rb | ||
| user_option_spec.rb | ||