You want to create a tool that converts temperatures from Celsius to Fahrenheit for an agent. Which code correctly creates this tool with a clear description?
hard📝 Application Q15 of 15
LangChain - Agents
You want to create a tool that converts temperatures from Celsius to Fahrenheit for an agent. Which code correctly creates this tool with a clear description?
Adef convert_temp(f):
return (f - 32) * 5/9
from langchain.agents import Tool
tool = Tool(name='temp_convert', func=convert_temp, description='Converts Fahrenheit to Celsius')
Bdef c_to_f(c):
return c + 32
from langchain.agents import Tool
temp_tool = Tool(name='temp', func=c_to_f, description='Temperature conversion')
Cdef c_to_f(c):
return (c * 9/5) + 32
from langchain.agents import Tool
temp_tool = Tool(name='temp_convert', func=c_to_f, description='Converts Celsius to Fahrenheit')