Find answers from the community

Updated 2 months ago

❓py-issues-and-help


def multiply(a: int, b: int) -> int:
"""Multiple two integers and returns the result integer"""
return a * b


def add(a: int, b: int) -> int:
"""Add two integers and returns the result integer"""
return a + b


add_tool = FunctionTool.from_defaults(fn=add)

multiply_tool = FunctionTool.from_defaults(fn=multiply)

llm = OpenAI(model="gpt-3.5-turbo-1106")
agent = OpenAIAgent.from_tools(
[multiply_tool, add_tool], llm=llm, verbose=True
)

I want to pass function schema direct instead of Function

i have JS function for execution
L
A
3 comments
If you have the schema, then you can pass it in

FunctionTool.from_defaults(fn=multiply, fn_schema=fn_schema)
Note that it has to be a super specific format if you are defining it yourself
@Logan M But My Problem is I want to pass sceama only that execution of JS function with my custom logic
How can I deal with that?
Add a reply
Sign up and join the conversation on Discord