Skip to main content

Llama-stack integration for Next Gen UI Agent

Project description

Next Gen UI Llama Stack Agent

Support for Llama Stack.

Installation

pip install -U next_gen_ui_llama_stack

Example

Integrate Next Gen UI with your assistent

Let's have your ReAct Agent e.g. Movies agent like this:

from llama_stack_client.lib.agents.react.agent import ReActAgent

client = LlamaStackClient(
    base_url=f"http://{LLAMA_STACK_HOST}:{LLAMA_STACK_PORT}",
)
INFERENCE_MODEL = "meta-llama/Llama-3.2-3B-Instruct"
movies_agent = ReActAgent(
    client=client,
    model=INFERENCE_MODEL,
    client_tools=[
        movies,
    ],
    json_response_format=True,
)

session_id = movies_agent.create_session("test-session")

# Send a query to your agent
response = movies_agent.create_turn(
    messages=[{"role": "user", "content": user_input}],
    session_id=session_id,
    stream=False,
)

Use NextGenUILlamaStackAgent class and just pass llama stack client and model name and pass steps from your movies agent to Next Gen UI Agent.

from next_gen_ui_llama_stack import NextGenUILlamaStackAgent

# Pass steps to Next Gen UI Agent
ngui_agent = NextGenUILlamaStackAgent(client, INFERENCE_MODEL)
result = await ngui_agent.turn_from_steps(user_input, steps=response.steps)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

next_gen_ui_llama_stack-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file next_gen_ui_llama_stack-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for next_gen_ui_llama_stack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38dab47a19b1f131d44c86341db81968e2fb18bc380e3863c8912044e4cbd448
MD5 e85a33493f95e2b964501954b567a3b4
BLAKE2b-256 96717a2d9079e31c32bab11be04bc4d4487806b4d9655e8f80cc791b2627176f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page