discourse-ai/lib/completions/endpoints
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
..
anthropic.rb FEATURE: add Claude 3 sonnet/haiku support for Amazon Bedrock (#534) 2024-03-19 06:48:46 +11:00
aws_bedrock.rb FEATURE: add Claude 3 sonnet/haiku support for Amazon Bedrock (#534) 2024-03-19 06:48:46 +11:00
base.rb FEATURE: Cohere Command R support (#558) 2024-04-11 07:24:17 +10:00
canned_response.rb UX: Validations to LLM-backed features (except AI Bot) (#436) 2024-01-29 16:04:25 -03:00
cohere.rb FEATURE: Cohere Command R support (#558) 2024-04-11 07:24:17 +10:00
fake.rb FEATURE: allow personas to supply top_p and temperature params (#459) 2024-02-03 07:09:34 +11:00
gemini.rb FEATURE: Add GitHub Helper AI Bot persona and tools (#513) 2024-03-08 06:37:23 +11:00
hugging_face.rb UX: Validations to LLM-backed features (except AI Bot) (#436) 2024-01-29 16:04:25 -03:00
open_ai.rb FEATURE: remove gpt-4-turbo-0125 preview swap with gpt-4-turbo (#568) 2024-04-10 09:53:20 -03:00
vllm.rb UX: Validations to LLM-backed features (except AI Bot) (#436) 2024-01-29 16:04:25 -03:00