mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 12:21:52 +00:00
Merge remote-tracking branch 'origin/main' into api_updates_1
This commit is contained in:
commit
85d56ed3f2
4 changed files with 782 additions and 417 deletions
|
@ -21,7 +21,7 @@
|
|||
"info": {
|
||||
"title": "[DRAFT] Llama Stack Specification",
|
||||
"version": "0.0.1",
|
||||
"description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-09-03 21:36:00.770405"
|
||||
"description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-09-03 21:42:33.579455"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
|
@ -266,7 +266,7 @@
|
|||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"text/event-stream": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseStreamChunk"
|
||||
}
|
||||
|
@ -3005,8 +3005,504 @@
|
|||
"mime_type"
|
||||
]
|
||||
},
|
||||
"AgenticSystemTurnResponseEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"payload": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseStepStartPayload"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseStepProgressPayload"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseStepCompletePayload"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseTurnStartPayload"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseTurnCompletePayload"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"payload"
|
||||
],
|
||||
"title": "Streamed agent execution response."
|
||||
},
|
||||
"AgenticSystemTurnResponseStepCompletePayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string",
|
||||
"const": "step_complete"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"inference",
|
||||
"tool_execution",
|
||||
"shield_call",
|
||||
"memory_retrieval"
|
||||
]
|
||||
},
|
||||
"step_details": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/InferenceStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolExecutionStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ShieldCallStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/MemoryRetrievalStep"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event_type",
|
||||
"step_type",
|
||||
"step_details"
|
||||
]
|
||||
},
|
||||
"AgenticSystemTurnResponseStepProgressPayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string",
|
||||
"const": "step_progress"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"inference",
|
||||
"tool_execution",
|
||||
"shield_call",
|
||||
"memory_retrieval"
|
||||
]
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"model_response_text_delta": {
|
||||
"type": "string"
|
||||
},
|
||||
"tool_call_delta": {
|
||||
"$ref": "#/components/schemas/ToolCallDelta"
|
||||
},
|
||||
"tool_response_text_delta": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event_type",
|
||||
"step_type",
|
||||
"step_id"
|
||||
]
|
||||
},
|
||||
"AgenticSystemTurnResponseStepStartPayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string",
|
||||
"const": "step_start"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"inference",
|
||||
"tool_execution",
|
||||
"shield_call",
|
||||
"memory_retrieval"
|
||||
]
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event_type",
|
||||
"step_type",
|
||||
"step_id"
|
||||
]
|
||||
},
|
||||
"AgenticSystemTurnResponseStreamChunk": {
|
||||
"description": "Server side event (SSE) stream of these events"
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event": {
|
||||
"$ref": "#/components/schemas/AgenticSystemTurnResponseEvent"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event"
|
||||
]
|
||||
},
|
||||
"AgenticSystemTurnResponseTurnCompletePayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string",
|
||||
"const": "turn_complete"
|
||||
},
|
||||
"turn": {
|
||||
"$ref": "#/components/schemas/Turn"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event_type",
|
||||
"turn"
|
||||
]
|
||||
},
|
||||
"AgenticSystemTurnResponseTurnStartPayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string",
|
||||
"const": "turn_start"
|
||||
},
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event_type",
|
||||
"turn_id"
|
||||
]
|
||||
},
|
||||
"InferenceStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "inference"
|
||||
},
|
||||
"model_response": {
|
||||
"$ref": "#/components/schemas/CompletionMessage"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"model_response"
|
||||
]
|
||||
},
|
||||
"MemoryRetrievalStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "memory_retrieval"
|
||||
},
|
||||
"memory_bank_ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"inserted_context": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"memory_bank_ids",
|
||||
"inserted_context"
|
||||
]
|
||||
},
|
||||
"ShieldCallStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "shield_call"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "#/components/schemas/ShieldResponse"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"response"
|
||||
]
|
||||
},
|
||||
"ShieldResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"shield_type": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/BuiltinShield"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"is_violation": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"violation_type": {
|
||||
"type": "string"
|
||||
},
|
||||
"violation_return_message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"shield_type",
|
||||
"is_violation"
|
||||
]
|
||||
},
|
||||
"ToolExecutionStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "tool_execution"
|
||||
},
|
||||
"tool_calls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ToolCall"
|
||||
}
|
||||
},
|
||||
"tool_responses": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ToolResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"tool_calls",
|
||||
"tool_responses"
|
||||
]
|
||||
},
|
||||
"ToolResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"tool_name": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/BuiltinTool"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"call_id",
|
||||
"tool_name",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
"Turn": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"session_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"input_messages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/UserMessage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolResponseMessage"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/InferenceStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolExecutionStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ShieldCallStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/MemoryRetrievalStep"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"output_message": {
|
||||
"$ref": "#/components/schemas/CompletionMessage"
|
||||
},
|
||||
"output_attachments": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attachment"
|
||||
}
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"session_id",
|
||||
"input_messages",
|
||||
"steps",
|
||||
"output_message",
|
||||
"output_attachments",
|
||||
"started_at"
|
||||
],
|
||||
"title": "A single turn in an interaction with an Agentic System."
|
||||
},
|
||||
"CreateDatasetRequest": {
|
||||
"type": "object",
|
||||
|
@ -3582,89 +4078,6 @@
|
|||
],
|
||||
"title": "Request to evaluate text generation."
|
||||
},
|
||||
"InferenceStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "inference"
|
||||
},
|
||||
"model_response": {
|
||||
"$ref": "#/components/schemas/CompletionMessage"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"model_response"
|
||||
]
|
||||
},
|
||||
"MemoryRetrievalStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "memory_retrieval"
|
||||
},
|
||||
"memory_bank_ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"inserted_context": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"memory_bank_ids",
|
||||
"inserted_context"
|
||||
]
|
||||
},
|
||||
"Session": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -3697,219 +4110,6 @@
|
|||
],
|
||||
"title": "A single session of an interaction with an Agentic System."
|
||||
},
|
||||
"ShieldCallStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "shield_call"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "#/components/schemas/ShieldResponse"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"response"
|
||||
]
|
||||
},
|
||||
"ShieldResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"shield_type": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/BuiltinShield"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"is_violation": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"violation_type": {
|
||||
"type": "string"
|
||||
},
|
||||
"violation_return_message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"shield_type",
|
||||
"is_violation"
|
||||
]
|
||||
},
|
||||
"ToolExecutionStep": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"step_type": {
|
||||
"type": "string",
|
||||
"const": "tool_execution"
|
||||
},
|
||||
"tool_calls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ToolCall"
|
||||
}
|
||||
},
|
||||
"tool_responses": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ToolResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"step_id",
|
||||
"step_type",
|
||||
"tool_calls",
|
||||
"tool_responses"
|
||||
]
|
||||
},
|
||||
"ToolResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"tool_name": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/BuiltinTool"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"content": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"call_id",
|
||||
"tool_name",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
"Turn": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"turn_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"session_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"input_messages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/UserMessage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolResponseMessage"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/InferenceStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolExecutionStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ShieldCallStep"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/MemoryRetrievalStep"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"output_message": {
|
||||
"$ref": "#/components/schemas/CompletionMessage"
|
||||
},
|
||||
"output_attachments": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attachment"
|
||||
}
|
||||
},
|
||||
"started_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"turn_id",
|
||||
"session_id",
|
||||
"input_messages",
|
||||
"steps",
|
||||
"output_message",
|
||||
"output_attachments",
|
||||
"started_at"
|
||||
],
|
||||
"title": "A single turn in an interaction with an Agentic System."
|
||||
},
|
||||
"AgenticSystemStepResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -5246,35 +5446,35 @@
|
|||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"name": "BatchInference"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystem"
|
||||
},
|
||||
{
|
||||
"name": "PostTraining"
|
||||
},
|
||||
{
|
||||
"name": "Memory"
|
||||
},
|
||||
{
|
||||
"name": "Observability"
|
||||
},
|
||||
{
|
||||
"name": "SyntheticDataGeneration"
|
||||
},
|
||||
{
|
||||
"name": "Evaluations"
|
||||
"name": "Inference"
|
||||
},
|
||||
{
|
||||
"name": "RewardScoring"
|
||||
"name": "Observability"
|
||||
},
|
||||
{
|
||||
"name": "BatchInference"
|
||||
},
|
||||
{
|
||||
"name": "Datasets"
|
||||
},
|
||||
{
|
||||
"name": "Inference"
|
||||
"name": "RewardScoring"
|
||||
},
|
||||
{
|
||||
"name": "PostTraining"
|
||||
},
|
||||
{
|
||||
"name": "Evaluations"
|
||||
},
|
||||
{
|
||||
"name": "BatchChatCompletionRequest",
|
||||
|
@ -5448,9 +5648,61 @@
|
|||
"name": "Attachment",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/Attachment\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseEvent",
|
||||
"description": "Streamed agent execution response.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseEvent\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseStepCompletePayload",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseStepCompletePayload\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseStepProgressPayload",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseStepProgressPayload\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseStepStartPayload",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseStepStartPayload\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseStreamChunk",
|
||||
"description": "Server side event (SSE) stream of these events\n\n<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseStreamChunk\" />"
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseStreamChunk\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseTurnCompletePayload",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseTurnCompletePayload\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemTurnResponseTurnStartPayload",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemTurnResponseTurnStartPayload\" />"
|
||||
},
|
||||
{
|
||||
"name": "InferenceStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/InferenceStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "MemoryRetrievalStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/MemoryRetrievalStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "ShieldCallStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldCallStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "ShieldResponse",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldResponse\" />"
|
||||
},
|
||||
{
|
||||
"name": "ToolExecutionStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ToolExecutionStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "ToolResponse",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ToolResponse\" />"
|
||||
},
|
||||
{
|
||||
"name": "Turn",
|
||||
"description": "A single turn in an interaction with an Agentic System.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/Turn\" />"
|
||||
},
|
||||
{
|
||||
"name": "CreateDatasetRequest",
|
||||
|
@ -5516,38 +5768,10 @@
|
|||
"name": "EvaluateTextGenerationRequest",
|
||||
"description": "Request to evaluate text generation.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/EvaluateTextGenerationRequest\" />"
|
||||
},
|
||||
{
|
||||
"name": "InferenceStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/InferenceStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "MemoryRetrievalStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/MemoryRetrievalStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "Session",
|
||||
"description": "A single session of an interaction with an Agentic System.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/Session\" />"
|
||||
},
|
||||
{
|
||||
"name": "ShieldCallStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldCallStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "ShieldResponse",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldResponse\" />"
|
||||
},
|
||||
{
|
||||
"name": "ToolExecutionStep",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ToolExecutionStep\" />"
|
||||
},
|
||||
{
|
||||
"name": "ToolResponse",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ToolResponse\" />"
|
||||
},
|
||||
{
|
||||
"name": "Turn",
|
||||
"description": "A single turn in an interaction with an Agentic System.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/Turn\" />"
|
||||
},
|
||||
{
|
||||
"name": "AgenticSystemStepResponse",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/AgenticSystemStepResponse\" />"
|
||||
|
@ -5729,7 +5953,13 @@
|
|||
"AgenticSystemSessionCreateResponse",
|
||||
"AgenticSystemStepResponse",
|
||||
"AgenticSystemTurnCreateRequest",
|
||||
"AgenticSystemTurnResponseEvent",
|
||||
"AgenticSystemTurnResponseStepCompletePayload",
|
||||
"AgenticSystemTurnResponseStepProgressPayload",
|
||||
"AgenticSystemTurnResponseStepStartPayload",
|
||||
"AgenticSystemTurnResponseStreamChunk",
|
||||
"AgenticSystemTurnResponseTurnCompletePayload",
|
||||
"AgenticSystemTurnResponseTurnStartPayload",
|
||||
"Artifact",
|
||||
"ArtifactType",
|
||||
"Attachment",
|
||||
|
|
|
@ -114,8 +114,132 @@ components:
|
|||
- session_id
|
||||
- messages
|
||||
type: object
|
||||
AgenticSystemTurnResponseEvent:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
payload:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/AgenticSystemTurnResponseStepStartPayload'
|
||||
- $ref: '#/components/schemas/AgenticSystemTurnResponseStepProgressPayload'
|
||||
- $ref: '#/components/schemas/AgenticSystemTurnResponseStepCompletePayload'
|
||||
- $ref: '#/components/schemas/AgenticSystemTurnResponseTurnStartPayload'
|
||||
- $ref: '#/components/schemas/AgenticSystemTurnResponseTurnCompletePayload'
|
||||
required:
|
||||
- payload
|
||||
title: Streamed agent execution response.
|
||||
type: object
|
||||
AgenticSystemTurnResponseStepCompletePayload:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
event_type:
|
||||
const: step_complete
|
||||
type: string
|
||||
step_details:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/InferenceStep'
|
||||
- $ref: '#/components/schemas/ToolExecutionStep'
|
||||
- $ref: '#/components/schemas/ShieldCallStep'
|
||||
- $ref: '#/components/schemas/MemoryRetrievalStep'
|
||||
step_type:
|
||||
enum:
|
||||
- inference
|
||||
- tool_execution
|
||||
- shield_call
|
||||
- memory_retrieval
|
||||
type: string
|
||||
required:
|
||||
- event_type
|
||||
- step_type
|
||||
- step_details
|
||||
type: object
|
||||
AgenticSystemTurnResponseStepProgressPayload:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
event_type:
|
||||
const: step_progress
|
||||
type: string
|
||||
model_response_text_delta:
|
||||
type: string
|
||||
step_id:
|
||||
type: string
|
||||
step_type:
|
||||
enum:
|
||||
- inference
|
||||
- tool_execution
|
||||
- shield_call
|
||||
- memory_retrieval
|
||||
type: string
|
||||
tool_call_delta:
|
||||
$ref: '#/components/schemas/ToolCallDelta'
|
||||
tool_response_text_delta:
|
||||
type: string
|
||||
required:
|
||||
- event_type
|
||||
- step_type
|
||||
- step_id
|
||||
type: object
|
||||
AgenticSystemTurnResponseStepStartPayload:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
event_type:
|
||||
const: step_start
|
||||
type: string
|
||||
metadata:
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- type: 'null'
|
||||
- type: boolean
|
||||
- type: number
|
||||
- type: string
|
||||
- type: array
|
||||
- type: object
|
||||
type: object
|
||||
step_id:
|
||||
type: string
|
||||
step_type:
|
||||
enum:
|
||||
- inference
|
||||
- tool_execution
|
||||
- shield_call
|
||||
- memory_retrieval
|
||||
type: string
|
||||
required:
|
||||
- event_type
|
||||
- step_type
|
||||
- step_id
|
||||
type: object
|
||||
AgenticSystemTurnResponseStreamChunk:
|
||||
description: Server side event (SSE) stream of these events
|
||||
additionalProperties: false
|
||||
properties:
|
||||
event:
|
||||
$ref: '#/components/schemas/AgenticSystemTurnResponseEvent'
|
||||
required:
|
||||
- event
|
||||
type: object
|
||||
AgenticSystemTurnResponseTurnCompletePayload:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
event_type:
|
||||
const: turn_complete
|
||||
type: string
|
||||
turn:
|
||||
$ref: '#/components/schemas/Turn'
|
||||
required:
|
||||
- event_type
|
||||
- turn
|
||||
type: object
|
||||
AgenticSystemTurnResponseTurnStartPayload:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
event_type:
|
||||
const: turn_start
|
||||
type: string
|
||||
turn_id:
|
||||
type: string
|
||||
required:
|
||||
- event_type
|
||||
- turn_id
|
||||
type: object
|
||||
Artifact:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
|
@ -2175,7 +2299,7 @@ info:
|
|||
description: "This is the specification of the llama stack that provides\n \
|
||||
\ a set of endpoints and their corresponding interfaces that are tailored\
|
||||
\ to\n best leverage Llama Models. The specification is still in\
|
||||
\ draft and subject to change.\n Generated at 2024-09-03 21:36:00.770405"
|
||||
\ draft and subject to change.\n Generated at 2024-09-03 21:42:33.579455"
|
||||
title: '[DRAFT] Llama Stack Specification'
|
||||
version: 0.0.1
|
||||
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
|
||||
|
@ -2323,7 +2447,7 @@ paths:
|
|||
responses:
|
||||
'200':
|
||||
content:
|
||||
application/json:
|
||||
text/event-stream:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AgenticSystemTurnResponseStreamChunk'
|
||||
description: OK
|
||||
|
@ -3182,16 +3306,16 @@ security:
|
|||
servers:
|
||||
- url: http://any-hosted-llama-stack.com
|
||||
tags:
|
||||
- name: BatchInference
|
||||
- name: AgenticSystem
|
||||
- name: PostTraining
|
||||
- name: Memory
|
||||
- name: Observability
|
||||
- name: SyntheticDataGeneration
|
||||
- name: Evaluations
|
||||
- name: RewardScoring
|
||||
- name: Datasets
|
||||
- name: Inference
|
||||
- name: Observability
|
||||
- name: BatchInference
|
||||
- name: Datasets
|
||||
- name: RewardScoring
|
||||
- name: PostTraining
|
||||
- name: Evaluations
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/BatchChatCompletionRequest"
|
||||
/>
|
||||
name: BatchChatCompletionRequest
|
||||
|
@ -3323,12 +3447,49 @@ tags:
|
|||
name: AgenticSystemTurnCreateRequest
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/Attachment" />
|
||||
name: Attachment
|
||||
- description: 'Server side event (SSE) stream of these events
|
||||
- description: 'Streamed agent execution response.
|
||||
|
||||
|
||||
<SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseStreamChunk"
|
||||
<SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseEvent"
|
||||
/>'
|
||||
name: AgenticSystemTurnResponseEvent
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseStepCompletePayload"
|
||||
/>
|
||||
name: AgenticSystemTurnResponseStepCompletePayload
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseStepProgressPayload"
|
||||
/>
|
||||
name: AgenticSystemTurnResponseStepProgressPayload
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseStepStartPayload"
|
||||
/>
|
||||
name: AgenticSystemTurnResponseStepStartPayload
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseStreamChunk"
|
||||
/>
|
||||
name: AgenticSystemTurnResponseStreamChunk
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseTurnCompletePayload"
|
||||
/>
|
||||
name: AgenticSystemTurnResponseTurnCompletePayload
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnResponseTurnStartPayload"
|
||||
/>
|
||||
name: AgenticSystemTurnResponseTurnStartPayload
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/InferenceStep" />
|
||||
name: InferenceStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/MemoryRetrievalStep"
|
||||
/>
|
||||
name: MemoryRetrievalStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldCallStep" />
|
||||
name: ShieldCallStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldResponse" />
|
||||
name: ShieldResponse
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ToolExecutionStep"
|
||||
/>
|
||||
name: ToolExecutionStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ToolResponse" />
|
||||
name: ToolResponse
|
||||
- description: 'A single turn in an interaction with an Agentic System.
|
||||
|
||||
|
||||
<SchemaDefinition schemaRef="#/components/schemas/Turn" />'
|
||||
name: Turn
|
||||
- description: 'Request to create a dataset.
|
||||
|
||||
|
||||
|
@ -3388,30 +3549,11 @@ tags:
|
|||
<SchemaDefinition schemaRef="#/components/schemas/EvaluateTextGenerationRequest"
|
||||
/>'
|
||||
name: EvaluateTextGenerationRequest
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/InferenceStep" />
|
||||
name: InferenceStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/MemoryRetrievalStep"
|
||||
/>
|
||||
name: MemoryRetrievalStep
|
||||
- description: 'A single session of an interaction with an Agentic System.
|
||||
|
||||
|
||||
<SchemaDefinition schemaRef="#/components/schemas/Session" />'
|
||||
name: Session
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldCallStep" />
|
||||
name: ShieldCallStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldResponse" />
|
||||
name: ShieldResponse
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ToolExecutionStep"
|
||||
/>
|
||||
name: ToolExecutionStep
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ToolResponse" />
|
||||
name: ToolResponse
|
||||
- description: 'A single turn in an interaction with an Agentic System.
|
||||
|
||||
|
||||
<SchemaDefinition schemaRef="#/components/schemas/Turn" />'
|
||||
name: Turn
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemStepResponse"
|
||||
/>
|
||||
name: AgenticSystemStepResponse
|
||||
|
@ -3571,7 +3713,13 @@ x-tagGroups:
|
|||
- AgenticSystemSessionCreateResponse
|
||||
- AgenticSystemStepResponse
|
||||
- AgenticSystemTurnCreateRequest
|
||||
- AgenticSystemTurnResponseEvent
|
||||
- AgenticSystemTurnResponseStepCompletePayload
|
||||
- AgenticSystemTurnResponseStepProgressPayload
|
||||
- AgenticSystemTurnResponseStepStartPayload
|
||||
- AgenticSystemTurnResponseStreamChunk
|
||||
- AgenticSystemTurnResponseTurnCompletePayload
|
||||
- AgenticSystemTurnResponseTurnStartPayload
|
||||
- Artifact
|
||||
- ArtifactType
|
||||
- Attachment
|
||||
|
|
|
@ -18,10 +18,10 @@ import yaml
|
|||
|
||||
from llama_models import schema_utils
|
||||
|
||||
# We do a series of monkey-patching to ensure our definitions only use the minimal
|
||||
# We do some monkey-patching to ensure our definitions only use the minimal
|
||||
# (json_schema_type, webmethod) definitions from the llama_models package. For
|
||||
# generation though, we need the full definitions and implementations from the
|
||||
# (python-openapi, json-strong-typing) packages.
|
||||
# (json-strong-typing) package.
|
||||
|
||||
from strong_typing.schema import json_schema_type
|
||||
|
||||
|
@ -31,10 +31,20 @@ from .pyopenapi.utility import Specification
|
|||
|
||||
schema_utils.json_schema_type = json_schema_type
|
||||
|
||||
|
||||
from llama_toolchain.stack import LlamaStack
|
||||
|
||||
|
||||
# TODO: this should be fixed in the generator itself so it reads appropriate annotations
|
||||
STREAMING_ENDPOINTS = ["/agentic_system/turn/create"]
|
||||
|
||||
|
||||
def patch_sse_stream_responses(spec: Specification):
|
||||
for path, path_item in spec.document.paths.items():
|
||||
if path in STREAMING_ENDPOINTS:
|
||||
content = path_item.post.responses["200"].content.pop("application/json")
|
||||
path_item.post.responses["200"].content["text/event-stream"] = content
|
||||
|
||||
|
||||
def main(output_dir: str):
|
||||
output_dir = Path(output_dir)
|
||||
if not output_dir.exists():
|
||||
|
@ -60,6 +70,9 @@ def main(output_dir: str):
|
|||
),
|
||||
),
|
||||
)
|
||||
|
||||
patch_sse_stream_responses(spec)
|
||||
|
||||
with open(output_dir / "llama-stack-spec.yaml", "w", encoding="utf-8") as fp:
|
||||
yaml.dump(spec.get_json(), fp, allow_unicode=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue