quick start typeddict

This commit is contained in:
Justin Lee 2024-11-08 15:33:06 -08:00
parent 6569b1c840
commit 6f3b2bb815

View file

@ -23,8 +23,16 @@ Ensure you have the following installed on your system:
- **Conda**: A package, dependency, and environment management tool. - **Conda**: A package, dependency, and environment management tool.
### 2. Installation ### 2. Installation
The `llama` CLI tool helps you manage the Llama Stack toolchain and agent systems. The `llama` CLI tool helps you manage the Llama Stack toolchain and agent systems. Follow these step to install
First activate and activate your conda environment
```
conda create --name my-env
conda activate my-env
```
Then install llama-stack with pip, you could also check out other installation methods [here](https://llama-stack.readthedocs.io/en/latest/cli_reference/index.html).
```bash ```bash
pip install llama-stack pip install llama-stack
@ -129,8 +137,8 @@ client = LlamaStackClient(base_url="http://localhost:5000")
# Create a chat completion request # Create a chat completion request
response = client.inference.chat_completion( response = client.inference.chat_completion(
messages=[ messages=[
SystemMessage(content="You are a helpful assistant.", role="system"), {"role": "system", "content": "You are a helpful assistant."},
UserMessage(content="Write me a 2-sentence poem about the moon", role="user") {"role": "user", "content": "Write a two-sentence poem about llama."}
], ],
model="Llama3.2-3B-Instruct", model="Llama3.2-3B-Instruct",
) )