llama-index packs cohere_citation_chat integration
Project description
Cohere Citations Chat Engine Pack
Creates and runs a custom VectorStoreIndexWithCitationsChat
-- which provides the chat engine with documents/citation mode.
See the documentation here and here.
CLI Usage
You can download llamapacks directly using llamaindex-cli
, which comes installed with the llama-index
python package:
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:
pip install llama-index-packs-cohere-citation-chat
Code Usage
You can download the pack to the ./cohere_citation_chat_pack
directory:
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 for a full example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for llama_index_packs_cohere_citation_chat-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d7cc22ffaaab796a4ef5aa0f53e9750dfd49186131e2aeaea2aa57b25884bc0 |
|
MD5 | b811a4aed7d8cb0dae27eb861af0c1ed |
|
BLAKE2b-256 | ccfa681167671bf585de9d7d90f088061ffadbc0cadd57ccea336f85b555f084 |
Hashes for llama_index_packs_cohere_citation_chat-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f540846bd5540b7f28e72fa96e6ba8ca8dc6f4fbbd03deb1f73cf4949bcfbea |
|
MD5 | 76cf6ccac7f1b6ecc4fbec7213cb9583 |
|
BLAKE2b-256 | 81cd81cdd10b4e486585cab175644c0e7329b6337d7c4f7b6a41f36cf3ac3773 |