This is a minimal example agent, powered by OpenAI, that optimizes a user's financial prompt for clarity, specificity, and actionability. It has no widget integration and focuses solely on improving prompts.
Here's how to get your agent up and running:
Ensure you have poetry, a tool for dependency management and packaging in Python, as well as your OpenAI API key.
-
Clone this repository to your local machine.
-
Install the necessary dependencies:
poetry install --no-root
-
Set the OpenAI API key as an environment variable:
export OPENAI_API_KEY=<your-api-key>
-
Start the API server:
cd financial-prompt-optimizer poetry run uvicorn main:app --port 7777 --reload
This command runs the FastAPI application, making it accessible on your network.
Once the API server is running, you can view the documentation and interact with the API by visiting: http://localhost:7777/docs
- The agent descriptor is available at: http://localhost:7777/agents.json
- Features are set to:
streaming: truewidget-dashboard-select: falsewidget-dashboard-search: false
When you send a user message, the agent streams a single answer containing two sections:
Optimized Prompt: <single improved prompt>Rationale: <1–3 short bullets on what changed and why>