Skip to content

feat: Create Financial Assistant agent with Docker and API #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbarenas
Copy link

This commit introduces the "Financial Assistant" agent, forked from the "Financial Advisor" agent.

Key changes include:

  • Created a new agent directory: python/agents/financial-assistant/.
  • Updated README.md with:
    • New agent name and description.
    • Instructions for running with Docker (Dockerfile created).
    • Information on API usage (FastAPI app created).
    • Details on model customization and limitations.
  • Added a Dockerfile for containerized execution.
  • Implemented an API using FastAPI:
    • Added fastapi and uvicorn to pyproject.toml.
    • Created financial_advisor/main.py with a /invoke endpoint.
    • Updated Dockerfile CMD to run Uvicorn.

Challenges Encountered:
The primary challenge was with building the Docker image due to issues with poetry lock and poetry install in the provided environment. The poetry lock command consistently failed with a "Could not parse version constraint: ==*" error when processing the full set of project dependencies for Poetry version 1.7.1.

Attempts to resolve this included:

  • Ensuring the project name in pyproject.toml was correct ("financial-assistant").
  • Trying various poetry lock and poetry install strategies.
  • Modifying the Dockerfile to use poetry export to a requirements.txt and then pip install -r requirements.txt.

Unfortunately, the poetry export command also relies on a valid lock file for full dependency resolution, so I could not fully overcome these issues in the current environment. I was unable to successfully complete testing the Dockerized agent due to these persistent Docker build failures related to Poetry.

Further work would require a more flexible environment for Poetry or manual adjustments to the dependency list to isolate the problematic constraint. The current submission includes all code changes up to the point of the Docker build issues.

This commit introduces the "Financial Assistant" agent, forked from the
"Financial Advisor" agent.

Key changes include:
- Created a new agent directory: `python/agents/financial-assistant/`.
- Updated `README.md` with:
    - New agent name and description.
    - Instructions for running with Docker (Dockerfile created).
    - Information on API usage (FastAPI app created).
    - Details on model customization and limitations.
- Added a `Dockerfile` for containerized execution.
- Implemented an API using FastAPI:
    - Added `fastapi` and `uvicorn` to `pyproject.toml`.
    - Created `financial_advisor/main.py` with a `/invoke` endpoint.
    - Updated Dockerfile CMD to run Uvicorn.

Challenges Encountered:
The primary challenge was with building the Docker image due to issues
with `poetry lock` and `poetry install` in the provided environment.
The `poetry lock` command consistently failed with a "Could not parse
version constraint: ==*" error when processing the full set of project
dependencies for Poetry version 1.7.1.

Attempts to resolve this included:
- Ensuring the project name in `pyproject.toml` was correct ("financial-assistant").
- Trying various `poetry lock` and `poetry install` strategies.
- Modifying the Dockerfile to use `poetry export` to a `requirements.txt`
  and then `pip install -r requirements.txt`.

Unfortunately, the `poetry export` command also relies on a valid lock
file for full dependency resolution, so I could not fully overcome these issues in the current environment. I was unable to successfully complete testing the Dockerized agent due to these
persistent Docker build failures related to Poetry.

Further work would require a more flexible environment for Poetry or
manual adjustments to the dependency list to isolate the problematic
constraint. The current submission includes all code changes up to the
point of the Docker build issues.
Copy link

google-cla bot commented May 22, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant