llama-index-packs-cohere-citation-chat


Namellama-index-packs-cohere-citation-chat JSON
Version 0.1.3 PyPI version JSON
download
home_page
Summaryllama-index packs cohere_citation_chat integration
upload_time2024-03-08 02:31:33
maintainerEugeneLightsOn
docs_urlNone
authorYour Name
requires_python>=3.8.1,<4.0
licenseMIT
keywords chat citation cite cohere engine index
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cohere Citations Chat Engine Pack

Creates and runs a custom `VectorStoreIndexWithCitationsChat` -- which provides the chat engine with documents/citation mode.
See the documentation [here](https://docs.cohere.com/docs/retrieval-augmented-generation-rag) and [here](https://docs.cohere.com/docs/retrieval-augmented-generation-rag).

## CLI Usage

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

```bash
llamaindex-cli download-llamapack CohereCitationChatEnginePack --download-dir ./cohere_citation_chat_pack
```

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

You can also directly install it if you don't want to look at/inspect the source code:

```bash
pip install llama-index-packs-cohere-citation-chat
```

## Code Usage

You can download the pack to the `./cohere_citation_chat_pack` directory:

```python
from llama_index.readers.web import SimpleWebPageReader
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
CohereCitationChatEnginePack = download_llama_pack(
    "CohereCitationChatEnginePack", "./cohere_citation_chat_pack"
)
documents = SimpleWebPageReader().load_data(
    [
        "https://raw.githubusercontent.com/jerryjliu/llama_index/adb054429f642cc7bbfcb66d4c232e072325eeab/examples/paul_graham_essay/data/paul_graham_essay.txt"
    ]
)
cohere_citation_chat_pack = CohereCitationChatEnginePack(
    documents=documents, cohere_api_key="your-api-key"
)
chat_engine = cohere_citation_chat_pack.run()
response = chat_engine.chat("What can you tell me about LLMs?")

# print chat response
print(response)

# print documents
print(response.documents)

# print citations
print(response.citations)
```

See the [notebook on llama](https://github.com/run-llama/llama_index/blob/main/llama-index-packs/llama-index-packs-cohere-citation-chat/examples/cohere_citation_chat_example.ipynb) for a full example.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "llama-index-packs-cohere-citation-chat",
    "maintainer": "EugeneLightsOn",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0",
    "maintainer_email": "",
    "keywords": "chat,citation,cite,cohere,engine,index",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/cc/fa/681167671bf585de9d7d90f088061ffadbc0cadd57ccea336f85b555f084/llama_index_packs_cohere_citation_chat-0.1.3.tar.gz",
    "platform": null,
    "description": "# Cohere Citations Chat Engine Pack\n\nCreates and runs a custom `VectorStoreIndexWithCitationsChat` -- which provides the chat engine with documents/citation mode.\nSee the documentation [here](https://docs.cohere.com/docs/retrieval-augmented-generation-rag) and [here](https://docs.cohere.com/docs/retrieval-augmented-generation-rag).\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 CohereCitationChatEnginePack --download-dir ./cohere_citation_chat_pack\n```\n\nYou can then inspect the files at `./cohere_citation_chat_pack` and use them as a template for your own project!\n\nYou can also directly install it if you don't want to look at/inspect the source code:\n\n```bash\npip install llama-index-packs-cohere-citation-chat\n```\n\n## Code Usage\n\nYou can download the pack to the `./cohere_citation_chat_pack` directory:\n\n```python\nfrom llama_index.readers.web import SimpleWebPageReader\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nCohereCitationChatEnginePack = download_llama_pack(\n    \"CohereCitationChatEnginePack\", \"./cohere_citation_chat_pack\"\n)\ndocuments = SimpleWebPageReader().load_data(\n    [\n        \"https://raw.githubusercontent.com/jerryjliu/llama_index/adb054429f642cc7bbfcb66d4c232e072325eeab/examples/paul_graham_essay/data/paul_graham_essay.txt\"\n    ]\n)\ncohere_citation_chat_pack = CohereCitationChatEnginePack(\n    documents=documents, cohere_api_key=\"your-api-key\"\n)\nchat_engine = cohere_citation_chat_pack.run()\nresponse = chat_engine.chat(\"What can you tell me about LLMs?\")\n\n# print chat response\nprint(response)\n\n# print documents\nprint(response.documents)\n\n# print citations\nprint(response.citations)\n```\n\nSee the [notebook on llama](https://github.com/run-llama/llama_index/blob/main/llama-index-packs/llama-index-packs-cohere-citation-chat/examples/cohere_citation_chat_example.ipynb) for a full example.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index packs cohere_citation_chat integration",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [
        "chat",
        "citation",
        "cite",
        "cohere",
        "engine",
        "index"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81cd81cdd10b4e486585cab175644c0e7329b6337d7c4f7b6a41f36cf3ac3773",
                "md5": "76cf6ccac7f1b6ecc4fbec7213cb9583",
                "sha256": "9f540846bd5540b7f28e72fa96e6ba8ca8dc6f4fbbd03deb1f73cf4949bcfbea"
            },
            "downloads": -1,
            "filename": "llama_index_packs_cohere_citation_chat-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "76cf6ccac7f1b6ecc4fbec7213cb9583",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0",
            "size": 7850,
            "upload_time": "2024-03-08T02:31:31",
            "upload_time_iso_8601": "2024-03-08T02:31:31.949023Z",
            "url": "https://files.pythonhosted.org/packages/81/cd/81cdd10b4e486585cab175644c0e7329b6337d7c4f7b6a41f36cf3ac3773/llama_index_packs_cohere_citation_chat-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ccfa681167671bf585de9d7d90f088061ffadbc0cadd57ccea336f85b555f084",
                "md5": "b811a4aed7d8cb0dae27eb861af0c1ed",
                "sha256": "7d7cc22ffaaab796a4ef5aa0f53e9750dfd49186131e2aeaea2aa57b25884bc0"
            },
            "downloads": -1,
            "filename": "llama_index_packs_cohere_citation_chat-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b811a4aed7d8cb0dae27eb861af0c1ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0",
            "size": 6975,
            "upload_time": "2024-03-08T02:31:33",
            "upload_time_iso_8601": "2024-03-08T02:31:33.136338Z",
            "url": "https://files.pythonhosted.org/packages/cc/fa/681167671bf585de9d7d90f088061ffadbc0cadd57ccea336f85b555f084/llama_index_packs_cohere_citation_chat-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-08 02:31:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-packs-cohere-citation-chat"
}
        
Elapsed time: 0.20443s