discourse-ai/spec
Sam 1dde82eb58
FEATURE: allow specifying tool use none in completion prompt
This PR adds support for disabling further tool calls by setting tool_choice to :none across all supported LLM providers:

- OpenAI: Uses "none" tool_choice parameter
- Anthropic: Uses {type: "none"} and adds a prefill message to prevent confusion
- Gemini: Sets function_calling_config mode to "NONE"
- AWS Bedrock: Doesn't natively support tool disabling, so adds a prefill message

We previously used to disable tool calls by simply removing tool definitions, but this would cause errors with some providers. This implementation uses the supported method appropriate for each provider while providing a fallback for Bedrock.

Co-authored-by: Natalie Tay <natalie.tay@gmail.com>

* remove stray puts

* cleaner chain breaker for last tool call (works in thinking)

remove unused code

* improve test

---------

Co-authored-by: Natalie Tay <natalie.tay@gmail.com>
2025-03-25 08:06:43 +11:00
..
configuration FEATURE: PDF support for rag pipeline (#1118) 2025-02-14 12:15:07 +11:00
db/migrate FIX: Open AI embeddings config migration & Seeded indexes cleanup & (#1092) 2025-01-27 15:24:43 -03:00
fabricators DEV: improve artifact editing and eval system (#1130) 2025-02-19 15:44:33 +11:00
fixtures FIX: failing image caption spec (#1195) 2025-03-14 10:19:04 -07:00
jobs FEATURE: Experimental search results from an AI Persona. (#1139) 2025-02-20 14:37:58 -03:00
lib FEATURE: allow specifying tool use none in completion prompt 2025-03-25 08:06:43 +11:00
models DEV: add API to get topic info from a custom tool (#1197) 2025-03-17 18:47:23 +11:00
reports FEATURE: New sentiment analysis visualization report (#1109) 2025-02-20 09:14:10 -08:00
requests DEV: Improve title suggester suggestions when editing topic (#1182) 2025-03-11 11:16:06 -07:00
serializers DEV: Fix new Rubocop offenses 2024-03-06 15:23:29 +01:00
services DEV: Use full URL for problem check message (#1165) 2025-03-05 11:31:23 +08:00
shared FEATURE: Gemini Tokenizer (#1088) 2025-01-23 18:20:35 -03:00
support FEATURE: configurable embeddings (#1049) 2025-01-21 12:23:19 -03:00
system REFACTOR: Migrate Personas' form to FormKit (#1178) 2025-03-21 14:46:33 -03:00
tasks DEV: Add rake task to send topics or posts to spam scanner (#1059) 2025-01-15 11:48:57 +08:00
plugin_helper.rb DEV: Fix mismatched column types (#868) 2024-10-28 15:36:42 +02:00
plugin_spec.rb FEATURE: smart date support for AI helper (#1044) 2024-12-31 08:04:25 +11:00