llama-index-packs-finchat


Namellama-index-packs-finchat JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
Summaryllama-index packs implementation of a hierarchical agent for finance chat.
upload_time2024-03-27 21:26:59
maintainer345ishaan
docs_urlNone
authorIshan Gupta
requires_python<3.12,>=3.8.1
licenseMIT
keywords agent finance finchat
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Finance Chat Llama Pack based on OpenAIAgent

This LlamaPack implements a hierarchical agent based on LLM for financial chat and information extraction purposed.

LLM agent is connected to various open financial apis as well as daily updated SP500 postgres SQL database storing
opening & closing price, volume as well as past earnings.

Based on the query, the agent reasons and routes to available tools or runs SQL query to retrieve information and
combine information to answer.

### Installation

```bash
pip install llama-index llama-index-packs-finchat
```

## CLI Usage

You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:

```bash
llamaindex-cli download-llamapack FinanceChatPack --download-dir ./finchat_pack
```

You can then inspect the files at `./finchat_pack` and use them as a template for your own project.

## Code Usage

You can download the pack to a the `./finchat_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

FinanceChatPack = download_llama_pack("FinanceChatPack", "./finchat_pack")
```

To use this tool, you'll need a few API keys:

- POLYGON_API_KEY -- <https://polygon.io/>
- FINNHUB_API_KEY -- <https://finnhub.io/>
- ALPHA_VANTAGE_API_KEY -- <https://www.alphavantage.co/>
- NEWSAPI_API_KEY -- <https://newsapi.org/>
- POSTGRES_DB_URI -- 'postgresql://postgres.xhlcobfkbhtwmckmszqp:fingptpassword#123@aws-0-us-east-1.pooler.supabase.com:5432/postgres' (You can also host your own postgres SQL DB with the same table signatures. To use different signatures, modification is required in giving query examples for SQL code generation.)

```python
fin_agent = FinanceChatPack(
    POLYGON_API_KEY,
    FINNHUB_API_KEY,
    ALPHA_VANTAGE_API_KEY,
    NEWSAPI_API_KEY,
    OPENAI_API_KEY,
)
```

From here, you can use the pack, or inspect and modify the pack in `./finchat_pack`.

The `run()` function chats with the agent and sends the response of the input query.

```python
response = fin_agent.run("<query>")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-packs-finchat",
    "maintainer": "345ishaan",
    "docs_url": null,
    "requires_python": "<3.12,>=3.8.1",
    "maintainer_email": null,
    "keywords": "agent, finance, finchat",
    "author": "Ishan Gupta",
    "author_email": "345ishaan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/65/7a/1f043249bec91507832a15785747aaacb0f7e5e9730a4684510810052bec/llama_index_packs_finchat-0.1.1.tar.gz",
    "platform": null,
    "description": "# Finance Chat Llama Pack based on OpenAIAgent\n\nThis LlamaPack implements a hierarchical agent based on LLM for financial chat and information extraction purposed.\n\nLLM agent is connected to various open financial apis as well as daily updated SP500 postgres SQL database storing\nopening & closing price, volume as well as past earnings.\n\nBased on the query, the agent reasons and routes to available tools or runs SQL query to retrieve information and\ncombine information to answer.\n\n### Installation\n\n```bash\npip install llama-index llama-index-packs-finchat\n```\n\n## CLI Usage\n\nYou can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:\n\n```bash\nllamaindex-cli download-llamapack FinanceChatPack --download-dir ./finchat_pack\n```\n\nYou can then inspect the files at `./finchat_pack` and use them as a template for your own project.\n\n## Code Usage\n\nYou can download the pack to a the `./finchat_pack` directory:\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\nFinanceChatPack = download_llama_pack(\"FinanceChatPack\", \"./finchat_pack\")\n```\n\nTo use this tool, you'll need a few API keys:\n\n- POLYGON_API_KEY -- <https://polygon.io/>\n- FINNHUB_API_KEY -- <https://finnhub.io/>\n- ALPHA_VANTAGE_API_KEY -- <https://www.alphavantage.co/>\n- NEWSAPI_API_KEY -- <https://newsapi.org/>\n- POSTGRES_DB_URI -- 'postgresql://postgres.xhlcobfkbhtwmckmszqp:fingptpassword#123@aws-0-us-east-1.pooler.supabase.com:5432/postgres' (You can also host your own postgres SQL DB with the same table signatures. To use different signatures, modification is required in giving query examples for SQL code generation.)\n\n```python\nfin_agent = FinanceChatPack(\n    POLYGON_API_KEY,\n    FINNHUB_API_KEY,\n    ALPHA_VANTAGE_API_KEY,\n    NEWSAPI_API_KEY,\n    OPENAI_API_KEY,\n)\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./finchat_pack`.\n\nThe `run()` function chats with the agent and sends the response of the input query.\n\n```python\nresponse = fin_agent.run(\"<query>\")\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index packs implementation of a hierarchical agent for finance chat.",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "agent",
        " finance",
        " finchat"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6836cae7d8dc747ca5e295c5da245e206168de8ca4fdc7e3ef4a9a90fa4bbfac",
                "md5": "397c55d6f9d595109cc7e0fcb8552547",
                "sha256": "6026eddf809a5ab362dab31f7b5f123602ab45364ca8875bdbd325314b33fdfd"
            },
            "downloads": -1,
            "filename": "llama_index_packs_finchat-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "397c55d6f9d595109cc7e0fcb8552547",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.8.1",
            "size": 6764,
            "upload_time": "2024-03-27T21:26:58",
            "upload_time_iso_8601": "2024-03-27T21:26:58.232835Z",
            "url": "https://files.pythonhosted.org/packages/68/36/cae7d8dc747ca5e295c5da245e206168de8ca4fdc7e3ef4a9a90fa4bbfac/llama_index_packs_finchat-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "657a1f043249bec91507832a15785747aaacb0f7e5e9730a4684510810052bec",
                "md5": "fe643cc5c7420e9e381531e1abb90f29",
                "sha256": "f16fa2790c59a07cf1007148e5d4da08fa64810fc22a8fa858d10fa87ea0c5c4"
            },
            "downloads": -1,
            "filename": "llama_index_packs_finchat-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fe643cc5c7420e9e381531e1abb90f29",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.8.1",
            "size": 6479,
            "upload_time": "2024-03-27T21:26:59",
            "upload_time_iso_8601": "2024-03-27T21:26:59.771086Z",
            "url": "https://files.pythonhosted.org/packages/65/7a/1f043249bec91507832a15785747aaacb0f7e5e9730a4684510810052bec/llama_index_packs_finchat-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-27 21:26:59",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-packs-finchat"
}
        
Elapsed time: 0.21265s