|
1 | | -TODO |
| 1 | +# Example agent for financial prompt optimization |
2 | 2 |
|
3 | | -Set OPENAI_API_KEY |
| 3 | +This is a minimal example agent, powered by OpenAI, that optimizes a user's |
| 4 | +financial prompt for clarity, specificity, and actionability. It has no widget |
| 5 | +integration and focuses solely on improving prompts. |
4 | 6 |
|
5 | | -poetry run python main.py |
| 7 | +## Getting started |
| 8 | + |
| 9 | +Here's how to get your agent up and running: |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | + |
| 13 | +Ensure you have poetry, a tool for dependency management and packaging in |
| 14 | +Python, as well as your OpenAI API key. |
| 15 | + |
| 16 | +### Installation and Running |
| 17 | + |
| 18 | +1. Clone this repository to your local machine. |
| 19 | + |
| 20 | +2. Set the OpenAI API key as an environment variable in your .bashrc or .zshrc file: |
| 21 | + |
| 22 | + ``` sh |
| 23 | + # in .zshrc or .bashrc |
| 24 | + export OPENAI_API_KEY=<your-api-key> |
| 25 | + ``` |
| 26 | + |
| 27 | +3. Install the necessary dependencies: |
| 28 | + |
| 29 | +``` sh |
| 30 | +poetry install --no-root |
| 31 | +``` |
| 32 | + |
| 33 | +4. Start the API server: |
| 34 | + |
| 35 | +``` sh |
| 36 | +cd financial-prompt-optimizer |
| 37 | +poetry run uvicorn financial_prompt_optimizer.main:app --port 7777 --reload |
| 38 | +``` |
| 39 | + |
| 40 | +This command runs the FastAPI application, making it accessible on your network. |
| 41 | + |
| 42 | +### Accessing the Documentation |
| 43 | + |
| 44 | +Once the API server is running, you can view the documentation and interact with |
| 45 | +the API by visiting: http://localhost:7777/docs |
| 46 | + |
| 47 | +### Using with OpenBB Workspace (Optional) |
| 48 | + |
| 49 | +- The agent descriptor is available at: http://localhost:7777/agents.json |
| 50 | +- Features are set to: |
| 51 | + - `streaming: true` |
| 52 | + - `widget-dashboard-select: false` |
| 53 | + - `widget-dashboard-search: false` |
| 54 | + |
| 55 | +### Expected Behavior |
| 56 | + |
| 57 | +When you send a user message, the agent streams a single answer containing two |
| 58 | +sections: |
| 59 | + |
| 60 | +- `Optimized Prompt: <improved prompt>` |
0 commit comments