Agent API Reference
Agent
- class llm_async.agent.Agent(provider: BaseProvider, model: str, tools: list[Callable[[...], Any]], parallel_tools: bool = True, max_iter: int = 10)[source]
Bases:
objectRun provider completions with decorated tools until a final response is produced.
The agent passes its tools to the provider, executes requested tool calls, appends tool results to the message list, and repeats until the model stops requesting tools or
max_iteris reached.Create an agent for a provider, model, and list of decorated tool functions.
Tool Decorator
- llm_async.tool.tool(func: Callable[[...], Any]) Callable[[...], Any][source]
Decorate a function as an LLM tool.
The decorated function remains callable and receives a
toolattribute containing a generatedllm_async.models.Tooldefinition. The generated schema uses the function name, docstring, and supported parameter type annotations.
For examples and supported type annotations, see Agent and Tool Decorator.