Skip to content

Add LLM ZeroShot Agent

George Koltsov requested to merge georgekoltsov/llm-zero-shot-agent into master

What does this MR do and why?

Mentions https://gitlab.com/gitlab-org/gitlab/-/issues/412296

Hard coded Vertex chat endpoint to work with, not with OpenAI

user = User.first
client = Gitlab::Llm::VertexAi::Client.new(user)
context = Gitlab::Llm::Chain::GitlabContext.new(current_user: user, client: client, namespace: Group.first, resource: Issue.first)
agent = Gitlab::Llm::Chain::Agents::ZeroShot.new(input_prompt: 'What is the weather today?', tools: [], context: context)

puts agent.execute.content

I don't see how I can help. Please give better instructions!

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by George Koltsov

Merge request reports