custom_provider.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export your OpenAI API key
4
Accept the run context
Add
from agno.run import RunContext. Change query to def query(self, question: str, *, run_context: RunContext | None = None) -> Answer: and aquery to async def aquery(self, question: str, *, run_context: RunContext | None = None) -> Answer:. In aquery, return self.query(question, run_context=run_context).5
Run the example
Save the code above as
custom_provider.py, then run: