AI Models API Package¶
nautobot_ai_models.api
¶
REST API module for nautobot_ai_models app.
serializers
¶
API serializers for nautobot_ai_models.
The MCP tool serializer carries the whole advertised definition, both schemas included.
AIAgentSerializer
¶
Bases: NautobotModelSerializer, TaggedModelSerializerMixin
AI Agent Serializer.
Source code in nautobot_ai_models/api/serializers.py
Meta
¶
get_tool_count(obj)
¶
How many tools this agent may call.
This method reads the annotation the viewset adds, and falls back to a count, so a queryset without the annotation still serialises.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj |
AIAgent
|
The agent to render. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The viewset's annotation, or a count when the object did not come from that queryset. |
Source code in nautobot_ai_models/api/serializers.py
AIAgentSkillSerializer
¶
Bases: NautobotModelSerializer
AI Agent Skill Serializer.
Source code in nautobot_ai_models/api/serializers.py
AIAgentSubagentSerializer
¶
Bases: NautobotModelSerializer
AI Agent Subagent Serializer.
Source code in nautobot_ai_models/api/serializers.py
AIAgentThreadSerializer
¶
Bases: NautobotModelSerializer
AI Agent Thread Serializer.
thread_id is neither read-only nor writable here. The column is editable=False, so the
server allocates the value and returns it. A consuming app reads it back from the response and
checkpoints under it.
Source code in nautobot_ai_models/api/serializers.py
AIAgentToolSerializer
¶
Bases: NautobotModelSerializer
AI Agent Tool Serializer.
The four resolved fields are what the model is told. They come from the binding and its target, so they are read-only, and they are worth a return: a client that checks what an agent offers must not have to work them out again.
Source code in nautobot_ai_models/api/serializers.py
AIModelSerializer
¶
Bases: NautobotModelSerializer
AI Model Serializer.
Source code in nautobot_ai_models/api/serializers.py
AIProviderSerializer
¶
Bases: NautobotModelSerializer
AI Provider Serializer.
Source code in nautobot_ai_models/api/serializers.py
AISkillSerializer
¶
Bases: NautobotModelSerializer
AI Skill Serializer.
Source code in nautobot_ai_models/api/serializers.py
AIToolSerializer
¶
Bases: NautobotModelSerializer
AI Tool Serializer.
What discovery wrote about the tool is read-only, because the next Sync AI Tools Job run would
overwrite a change to it. The rest stays writable: a Job tool is an operator's decision, not a
discovery, and AITool.clean() refuses a row that names nothing real.
Source code in nautobot_ai_models/api/serializers.py
MCPServerSerializer
¶
Bases: NautobotModelSerializer, TaggedModelSerializerMixin
MCPServer Serializer.
Source code in nautobot_ai_models/api/serializers.py
Meta
¶
get_tool_count(obj)
¶
Return how many tools this server offers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj |
MCPServer
|
The server being rendered. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The viewset's annotation, or a count when the object did not come from that queryset. |
Source code in nautobot_ai_models/api/serializers.py
MCPToolSerializer
¶
Bases: NautobotModelSerializer
MCPTool Serializer.
Source code in nautobot_ai_models/api/serializers.py
urls
¶
Django API urlpatterns declaration for nautobot_ai_models app.
views
¶
API views for nautobot_ai_models.
AIAgentSkillViewSet
¶
Bases: NautobotModelViewSet
AI Agent Skill viewset.
Source code in nautobot_ai_models/api/views.py
AIAgentSubagentViewSet
¶
Bases: NautobotModelViewSet
AI Agent Subagent viewset.
Source code in nautobot_ai_models/api/views.py
AIAgentThreadViewSet
¶
Bases: NautobotModelViewSet
AI Agent Thread viewset.
Source code in nautobot_ai_models/api/views.py
AIAgentToolViewSet
¶
Bases: NautobotModelViewSet
AI Agent Tool viewset.
Source code in nautobot_ai_models/api/views.py
AIAgentViewSet
¶
Bases: NautobotModelViewSet
AI Agent viewset.
Source code in nautobot_ai_models/api/views.py
AIModelViewSet
¶
Bases: NautobotModelViewSet
AI Model viewset.
Source code in nautobot_ai_models/api/views.py
AIProviderViewSet
¶
Bases: NautobotModelViewSet
AI Provider viewset.
Source code in nautobot_ai_models/api/views.py
AISkillViewSet
¶
Bases: NautobotModelViewSet
AI Skill viewset.
Source code in nautobot_ai_models/api/views.py
AIToolViewSet
¶
Bases: NautobotModelViewSet
AI Tool viewset.
Source code in nautobot_ai_models/api/views.py
MCPServerViewSet
¶
Bases: NautobotModelViewSet
MCPServer viewset.
Source code in nautobot_ai_models/api/views.py
MCPToolViewSet
¶
Bases: NautobotModelViewSet
MCPTool viewset.