react_multi_hop#

Classes

react_multi_hop.parsing.CohereToolsReactAgentOutputParser

Parses a message into agent actions/finish.

Functions

react_multi_hop.agent.create_cohere_react_agent(...)

Create an agent that enables multiple tools to be used in sequence to complete a task.

react_multi_hop.parsing.parse_actions(generation)

Parse action selections from model output.

react_multi_hop.parsing.parse_answer_with_prefixes(...)

parses string into key-value pairs,

react_multi_hop.parsing.parse_citations(...)

Parses a grounded_generation (from parse_actions) and documents (from convert_to_documents) into a (generation, CohereCitation list) tuple.

react_multi_hop.parsing.parse_jsonified_tool_use_generation(...)

Parses model-generated jsonified actions.

react_multi_hop.prompt.convert_to_documents(...)

Converts observations into a 'document' dict

react_multi_hop.prompt.create_directly_answer_tool()

directly_answer is a special tool that's always presented to the model as an available tool.

react_multi_hop.prompt.multi_hop_prompt(...)

The returned function produces a BasePromptTemplate suitable for multi-hop.

react_multi_hop.prompt.render_intermediate_steps(...)

Renders an agent's intermediate steps into prompt content.

react_multi_hop.prompt.render_messages(messages)

Renders one or more BaseMessage implementations into prompt content.

react_multi_hop.prompt.render_observations(...)

Renders the 'output' part of an Agent's intermediate step into prompt content.

react_multi_hop.prompt.render_role(message)

Renders the role of a message into prompt content.

react_multi_hop.prompt.render_structured_preamble([...])

Renders the structured preamble part of the prompt content.

react_multi_hop.prompt.render_tool([tool, ...])

Renders a tool into prompt content. Either a BaseTool instance, or, a JSON