langchain_cohere
0.1.4¶
langchain_cohere.chat_models
¶
Classes¶
Implements the BaseChatModel (and BaseLanguageModel) interface with Cohere's large language models. |
Functions¶
|
Get the request for the Cohere chat API. |
|
Get the role of the message. |
langchain_cohere.cohere_agent
¶
Functions¶
|
langchain_cohere.common
¶
Classes¶
|
Cohere has fine-grained citations that specify the exact part of text. |
langchain_cohere.embeddings
¶
Classes¶
Implements the Embeddings interface with Cohere's text representation language models. |
langchain_cohere.llms
¶
Classes¶
Base class for Cohere models. |
|
Cohere large language models. |
Functions¶
|
Use tenacity to retry the completion call. |
|
Use tenacity to retry the completion call. |
|
Cut off the text as soon as any stop words occur. |
langchain_cohere.rag_retrievers
¶
Classes¶
Cohere Chat API with RAG. |
langchain_cohere.react_multi_hop
¶
Classes¶
Parses a message into agent actions/finish. |
Functions¶
Create an agent that enables multiple tools to be used in sequence to complete a task. |
|
|
Parse action selections from model output. |
parses string into key-value pairs, |
|
Parses a grounded_generation (from parse_actions) and documents (from convert_to_documents) into a (generation, CohereCitation list) tuple. |
|
|
Parses model-generated jsonified actions. |
Converts observations into a 'document' dict |
|
directly_answer is a special tool that's always presented to the model as an available tool. |
|
The returned function produces a BasePromptTemplate suitable for multi-hop. |
|
Renders an agent's intermediate steps into prompt content. |
|
|
Renders one or more BaseMessage implementations into prompt content. |
Renders the 'output' part of an Agent's intermediate step into prompt content. |
|
|
Renders the role of a message into prompt content. |
Renders the structured preamble part of the prompt content. |
|
Renders a tool into prompt content |
|
Renders the 'Args' section of a tool's prompt content. |
|
Renders the signature of a tool into prompt content. |
|
|
Renders a tool's type into prompt content. |
langchain_cohere.rerank
¶
Classes¶
Document compressor that uses Cohere Rerank API. |