discourse-ai/lib
Sam 7f16d3ad43
FEATURE: Cohere Command R support (#558)
- Added Cohere Command models (Command, Command Light, Command R, Command R Plus) to the available model list
- Added a new site setting `ai_cohere_api_key` for configuring the Cohere API key
- Implemented a new `DiscourseAi::Completions::Endpoints::Cohere` class to handle interactions with the Cohere API, including:
   - Translating request parameters to the Cohere API format
   - Parsing Cohere API responses 
   - Supporting streaming and non-streaming completions
   - Supporting "tools" which allow the model to call back to discourse to lookup additional information
- Implemented a new `DiscourseAi::Completions::Dialects::Command` class to translate between the generic Discourse AI prompt format and the Cohere Command format
- Added specs covering the new Cohere endpoint and dialect classes
- Updated `DiscourseAi::AiBot::Bot.guess_model` to map the new Cohere model to the appropriate bot user

In summary, this PR adds support for using the Cohere Command family of models with the Discourse AI plugin. It handles configuring API keys, making requests to the Cohere API, and translating between Discourse's generic prompt format and Cohere's specific format. Thorough test coverage was added for the new functionality.
2024-04-11 07:24:17 +10:00
..
ai_bot FEATURE: Cohere Command R support (#558) 2024-04-11 07:24:17 +10:00
ai_helper FIX: Prevent AI chat thread titles from being created before replies are posted (#517) 2024-03-07 16:14:17 -03:00
automation FIX: unify automation model translation (#540) 2024-03-21 11:32:35 +11:00
completions FEATURE: Cohere Command R support (#558) 2024-04-11 07:24:17 +10:00
configuration UX: Re-introduce embedding settings validations (#457) 2024-02-01 16:54:09 -03:00
database DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
embeddings FEATURE: Add BGE-M3 embeddings support (#569) 2024-04-10 17:24:01 -03:00
inference FEATURE: AI Bot RAG support. (#537) 2024-04-01 13:43:34 -03:00
nsfw DEV: Fix various typos (#434) 2024-01-19 12:51:26 +01:00
sentiment FIX: Truncate content for sentiment/toxicity classification (#431) 2024-01-17 15:17:58 -03:00
summarization FEATURE: remove gpt-4-turbo-0125 preview swap with gpt-4-turbo (#568) 2024-04-10 09:53:20 -03:00
tasks/modules FEATURE: Add BGE-M3 embeddings support (#569) 2024-04-10 17:24:01 -03:00
tokenizer FEATURE: Add BGE-M3 embeddings support (#569) 2024-04-10 17:24:01 -03:00
toxicity FIX: Truncate content for sentiment/toxicity classification (#431) 2024-01-17 15:17:58 -03:00
utils FEATURE: DNS SRV support for TEI (#363) 2023-12-18 13:21:21 -03:00
automation.rb FIX: unify automation model translation (#540) 2024-03-21 11:32:35 +11:00
chat_message_classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
engine.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
guardian_extensions.rb FIX: don't show share conversation incorrectly (#526) 2024-03-13 11:24:22 +11:00
post_classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00