Skip to content
代码片段 群组 项目
未验证 提交 70803003 编辑于 作者: Gosia Ksionek's avatar Gosia Ksionek 提交者: GitLab
浏览文件

Add ai request to troubleshoot job

上级 33de5957
No related branches found
No related tags found
无相关合并请求
......@@ -84,6 +84,11 @@ def unit_primitive
'troubleshoot_job'
end
def ai_request
::Gitlab::Llm::Chain::Requests::AiGateway.new(context.current_user, service_name: :troubleshoot_job,
tracking_context: tracking_context)
end
def tracking_context
{
request_id: context.request_id,
......
......@@ -82,6 +82,13 @@
end
it 'sets the correct unit primitive' do
allow(Gitlab::Llm::Chain::Requests::AiGateway).to receive(:new).with(user, {
service_name: :troubleshoot_job,
tracking_context: {
request_id: nil,
action: 'troubleshoot_job'
}
}).and_return(ai_request_double)
expect(ai_request_double).to receive(:request).with(tool.prompt, unit_primitive: 'troubleshoot_job')
tool.execute
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册