phidata icon indicating copy to clipboard operation
phidata copied to clipboard

Assistant max function calling

Open jacobweiss2305 opened this issue 1 year ago • 3 comments

Is there a way to max out the phidata python assistant on how many steps it can take? I am trying to control for infinite loops.

jacobweiss2305 avatar Feb 13 '24 12:02 jacobweiss2305

I found this but not exactly sure how to use it in Python Assistant: venv\Lib\site-packages\phi\assistant\assistant.py

   # -*- Assistant Tools
   # A list of tools provided to the LLM.
   # Tools are functions the model may generate JSON inputs for.
   # If you provide a dict, it is not called by the model.
   tools: Optional[List[Union[Tool, ToolRegistry, Callable, Dict, Function]]] = None
   # Allow the assistant to use tools
   use_tools: bool = False
   # Show tool calls in LLM messages.
   show_tool_calls: bool = False
   # Maximum number of tool calls allowed.
   tool_call_limit: Optional[int] = None

jacobweiss2305 avatar Feb 13 '24 12:02 jacobweiss2305

@jacobweiss2305 setting Assistant(..., tool_call_limit=5), after the tool_call_limit is reached it will deactivate the function calls

ashpreetbedi avatar Feb 13 '24 13:02 ashpreetbedi

We currently set it to 20, but imo that number is bit high, somewhere around 7-10 is a good number

ashpreetbedi avatar Feb 13 '24 13:02 ashpreetbedi