Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Example agent with widget data as raw context and citations

This is an example agent, powered by OpenAI, that can perform question answering and remote function calling to the OpenBB Workspace to retrieve widget data, and then cite the data that has been retrieved.

Getting started

Here's how to get your copilot up and running:

Prerequisites

Ensure you have poetry, a tool for dependency management and packaging in Python, as well as your OpenAI API key.

Installation and Running

  1. Clone this repository to your local machine.

  2. Set the OpenAI API key as an environment variable in your .bashrc or .zshrc file:

    # in .zshrc or .bashrc
    export OPENAI_API_KEY=<your-api-key>
  3. Install the necessary dependencies:

poetry install --no-root

4.Start the API server:

cd 32-vanilla-agent-raw-widget-data-citations
poetry run uvicorn vanilla_agent_raw_context_citations.main:app --port 7777 --reload

This command runs the FastAPI application, making it accessible on your network.

Testing the Agent

The example copilot has a small, basic test suite to ensure it's working correctly. As you develop your copilot, you are highly encouraged to expand these tests.

You can run the tests with:

pytest tests

Accessing the Documentation

Once the API server is running, you can view the documentation and interact with the API by visiting: http://localhost:7777/docs