FEATURE: Add Mixtral support for AI Bot (#396)

This commit is contained in:
Roman Rizzi 2024-01-04 12:22:43 -03:00 committed by GitHub
parent e6422c542e
commit aa56baad37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 1 deletions

View File

@ -12,7 +12,7 @@ import copyConversation from "../discourse/lib/copy-conversation";
const AUTO_COPY_THRESHOLD = 4;
function isGPTBot(user) {
return user && [-110, -111, -112, -113].includes(user.id);
return user && [-110, -111, -112, -113, -114].includes(user.id);
}
function attachHeaderIcon(api) {

View File

@ -197,6 +197,8 @@ en:
gpt-3:
5-turbo: "GPT-3.5"
claude-2: "Claude 2"
mixtral-8x7B-Instruct-V0:
"1": "Mixtral-8x7B V0.1"
sentiments:
dashboard:
title: "Sentiment"

View File

@ -274,6 +274,7 @@ discourse_ai:
- gpt-4
- gpt-4-turbo
- claude-2
- mixtral-8x7B-Instruct-V0.1
ai_bot_add_to_header:
default: true
client: true

View File

@ -123,6 +123,8 @@ module DiscourseAi
"gpt-4-turbo"
when DiscourseAi::AiBot::EntryPoint::GPT3_5_TURBO_ID
"gpt-3.5-turbo-16k"
when DiscourseAi::AiBot::EntryPoint::MIXTRAL_ID
"mistralai/Mixtral-8x7B-Instruct-v0.1"
else
nil
end

View File

@ -9,11 +9,13 @@ module DiscourseAi
GPT3_5_TURBO_ID = -111
CLAUDE_V2_ID = -112
GPT4_TURBO_ID = -113
MIXTRAL_ID = -114
BOTS = [
[GPT4_ID, "gpt4_bot", "gpt-4"],
[GPT3_5_TURBO_ID, "gpt3.5_bot", "gpt-3.5-turbo"],
[CLAUDE_V2_ID, "claude_bot", "claude-2"],
[GPT4_TURBO_ID, "gpt4t_bot", "gpt-4-turbo"],
[MIXTRAL_ID, "mixtral_bot", "mixtral-8x7B-Instruct-V0.1"],
]
def self.map_bot_model_to_user_id(model_name)
@ -26,6 +28,8 @@ module DiscourseAi
GPT4_ID
in "claude-2"
CLAUDE_V2_ID
in "mixtral-8x7B-Instruct-V0.1"
MIXTRAL_ID
else
nil
end