FEATURE: Add Claude 3 Haiku support
This commit is contained in:
parent
fc6c3c81e7
commit
ae2f0857be
|
@ -14,6 +14,7 @@ en:
|
||||||
gemini_pro: Gemini Pro
|
gemini_pro: Gemini Pro
|
||||||
claude_3_opus: Claude 3 Opus
|
claude_3_opus: Claude 3 Opus
|
||||||
claude_3_sonnet: Claude 3 Sonnet
|
claude_3_sonnet: Claude 3 Sonnet
|
||||||
|
claude_3_haiku: Claude 3 Haiku
|
||||||
scriptables:
|
scriptables:
|
||||||
llm_report:
|
llm_report:
|
||||||
fields:
|
fields:
|
||||||
|
@ -245,6 +246,7 @@ en:
|
||||||
fake: "Fake Test Bot"
|
fake: "Fake Test Bot"
|
||||||
claude-3-opus: "Claude 3 Opus"
|
claude-3-opus: "Claude 3 Opus"
|
||||||
claude-3-sonnet: "Claude 3 Sonnet"
|
claude-3-sonnet: "Claude 3 Sonnet"
|
||||||
|
claude-3-haiku: "Claude 3 Haiku"
|
||||||
gpt-4: "GPT-4"
|
gpt-4: "GPT-4"
|
||||||
gpt-4-turbo: "GPT-4 Turbo"
|
gpt-4-turbo: "GPT-4 Turbo"
|
||||||
gpt-3:
|
gpt-3:
|
||||||
|
|
|
@ -331,6 +331,7 @@ discourse_ai:
|
||||||
- mixtral-8x7B-Instruct-V0.1
|
- mixtral-8x7B-Instruct-V0.1
|
||||||
- claude-3-opus
|
- claude-3-opus
|
||||||
- claude-3-sonnet
|
- claude-3-sonnet
|
||||||
|
- claude-3-haiku
|
||||||
ai_bot_add_to_header:
|
ai_bot_add_to_header:
|
||||||
default: true
|
default: true
|
||||||
client: true
|
client: true
|
||||||
|
|
|
@ -181,6 +181,8 @@ module DiscourseAi
|
||||||
"anthropic:claude-3-opus"
|
"anthropic:claude-3-opus"
|
||||||
when DiscourseAi::AiBot::EntryPoint::CLAUDE_3_SONNET_ID
|
when DiscourseAi::AiBot::EntryPoint::CLAUDE_3_SONNET_ID
|
||||||
"anthropic:claude-3-sonnet"
|
"anthropic:claude-3-sonnet"
|
||||||
|
when DiscourseAi::AiBot::EntryPoint::CLAUDE_3_HAIKU_ID
|
||||||
|
"anthropic:claude-3-haiku"
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,6 +16,7 @@ module DiscourseAi
|
||||||
FAKE_ID = -116 # only used for dev and test
|
FAKE_ID = -116 # only used for dev and test
|
||||||
CLAUDE_3_OPUS_ID = -117
|
CLAUDE_3_OPUS_ID = -117
|
||||||
CLAUDE_3_SONNET_ID = -118
|
CLAUDE_3_SONNET_ID = -118
|
||||||
|
CLAUDE_3_HAIKU_ID = -119
|
||||||
|
|
||||||
BOTS = [
|
BOTS = [
|
||||||
[GPT4_ID, "gpt4_bot", "gpt-4"],
|
[GPT4_ID, "gpt4_bot", "gpt-4"],
|
||||||
|
@ -27,6 +28,7 @@ module DiscourseAi
|
||||||
[FAKE_ID, "fake_bot", "fake"],
|
[FAKE_ID, "fake_bot", "fake"],
|
||||||
[CLAUDE_3_OPUS_ID, "claude_3_opus_bot", "claude-3-opus"],
|
[CLAUDE_3_OPUS_ID, "claude_3_opus_bot", "claude-3-opus"],
|
||||||
[CLAUDE_3_SONNET_ID, "claude_3_sonnet_bot", "claude-3-sonnet"],
|
[CLAUDE_3_SONNET_ID, "claude_3_sonnet_bot", "claude-3-sonnet"],
|
||||||
|
[CLAUDE_3_HAIKU_ID, "claude_3_haiku_bot", "claude-3-haiku"],
|
||||||
]
|
]
|
||||||
|
|
||||||
BOT_USER_IDS = BOTS.map(&:first)
|
BOT_USER_IDS = BOTS.map(&:first)
|
||||||
|
@ -63,6 +65,8 @@ module DiscourseAi
|
||||||
CLAUDE_3_OPUS_ID
|
CLAUDE_3_OPUS_ID
|
||||||
in "claude-3-sonnet"
|
in "claude-3-sonnet"
|
||||||
CLAUDE_3_SONNET_ID
|
CLAUDE_3_SONNET_ID
|
||||||
|
in "claude-3-haiku"
|
||||||
|
CLAUDE_3_HAIKU_ID
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,6 +8,7 @@ module DiscourseAi
|
||||||
{ id: "gpt-3.5-turbo", name: "discourse_automation.ai_models.gpt_3_5_turbo" },
|
{ id: "gpt-3.5-turbo", name: "discourse_automation.ai_models.gpt_3_5_turbo" },
|
||||||
{ id: "claude-2", name: "discourse_automation.ai_models.claude_2" },
|
{ id: "claude-2", name: "discourse_automation.ai_models.claude_2" },
|
||||||
{ id: "gemini-pro", name: "discourse_automation.ai_models.gemini_pro" },
|
{ id: "gemini-pro", name: "discourse_automation.ai_models.gemini_pro" },
|
||||||
|
{ id: "claude-3-haiku", name: "discourse_automation.ai_models.claude_3_haiku" },
|
||||||
{ id: "claude-3-sonnet", name: "discourse_automation.ai_models.claude_3_sonnet" },
|
{ id: "claude-3-sonnet", name: "discourse_automation.ai_models.claude_3_sonnet" },
|
||||||
{ id: "claude-3-opus", name: "discourse_automation.ai_models.claude_3_opus" },
|
{ id: "claude-3-opus", name: "discourse_automation.ai_models.claude_3_opus" },
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,8 +6,7 @@ module DiscourseAi
|
||||||
class ClaudeMessages < Dialect
|
class ClaudeMessages < Dialect
|
||||||
class << self
|
class << self
|
||||||
def can_translate?(model_name)
|
def can_translate?(model_name)
|
||||||
# TODO: add haiku not released yet as of 2024-03-05
|
%w[claude-3-haiku claude-3-sonnet claude-3-opus].include?(model_name)
|
||||||
%w[claude-3-sonnet claude-3-opus].include?(model_name)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def tokenizer
|
def tokenizer
|
||||||
|
|
|
@ -6,7 +6,8 @@ module DiscourseAi
|
||||||
class AnthropicMessages < Base
|
class AnthropicMessages < Base
|
||||||
class << self
|
class << self
|
||||||
def can_contact?(endpoint_name, model_name)
|
def can_contact?(endpoint_name, model_name)
|
||||||
endpoint_name == "anthropic" && %w[claude-3-opus claude-3-sonnet].include?(model_name)
|
endpoint_name == "anthropic" &&
|
||||||
|
%w[claude-3-haiku claude-3-opus claude-3-sonnet].include?(model_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def dependant_setting_names
|
def dependant_setting_names
|
||||||
|
|
|
@ -24,7 +24,7 @@ module DiscourseAi
|
||||||
@models_by_provider ||=
|
@models_by_provider ||=
|
||||||
{
|
{
|
||||||
aws_bedrock: %w[claude-instant-1 claude-2],
|
aws_bedrock: %w[claude-instant-1 claude-2],
|
||||||
anthropic: %w[claude-instant-1 claude-2 claude-3-sonnet claude-3-opus],
|
anthropic: %w[claude-instant-1 claude-2 claude-3-haiku claude-3-sonnet claude-3-opus],
|
||||||
vllm: %w[
|
vllm: %w[
|
||||||
mistralai/Mixtral-8x7B-Instruct-v0.1
|
mistralai/Mixtral-8x7B-Instruct-v0.1
|
||||||
mistralai/Mistral-7B-Instruct-v0.2
|
mistralai/Mistral-7B-Instruct-v0.2
|
||||||
|
|
Loading…
Reference in New Issue