Find answers from the community

Updated 3 months ago

Hello everyone. I confused with OpenAi

Hello everyone. I confused with OpenAi agent, agent has to run chain of tools like (1)"read_table_properties" -> (2)"form record from user's message that is compatible with table properties" -> (*3)"write record". Major problem that agent do not correctly transforms data from user's message to table structure. Maybe that problem can be solved by creation OpenAi instance with prompt insade tool, but I am not sure are good solution. How do you think ?
L
N
5 comments
If you want it to run all 3 tools, then make a custom tool that does all 3 in one?
Is it normal in tool call another llm ? I was trying to avoid it
I think that's fine, you can do whatever you want in a tool πŸ‘

I'm imagining something like

Plain Text
def ReadWrite(...):
   table_properties = <get table properties>
   record_str = llm.complete("Using the query and table properties, do X")
   record = parse_record_str(record_str)
   write_record(record)
You can turn any function into a tool using FunctionTool

Plain Text
from llama_index.tools import FunctionTool

tool = FunctionTool.from_defaults(fn=ReadWrite)


Here the function schema is used to define a tool, with the function name and docstring being used as a tool name and tool description
Add a reply
Sign up and join the conversation on Discord