Skip to content

Commit

Permalink
docs: update agent_execution_loop example code
Browse files Browse the repository at this point in the history
Signed-off-by: reidliu <[email protected]>
  • Loading branch information
reidliu committed Mar 2, 2025
1 parent 52977e5 commit 3e01e8d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/source/building_applications/agent_execution_loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,17 @@ sequenceDiagram
Each step in this process can be monitored and controlled through configurations. Here's an example that demonstrates monitoring the agent's execution:

```python
from llama_stack_client import LlamaStackClient
from llama_stack_client.lib.agents.agent import Agent
from llama_stack_client.lib.agents.event_logger import EventLogger
from llama_stack_client.types.agent_create_params import AgentConfig
from rich.pretty import pprint

# Replace host and port
client = LlamaStackClient(base_url=f"http://{HOST}:{PORT}")

agent_config = AgentConfig(
# Check with `llama-stack-client models list`
model="Llama3.2-3B-Instruct",
instructions="You are a helpful assistant",
# Enable both RAG and tool usage
Expand All @@ -81,7 +88,7 @@ agent_config = AgentConfig(
},
"builtin::code_interpreter",
],
# Configure safety
# Configure safety (optional)
input_shields=["llama_guard"],
output_shields=["llama_guard"],
# Control the inference loop
Expand Down

0 comments on commit 3e01e8d

Please sign in to comment.