API Reference
Classes:
Name | Description |
---|---|
SmolagentsAgent |
Adapter class for the Smolagents library for use with FastAPIAgents. |
SmolagentsAgent
Adapter class for the Smolagents library for use with FastAPIAgents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent
|
MultiStepAgent
|
The Smolagents agent. |
required |
Example:
from fastapi_agents.smolagents import SmolagentsAgent
from smolagents import LiteLLMModel
from smolagents import ToolCallingAgent
model = LiteLLMModel("gpt-4o-mini")
agent = ToolCallingAgent(tools=[], model=model)
agents.register("smolagents", SmolagentsAgent(agent))
Raises:
Type | Description |
---|---|
ValueError
|
If the role is not "user" and there are more than one messages. |
Returns:
Name | Type | Description |
---|---|---|
SmolagentsAgent |
A Smolagents agent. |