Renders a tool into prompt content. Either a BaseTool instance, or, a JSON
schema must be provided.
Example:
from langchain_cohere.react_multi_hop.prompt import render_tool
json_schema = {
"name": "example_tool",
"description": "A description of example_tool",
"parameters": {
"type": "object",
"properties": {
"foo": {"type": "string", "description": "A description of foo"},
"bar": {"type": "integer", "description": "A description of bar"},
},
"required": ["foo"],
},
}
print(render_tool(json_schema=json_schema))
tool = MyTool()
print(render_tool(tool=tool))An instance of a BaseTool.
dict containing the JSON schema representation of a tool.