Skip to main content
This example shows how to inject external dependencies into an agent. The context is evaluated when the agent is run, acting like dependency injection for Agents. Example prompts to try:
  • “Summarize the top stories on HackerNews”
  • “What are the trending tech discussions right now?”
  • “Analyze the current top stories and identify trends”
  • “What’s the most upvoted story today?”

Code

agent_context.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Install libraries

3

Run the agent