openapi gen

This commit is contained in:
Xi Yan 2024-11-11 14:01:24 -05:00
parent fdfc37a878
commit 1050617c56
2 changed files with 323 additions and 170 deletions

View file

@ -21,7 +21,7 @@
"info": { "info": {
"title": "[DRAFT] Llama Stack Specification", "title": "[DRAFT] Llama Stack Specification",
"version": "0.0.1", "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-11-07 22:57:18.550543" "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-11-11 13:59:59.544511"
}, },
"servers": [ "servers": [
{ {
@ -839,7 +839,7 @@
"schema": { "schema": {
"oneOf": [ "oneOf": [
{ {
"$ref": "#/components/schemas/ModelDefWithProvider" "$ref": "#/components/schemas/Model"
}, },
{ {
"type": "null" "type": "null"
@ -991,7 +991,7 @@
"schema": { "schema": {
"oneOf": [ "oneOf": [
{ {
"$ref": "#/components/schemas/ShieldDefWithProvider" "$ref": "#/components/schemas/Shield"
}, },
{ {
"type": "null" "type": "null"
@ -1514,7 +1514,7 @@
"content": { "content": {
"application/jsonl": { "application/jsonl": {
"schema": { "schema": {
"$ref": "#/components/schemas/ModelDefWithProvider" "$ref": "#/components/schemas/Model"
} }
} }
} }
@ -1643,7 +1643,7 @@
"content": { "content": {
"application/jsonl": { "application/jsonl": {
"schema": { "schema": {
"$ref": "#/components/schemas/ShieldDefWithProvider" "$ref": "#/components/schemas/Shield"
} }
} }
} }
@ -1881,7 +1881,14 @@
"post": { "post": {
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Model"
}
}
}
} }
}, },
"tags": [ "tags": [
@ -1947,7 +1954,14 @@
"post": { "post": {
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Shield"
}
}
}
} }
}, },
"tags": [ "tags": [
@ -5366,15 +5380,23 @@
"provider_id" "provider_id"
] ]
}, },
"ModelDefWithProvider": { "Model": {
"type": "object", "type": "object",
"properties": { "properties": {
"identifier": { "identifier": {
"type": "string" "type": "string"
}, },
"llama_model": { "provider_resource_id": {
"type": "string" "type": "string"
}, },
"provider_id": {
"type": "string"
},
"type": {
"type": "string",
"const": "model",
"default": "model"
},
"metadata": { "metadata": {
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
@ -5399,23 +5421,15 @@
} }
] ]
} }
},
"type": {
"type": "string",
"const": "model",
"default": "model"
},
"provider_id": {
"type": "string"
} }
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"identifier", "identifier",
"llama_model", "provider_resource_id",
"metadata", "provider_id",
"type", "type",
"provider_id" "metadata"
] ]
}, },
"PaginatedRowsResult": { "PaginatedRowsResult": {
@ -5668,15 +5682,26 @@
"provider_id" "provider_id"
] ]
}, },
"ShieldDefWithProvider": { "Shield": {
"type": "object", "type": "object",
"properties": { "properties": {
"identifier": { "identifier": {
"type": "string" "type": "string"
}, },
"shield_type": { "provider_resource_id": {
"type": "string" "type": "string"
}, },
"provider_id": {
"type": "string"
},
"type": {
"type": "string",
"const": "shield",
"default": "shield"
},
"shield_type": {
"$ref": "#/components/schemas/ShieldType"
},
"params": { "params": {
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
@ -5701,23 +5726,26 @@
} }
] ]
} }
},
"type": {
"type": "string",
"const": "shield",
"default": "shield"
},
"provider_id": {
"type": "string"
} }
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"identifier", "identifier",
"shield_type", "provider_resource_id",
"params", "provider_id",
"type", "type",
"provider_id" "shield_type",
"params"
],
"title": "A safety shield resource that can be used to check content"
},
"ShieldType": {
"type": "string",
"enum": [
"generic_content_shield",
"llama_guard",
"code_scanner",
"prompt_guard"
] ]
}, },
"Trace": { "Trace": {
@ -6666,13 +6694,44 @@
"RegisterModelRequest": { "RegisterModelRequest": {
"type": "object", "type": "object",
"properties": { "properties": {
"model": { "model_id": {
"$ref": "#/components/schemas/ModelDefWithProvider" "type": "string"
},
"provider_model_id": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
}
} }
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"model" "model_id"
] ]
}, },
"RegisterScoringFunctionRequest": { "RegisterScoringFunctionRequest": {
@ -6690,13 +6749,48 @@
"RegisterShieldRequest": { "RegisterShieldRequest": {
"type": "object", "type": "object",
"properties": { "properties": {
"shield": { "shield_id": {
"$ref": "#/components/schemas/ShieldDefWithProvider" "type": "string"
},
"shield_type": {
"$ref": "#/components/schemas/ShieldType"
},
"provider_shield_id": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"params": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
}
} }
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"shield" "shield_id",
"shield_type"
] ]
}, },
"RunEvalRequest": { "RunEvalRequest": {
@ -6737,7 +6831,7 @@
"RunShieldRequest": { "RunShieldRequest": {
"type": "object", "type": "object",
"properties": { "properties": {
"identifier": { "shield_id": {
"type": "string" "type": "string"
}, },
"messages": { "messages": {
@ -6787,7 +6881,7 @@
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"identifier", "shield_id",
"messages", "messages",
"params" "params"
] ]
@ -7250,35 +7344,26 @@
], ],
"tags": [ "tags": [
{ {
"name": "Inspect" "name": "ScoringFunctions"
}, },
{ {
"name": "MemoryBanks" "name": "Datasets"
},
{
"name": "Inspect"
}, },
{ {
"name": "Safety" "name": "Safety"
}, },
{
"name": "Eval"
},
{
"name": "Inference"
},
{ {
"name": "BatchInference" "name": "BatchInference"
}, },
{
"name": "Telemetry"
},
{
"name": "DatasetIO"
},
{
"name": "Models"
},
{
"name": "Shields"
},
{
"name": "Scoring"
},
{
"name": "Datasets"
},
{ {
"name": "Agents" "name": "Agents"
}, },
@ -7286,22 +7371,31 @@
"name": "PostTraining" "name": "PostTraining"
}, },
{ {
"name": "Eval" "name": "Shields"
},
{
"name": "ScoringFunctions"
},
{
"name": "EvalTasks"
}, },
{ {
"name": "Memory" "name": "Memory"
}, },
{
"name": "Scoring"
},
{ {
"name": "SyntheticDataGeneration" "name": "SyntheticDataGeneration"
}, },
{ {
"name": "Inference" "name": "EvalTasks"
},
{
"name": "MemoryBanks"
},
{
"name": "DatasetIO"
},
{
"name": "Models"
},
{
"name": "Telemetry"
}, },
{ {
"name": "BuiltinTool", "name": "BuiltinTool",
@ -7636,8 +7730,8 @@
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/EvalTaskDefWithProvider\" />" "description": "<SchemaDefinition schemaRef=\"#/components/schemas/EvalTaskDefWithProvider\" />"
}, },
{ {
"name": "ModelDefWithProvider", "name": "Model",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ModelDefWithProvider\" />" "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Model\" />"
}, },
{ {
"name": "PaginatedRowsResult", "name": "PaginatedRowsResult",
@ -7648,8 +7742,12 @@
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ScoringFnDefWithProvider\" />" "description": "<SchemaDefinition schemaRef=\"#/components/schemas/ScoringFnDefWithProvider\" />"
}, },
{ {
"name": "ShieldDefWithProvider", "name": "Shield",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldDefWithProvider\" />" "description": "A safety shield resource that can be used to check content\n\n<SchemaDefinition schemaRef=\"#/components/schemas/Shield\" />"
},
{
"name": "ShieldType",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ShieldType\" />"
}, },
{ {
"name": "Trace", "name": "Trace",
@ -7945,8 +8043,8 @@
"MemoryRetrievalStep", "MemoryRetrievalStep",
"MemoryToolDefinition", "MemoryToolDefinition",
"MetricEvent", "MetricEvent",
"Model",
"ModelCandidate", "ModelCandidate",
"ModelDefWithProvider",
"OptimizerConfig", "OptimizerConfig",
"PaginatedRowsResult", "PaginatedRowsResult",
"PhotogenToolDefinition", "PhotogenToolDefinition",
@ -7985,8 +8083,9 @@
"ScoringResult", "ScoringResult",
"SearchToolDefinition", "SearchToolDefinition",
"Session", "Session",
"Shield",
"ShieldCallStep", "ShieldCallStep",
"ShieldDefWithProvider", "ShieldType",
"SpanEndPayload", "SpanEndPayload",
"SpanStartPayload", "SpanStartPayload",
"SpanStatus", "SpanStatus",

View file

@ -1493,6 +1493,36 @@ components:
- value - value
- unit - unit
type: object type: object
Model:
additionalProperties: false
properties:
identifier:
type: string
metadata:
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
type: object
provider_id:
type: string
provider_resource_id:
type: string
type:
const: model
default: model
type: string
required:
- identifier
- provider_resource_id
- provider_id
- type
- metadata
type: object
ModelCandidate: ModelCandidate:
additionalProperties: false additionalProperties: false
properties: properties:
@ -1511,36 +1541,6 @@ components:
- model - model
- sampling_params - sampling_params
type: object type: object
ModelDefWithProvider:
additionalProperties: false
properties:
identifier:
type: string
llama_model:
type: string
metadata:
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
type: object
provider_id:
type: string
type:
const: model
default: model
type: string
required:
- identifier
- llama_model
- metadata
- type
- provider_id
type: object
OptimizerConfig: OptimizerConfig:
additionalProperties: false additionalProperties: false
properties: properties:
@ -1879,10 +1879,24 @@ components:
RegisterModelRequest: RegisterModelRequest:
additionalProperties: false additionalProperties: false
properties: properties:
model: metadata:
$ref: '#/components/schemas/ModelDefWithProvider' additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
type: object
model_id:
type: string
provider_id:
type: string
provider_model_id:
type: string
required: required:
- model - model_id
type: object type: object
RegisterScoringFunctionRequest: RegisterScoringFunctionRequest:
additionalProperties: false additionalProperties: false
@ -1895,10 +1909,27 @@ components:
RegisterShieldRequest: RegisterShieldRequest:
additionalProperties: false additionalProperties: false
properties: properties:
shield: params:
$ref: '#/components/schemas/ShieldDefWithProvider' additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
type: object
provider_id:
type: string
provider_shield_id:
type: string
shield_id:
type: string
shield_type:
$ref: '#/components/schemas/ShieldType'
required: required:
- shield - shield_id
- shield_type
type: object type: object
RestAPIExecutionConfig: RestAPIExecutionConfig:
additionalProperties: false additionalProperties: false
@ -1980,8 +2011,6 @@ components:
RunShieldRequest: RunShieldRequest:
additionalProperties: false additionalProperties: false
properties: properties:
identifier:
type: string
messages: messages:
items: items:
oneOf: oneOf:
@ -2000,8 +2029,10 @@ components:
- type: array - type: array
- type: object - type: object
type: object type: object
shield_id:
type: string
required: required:
- identifier - shield_id
- messages - messages
- params - params
type: object type: object
@ -2343,6 +2374,40 @@ components:
- started_at - started_at
title: A single session of an interaction with an Agentic System. title: A single session of an interaction with an Agentic System.
type: object type: object
Shield:
additionalProperties: false
properties:
identifier:
type: string
params:
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
type: object
provider_id:
type: string
provider_resource_id:
type: string
shield_type:
$ref: '#/components/schemas/ShieldType'
type:
const: shield
default: shield
type: string
required:
- identifier
- provider_resource_id
- provider_id
- type
- shield_type
- params
title: A safety shield resource that can be used to check content
type: object
ShieldCallStep: ShieldCallStep:
additionalProperties: false additionalProperties: false
properties: properties:
@ -2367,36 +2432,13 @@ components:
- step_id - step_id
- step_type - step_type
type: object type: object
ShieldDefWithProvider: ShieldType:
additionalProperties: false enum:
properties: - generic_content_shield
identifier: - llama_guard
type: string - code_scanner
params: - prompt_guard
additionalProperties: type: string
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
type: object
provider_id:
type: string
shield_type:
type: string
type:
const: shield
default: shield
type: string
required:
- identifier
- shield_type
- params
- type
- provider_id
type: object
SpanEndPayload: SpanEndPayload:
additionalProperties: false additionalProperties: false
properties: properties:
@ -3026,7 +3068,7 @@ info:
description: "This is the specification of the llama stack that provides\n \ description: "This is the specification of the llama stack that provides\n \
\ a set of endpoints and their corresponding interfaces that are tailored\ \ a set of endpoints and their corresponding interfaces that are tailored\
\ to\n best leverage Llama Models. The specification is still in\ \ to\n best leverage Llama Models. The specification is still in\
\ draft and subject to change.\n Generated at 2024-11-07 22:57:18.550543" \ draft and subject to change.\n Generated at 2024-11-11 13:59:59.544511"
title: '[DRAFT] Llama Stack Specification' title: '[DRAFT] Llama Stack Specification'
version: 0.0.1 version: 0.0.1
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
@ -3851,7 +3893,7 @@ paths:
application/json: application/json:
schema: schema:
oneOf: oneOf:
- $ref: '#/components/schemas/ModelDefWithProvider' - $ref: '#/components/schemas/Model'
- type: 'null' - type: 'null'
description: OK description: OK
tags: tags:
@ -3871,7 +3913,7 @@ paths:
content: content:
application/jsonl: application/jsonl:
schema: schema:
$ref: '#/components/schemas/ModelDefWithProvider' $ref: '#/components/schemas/Model'
description: OK description: OK
tags: tags:
- Models - Models
@ -3893,6 +3935,10 @@ paths:
required: true required: true
responses: responses:
'200': '200':
content:
application/json:
schema:
$ref: '#/components/schemas/Model'
description: OK description: OK
tags: tags:
- Models - Models
@ -4264,7 +4310,7 @@ paths:
application/json: application/json:
schema: schema:
oneOf: oneOf:
- $ref: '#/components/schemas/ShieldDefWithProvider' - $ref: '#/components/schemas/Shield'
- type: 'null' - type: 'null'
description: OK description: OK
tags: tags:
@ -4284,7 +4330,7 @@ paths:
content: content:
application/jsonl: application/jsonl:
schema: schema:
$ref: '#/components/schemas/ShieldDefWithProvider' $ref: '#/components/schemas/Shield'
description: OK description: OK
tags: tags:
- Shields - Shields
@ -4306,6 +4352,10 @@ paths:
required: true required: true
responses: responses:
'200': '200':
content:
application/json:
schema:
$ref: '#/components/schemas/Shield'
description: OK description: OK
tags: tags:
- Shields - Shields
@ -4384,24 +4434,24 @@ security:
servers: servers:
- url: http://any-hosted-llama-stack.com - url: http://any-hosted-llama-stack.com
tags: tags:
- name: Inspect - name: ScoringFunctions
- name: MemoryBanks
- name: Safety
- name: BatchInference
- name: Telemetry
- name: DatasetIO
- name: Models
- name: Shields
- name: Scoring
- name: Datasets - name: Datasets
- name: Inspect
- name: Safety
- name: Eval
- name: Inference
- name: BatchInference
- name: Agents - name: Agents
- name: PostTraining - name: PostTraining
- name: Eval - name: Shields
- name: ScoringFunctions
- name: EvalTasks
- name: Memory - name: Memory
- name: Scoring
- name: SyntheticDataGeneration - name: SyntheticDataGeneration
- name: Inference - name: EvalTasks
- name: MemoryBanks
- name: DatasetIO
- name: Models
- name: Telemetry
- description: <SchemaDefinition schemaRef="#/components/schemas/BuiltinTool" /> - description: <SchemaDefinition schemaRef="#/components/schemas/BuiltinTool" />
name: BuiltinTool name: BuiltinTool
- description: <SchemaDefinition schemaRef="#/components/schemas/CompletionMessage" - description: <SchemaDefinition schemaRef="#/components/schemas/CompletionMessage"
@ -4659,18 +4709,21 @@ tags:
- description: <SchemaDefinition schemaRef="#/components/schemas/EvalTaskDefWithProvider" - description: <SchemaDefinition schemaRef="#/components/schemas/EvalTaskDefWithProvider"
/> />
name: EvalTaskDefWithProvider name: EvalTaskDefWithProvider
- description: <SchemaDefinition schemaRef="#/components/schemas/ModelDefWithProvider" - description: <SchemaDefinition schemaRef="#/components/schemas/Model" />
/> name: Model
name: ModelDefWithProvider
- description: <SchemaDefinition schemaRef="#/components/schemas/PaginatedRowsResult" - description: <SchemaDefinition schemaRef="#/components/schemas/PaginatedRowsResult"
/> />
name: PaginatedRowsResult name: PaginatedRowsResult
- description: <SchemaDefinition schemaRef="#/components/schemas/ScoringFnDefWithProvider" - description: <SchemaDefinition schemaRef="#/components/schemas/ScoringFnDefWithProvider"
/> />
name: ScoringFnDefWithProvider name: ScoringFnDefWithProvider
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldDefWithProvider" - description: 'A safety shield resource that can be used to check content
/>
name: ShieldDefWithProvider
<SchemaDefinition schemaRef="#/components/schemas/Shield" />'
name: Shield
- description: <SchemaDefinition schemaRef="#/components/schemas/ShieldType" />
name: ShieldType
- description: <SchemaDefinition schemaRef="#/components/schemas/Trace" /> - description: <SchemaDefinition schemaRef="#/components/schemas/Trace" />
name: Trace name: Trace
- description: 'Checkpoint created during training runs - description: 'Checkpoint created during training runs
@ -4909,8 +4962,8 @@ x-tagGroups:
- MemoryRetrievalStep - MemoryRetrievalStep
- MemoryToolDefinition - MemoryToolDefinition
- MetricEvent - MetricEvent
- Model
- ModelCandidate - ModelCandidate
- ModelDefWithProvider
- OptimizerConfig - OptimizerConfig
- PaginatedRowsResult - PaginatedRowsResult
- PhotogenToolDefinition - PhotogenToolDefinition
@ -4949,8 +5002,9 @@ x-tagGroups:
- ScoringResult - ScoringResult
- SearchToolDefinition - SearchToolDefinition
- Session - Session
- Shield
- ShieldCallStep - ShieldCallStep
- ShieldDefWithProvider - ShieldType
- SpanEndPayload - SpanEndPayload
- SpanStartPayload - SpanStartPayload
- SpanStatus - SpanStatus