GithubHelp home page GithubHelp logo

rongzhang / financial-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from virattt/financial-agent

0.0 0.0 0.0 70 KB

A financial agent, built entirely with LangChain!

License: MIT License

Python 95.43% Dockerfile 4.57%

financial-agent's Introduction

Financial Agent

This is a financial agent built on Langchain and FastAPI that can help you with your financial queries. It can access current price, historical prices, latest news, and financial data for a ticker via the Polygon API.

To use this agent, you will need an OpenAI API key and a Polygon API key. If you don't have an OpenAI API key, you can get one here. If you don't have a Polygon API key, you can get one here.

For a simple example of how this agent works, check out the colab notebook here.

Deploy locally with Docker

For easy install and secure containerized deployment, install the appropriate version of Docker for your operating system.

Next, open a terminal and build a Docker image from the remote repository:

docker build -t virattt-financial-agent https://github.com/virattt/financial-agent.git

Then, run the Docker container, replacing $OPENAI_API_KEY and $POLYGON_API_KEY in the following command with your OpenAI and Polygon API keys:

docker run -e OPENAI_API_KEY=$OPENAI_API_KEY -e POLYGON_API_KEY=$POLYGON_API_KEY -p 8000:8000 --name financial-agent -it virattt-financial-agent

Navigate to http://localhost:8000/agent/playground/ in your browser to interact with the agent.

To stop the container, run:

docker stop financial-agent

Local deployment without Docker

To deploy the agent locally without Docker, make sure you have an up-to-date version of Python installed on your machine.

Open a terminal, clone the repo to your local machine, and open the folder:

git clone https://github.com/virattt/financial-agent.git
cd financial-agent

We recommend using the poetry package manager to install dependencies for this project. First, install the latest version of Poetry for your operating system.

Poetry will automatically create a virtual environment for this project. To install the dependencies and activate the virtual environment, run:

poetry install
poetry shell

Copy the .env.example file to a new file called .env:

cp .env.example .env

Then, open the .env file in a text editor and add your OpenAI and Polygon API keys.

Alternatively, you can set these environment variables in your terminal:

export OPENAI_API_KEY=<your-openai-api-key>
export POLYGON_API_KEY=<your-polygon-api-key>

Finally, start the LangChain server:

langchain serve

Then navigate to http://localhost:8000/agent/playground/ in your browser!

Questions?

Feel free to reach out to me on X here.

financial-agent's People

Contributors

virattt avatar chriscarrollsmith avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.