Logging examples in Python
OpenAI CLI agent
OpenAI agent
This is an example of a minimal OpenAI assistant in the console. Every interaction is logged to phospho.
It demonstrates how to use phospho.wrap()
with streaming content.
Installation
Setup
Create a .env
file:
If you don’t have a phospho API key and project ID, go to Getting Started for the step by step instructions.
Implementation
In assistant.py
, add the following code:
Launch the script and chat with the agent.
Go to the phospho dashboard to monitor the interactions.
Was this page helpful?