semantix
semantix copied to clipboard
Tool Execution - Ability to provide tools and the enhanced function will able to run the tools iteratively to achieve a task
llm = OpenAI()
def wikipedia_search(query: str) -> str:
# wikipedia calling logic
@llm.agent("Answer the Question", tools=[wikipedia_search])
def answer(question: str) -> Semantic[str, "answer to the question"]: ...
This will run a Thought Action Observation (ReAct) Process until we reach the answer or max_steps are achieved.