# 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": null,
"name": "llama-index-packs-cohere-citation-chat",
"maintainer": "EugeneLightsOn",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "chat, citation, cite, cohere, engine, index",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/57/7b/0f72014392f6785436ac4020446adbe80be639f9c291f574e268f7866a67/llama_index_packs_cohere_citation_chat-0.4.0.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.4.0",
"project_urls": null,
"split_keywords": [
"chat",
" citation",
" cite",
" cohere",
" engine",
" index"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d1c34b0576aeae0d147ec14567b4384c290fd41c306509a8c5d40f894db0d2e4",
"md5": "8b481b110498bd58499796d2afefe1b5",
"sha256": "e39ee365d778f8408f69d4f2a290c53c6f05422ad72d5bf3eb01e34e8e0f588c"
},
"downloads": -1,
"filename": "llama_index_packs_cohere_citation_chat-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8b481b110498bd58499796d2afefe1b5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 7820,
"upload_time": "2024-11-18T00:55:18",
"upload_time_iso_8601": "2024-11-18T00:55:18.798092Z",
"url": "https://files.pythonhosted.org/packages/d1/c3/4b0576aeae0d147ec14567b4384c290fd41c306509a8c5d40f894db0d2e4/llama_index_packs_cohere_citation_chat-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "577b0f72014392f6785436ac4020446adbe80be639f9c291f574e268f7866a67",
"md5": "a69bb37b221b2b82c6dc4b8d421c0869",
"sha256": "78453ef88233ca758c2788625155c6d72bad088b2878e908dc1afdd4853b8244"
},
"downloads": -1,
"filename": "llama_index_packs_cohere_citation_chat-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "a69bb37b221b2b82c6dc4b8d421c0869",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 7061,
"upload_time": "2024-11-18T00:55:20",
"upload_time_iso_8601": "2024-11-18T00:55:20.261152Z",
"url": "https://files.pythonhosted.org/packages/57/7b/0f72014392f6785436ac4020446adbe80be639f9c291f574e268f7866a67/llama_index_packs_cohere_citation_chat-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 00:55:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-packs-cohere-citation-chat"
}