Function create_tool_prompt_segment

Source
pub fn create_tool_prompt_segment(
    tc: &ToolCollection,
    prompt: &str,
) -> PromptTemplate
Expand description

Creates a prompt that indicates the model should use the tools provided.

This function takes a reference to a ToolCollection and a &str prompt, then generates a PromptTemplate that includes a prefix and a description of the tools in the collection. This formatted prompt can be passed to the LLM to request its use of the provided tools.

§Arguments

  • tc: A reference to a ToolCollection containing the tools to be used by the LLM.
  • prompt: The base prompt to be used in the request.

§Returns

A PromptTemplate formatted with the provided tools and prompt.