Skip to main content

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


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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_packs_cohere_citation_chat-0.1.5.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_cohere_citation_chat-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b299fe29a5ce912c5051a1a67c73a19e1273095bfca664e8d5a25d7245e29cba
MD5 633eb43cd93eef1227c6fe5d15d79be9
BLAKE2b-256 7af531dc50abcb32809e45cf97b991ad87a4e3163ed4e0a148d660dd28b3c5d9

See more details on using hashes here.

File details

Details for the file llama_index_packs_cohere_citation_chat-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_cohere_citation_chat-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6fd679564e29b0c028be5d59e9b1ba4c76bd28f94df26490b11830d76d8d5061
MD5 eb02f6a427699065ce9d94eff1e90653
BLAKE2b-256 f2290a0106c8350370baf7d4dfbd214b8e22f28102ffabff3f7b3391792c305e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page