Skip to content
代码片段 群组 项目
提交 71109150 编辑于 作者: Nathan Weinshenker's avatar Nathan Weinshenker
浏览文件

Chore: remove the feature flag default

Removing the feature flag associated to claude 3.5 sonnet.

Changelog: removed
EE: true
上级 fbe2a5fd
No related branches found
No related tags found
无相关合并请求
---
name: use_sonnet_35
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/468334
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/157696
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/469499
milestone: '17.2'
group: group::ai framework
type: beta
default_enabled: true
...@@ -70,7 +70,7 @@ def default_options ...@@ -70,7 +70,7 @@ def default_options
def model(options) def model(options)
return options[:model] if options[:model].present? return options[:model] if options[:model].present?
Feature.enabled?(:use_sonnet_35, user) ? CLAUDE_3_5_SONNET : CLAUDE_3_SONNET CLAUDE_3_5_SONNET
end end
def provider(options) def provider(options)
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
let(:ai_client) { double } let(:ai_client) { double }
let(:endpoint) { described_class::ENDPOINT } let(:endpoint) { described_class::ENDPOINT }
let(:model) { nil } let(:model) { nil }
let(:expected_model) { described_class::CLAUDE_3_SONNET } let(:expected_model) { described_class::CLAUDE_3_5_SONNET }
let(:provider) { :anthropic } let(:provider) { :anthropic }
let(:params) do let(:params) do
{ {
...@@ -88,7 +88,6 @@ ...@@ -88,7 +88,6 @@
before do before do
allow(Gitlab::Llm::Logger).to receive(:build).and_return(logger) allow(Gitlab::Llm::Logger).to receive(:build).and_return(logger)
allow(instance).to receive(:ai_client).and_return(ai_client) allow(instance).to receive(:ai_client).and_return(ai_client)
stub_feature_flags(use_sonnet_35: false)
end end
shared_examples 'performing request to the AI Gateway' do shared_examples 'performing request to the AI Gateway' do
...@@ -152,53 +151,6 @@ ...@@ -152,53 +151,6 @@
end end
end end
context 'when using Sonnet 3.5 model' do
let(:expected_model) { described_class::CLAUDE_3_5_SONNET }
before do
stub_feature_flags(use_sonnet_35: true)
end
it 'calls the AI Gateway streaming endpoint and yields response without stripping it' do
expect(ai_client).to receive(:stream).with(endpoint: endpoint, body: body).and_yield(response)
.and_return(response)
expect { |b| instance.request(prompt, &b) }.to yield_with_args(response)
end
it_behaves_like 'performing request to the AI Gateway'
it_behaves_like 'tracks events for AI requests', 4, 2, klass: 'Gitlab::Llm::Anthropic::Client' do
before do
allow(ai_client).to receive(:stream).with(endpoint: endpoint, body: body).and_return(response)
end
end
context 'when additional params are passed in as options' do
let(:options) do
{ temperature: 1, stop_sequences: %W[\n\Foo Bar:], max_tokens_to_sample: 1024, disallowed_param: 1, topP: 1 }
end
let(:params) do
{
max_tokens_to_sample: 1024,
stop_sequences: ["\n\Foo", "Bar:"],
temperature: 1
}
end
it_behaves_like 'performing request to the AI Gateway'
end
context 'when unit primitive is passed' do
let(:endpoint) { "#{described_class::BASE_ENDPOINT}/test" }
subject(:request) { instance.request(prompt, unit_primitive: :test) }
it_behaves_like 'performing request to the AI Gateway'
end
end
context 'when invalid model is passed' do context 'when invalid model is passed' do
let(:model) { 'test' } let(:model) { 'test' }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册