mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 02:53:30 +00:00
Update spec
This commit is contained in:
parent
9a5803a429
commit
d9d34433fc
9 changed files with 118 additions and 39 deletions
|
@ -3843,8 +3843,8 @@
|
|||
"properties": {
|
||||
"role": {
|
||||
"type": "string",
|
||||
"const": "ipython",
|
||||
"default": "ipython"
|
||||
"const": "tool",
|
||||
"default": "tool"
|
||||
},
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
|
@ -4185,14 +4185,7 @@
|
|||
"$ref": "#/components/schemas/ChatCompletionResponseEventType"
|
||||
},
|
||||
"delta": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolCallDelta"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/ContentDelta"
|
||||
},
|
||||
"logprobs": {
|
||||
"type": "array",
|
||||
|
@ -4232,6 +4225,50 @@
|
|||
],
|
||||
"title": "SSE-stream of these events."
|
||||
},
|
||||
"ContentDelta": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "text",
|
||||
"default": "text"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "image",
|
||||
"default": "image"
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"contentEncoding": "base64"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"data"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/ToolCallDelta"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TokenLogProbs": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -4250,6 +4287,11 @@
|
|||
"ToolCallDelta": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "tool_call",
|
||||
"default": "tool_call"
|
||||
},
|
||||
"content": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -4266,6 +4308,7 @@
|
|||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"content",
|
||||
"parse_status"
|
||||
]
|
||||
|
@ -4275,8 +4318,8 @@
|
|||
"enum": [
|
||||
"started",
|
||||
"in_progress",
|
||||
"failure",
|
||||
"success"
|
||||
"failed",
|
||||
"succeeded"
|
||||
]
|
||||
},
|
||||
"CompletionRequest": {
|
||||
|
@ -4777,18 +4820,16 @@
|
|||
"step_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"text_delta": {
|
||||
"type": "string"
|
||||
},
|
||||
"tool_call_delta": {
|
||||
"$ref": "#/components/schemas/ToolCallDelta"
|
||||
"delta": {
|
||||
"$ref": "#/components/schemas/ContentDelta"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"event_type",
|
||||
"step_type",
|
||||
"step_id"
|
||||
"step_id",
|
||||
"delta"
|
||||
]
|
||||
},
|
||||
"AgentTurnResponseStepStartPayload": {
|
||||
|
@ -8758,6 +8799,10 @@
|
|||
"name": "CompletionResponseStreamChunk",
|
||||
"description": "streamed completion response.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/CompletionResponseStreamChunk\" />"
|
||||
},
|
||||
{
|
||||
"name": "ContentDelta",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ContentDelta\" />"
|
||||
},
|
||||
{
|
||||
"name": "CreateAgentRequest",
|
||||
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/CreateAgentRequest\" />"
|
||||
|
@ -9392,6 +9437,7 @@
|
|||
"CompletionRequest",
|
||||
"CompletionResponse",
|
||||
"CompletionResponseStreamChunk",
|
||||
"ContentDelta",
|
||||
"CreateAgentRequest",
|
||||
"CreateAgentSessionRequest",
|
||||
"CreateAgentTurnRequest",
|
||||
|
|
|
@ -150,6 +150,8 @@ components:
|
|||
AgentTurnResponseStepProgressPayload:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
delta:
|
||||
$ref: '#/components/schemas/ContentDelta'
|
||||
event_type:
|
||||
const: step_progress
|
||||
default: step_progress
|
||||
|
@ -163,14 +165,11 @@ components:
|
|||
- shield_call
|
||||
- memory_retrieval
|
||||
type: string
|
||||
text_delta:
|
||||
type: string
|
||||
tool_call_delta:
|
||||
$ref: '#/components/schemas/ToolCallDelta'
|
||||
required:
|
||||
- event_type
|
||||
- step_type
|
||||
- step_id
|
||||
- delta
|
||||
type: object
|
||||
AgentTurnResponseStepStartPayload:
|
||||
additionalProperties: false
|
||||
|
@ -462,9 +461,7 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
delta:
|
||||
oneOf:
|
||||
- type: string
|
||||
- $ref: '#/components/schemas/ToolCallDelta'
|
||||
$ref: '#/components/schemas/ContentDelta'
|
||||
event_type:
|
||||
$ref: '#/components/schemas/ChatCompletionResponseEventType'
|
||||
logprobs:
|
||||
|
@ -571,6 +568,34 @@ components:
|
|||
- delta
|
||||
title: streamed completion response.
|
||||
type: object
|
||||
ContentDelta:
|
||||
oneOf:
|
||||
- additionalProperties: false
|
||||
properties:
|
||||
text:
|
||||
type: string
|
||||
type:
|
||||
const: text
|
||||
default: text
|
||||
type: string
|
||||
required:
|
||||
- type
|
||||
- text
|
||||
type: object
|
||||
- additionalProperties: false
|
||||
properties:
|
||||
data:
|
||||
contentEncoding: base64
|
||||
type: string
|
||||
type:
|
||||
const: image
|
||||
default: image
|
||||
type: string
|
||||
required:
|
||||
- type
|
||||
- data
|
||||
type: object
|
||||
- $ref: '#/components/schemas/ToolCallDelta'
|
||||
CreateAgentRequest:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
|
@ -2664,7 +2689,12 @@ components:
|
|||
- $ref: '#/components/schemas/ToolCall'
|
||||
parse_status:
|
||||
$ref: '#/components/schemas/ToolCallParseStatus'
|
||||
type:
|
||||
const: tool_call
|
||||
default: tool_call
|
||||
type: string
|
||||
required:
|
||||
- type
|
||||
- content
|
||||
- parse_status
|
||||
type: object
|
||||
|
@ -2672,8 +2702,8 @@ components:
|
|||
enum:
|
||||
- started
|
||||
- in_progress
|
||||
- failure
|
||||
- success
|
||||
- failed
|
||||
- succeeded
|
||||
type: string
|
||||
ToolChoice:
|
||||
enum:
|
||||
|
@ -2888,8 +2918,8 @@ components:
|
|||
content:
|
||||
$ref: '#/components/schemas/InterleavedContent'
|
||||
role:
|
||||
const: ipython
|
||||
default: ipython
|
||||
const: tool
|
||||
default: tool
|
||||
type: string
|
||||
tool_name:
|
||||
oneOf:
|
||||
|
@ -5500,6 +5530,8 @@ tags:
|
|||
<SchemaDefinition schemaRef="#/components/schemas/CompletionResponseStreamChunk"
|
||||
/>'
|
||||
name: CompletionResponseStreamChunk
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/ContentDelta" />
|
||||
name: ContentDelta
|
||||
- description: <SchemaDefinition schemaRef="#/components/schemas/CreateAgentRequest"
|
||||
/>
|
||||
name: CreateAgentRequest
|
||||
|
@ -5939,6 +5971,7 @@ x-tagGroups:
|
|||
- CompletionRequest
|
||||
- CompletionResponse
|
||||
- CompletionResponseStreamChunk
|
||||
- ContentDelta
|
||||
- CreateAgentRequest
|
||||
- CreateAgentSessionRequest
|
||||
- CreateAgentTurnRequest
|
||||
|
|
|
@ -132,7 +132,7 @@ class EventLogger:
|
|||
|
||||
delta = event.payload.delta
|
||||
if delta.type == "tool_call":
|
||||
if delta.parse_status == ToolCallParseStatus.success:
|
||||
if delta.parse_status == ToolCallParseStatus.succeeded:
|
||||
yield (
|
||||
event,
|
||||
LogEvent(
|
||||
|
|
|
@ -415,7 +415,7 @@ class ChatAgent(ShieldRunnerMixin):
|
|||
step_type=StepType.tool_execution.value,
|
||||
step_id=step_id,
|
||||
delta=ToolCallDelta(
|
||||
parse_status=ToolCallParseStatus.success,
|
||||
parse_status=ToolCallParseStatus.succeeded,
|
||||
content=ToolCall(
|
||||
call_id="",
|
||||
tool_name=MEMORY_QUERY_TOOL,
|
||||
|
@ -511,7 +511,7 @@ class ChatAgent(ShieldRunnerMixin):
|
|||
|
||||
delta = event.delta
|
||||
if delta.type == "tool_call":
|
||||
if delta.parse_status == ToolCallParseStatus.success:
|
||||
if delta.parse_status == ToolCallParseStatus.succeeded:
|
||||
tool_calls.append(delta.content)
|
||||
if stream:
|
||||
yield AgentTurnResponseStreamChunk(
|
||||
|
|
|
@ -431,7 +431,7 @@ class MetaReferenceInferenceImpl(
|
|||
event_type=ChatCompletionResponseEventType.progress,
|
||||
delta=ToolCallDelta(
|
||||
content="",
|
||||
parse_status=ToolCallParseStatus.failure,
|
||||
parse_status=ToolCallParseStatus.failed,
|
||||
),
|
||||
stop_reason=stop_reason,
|
||||
)
|
||||
|
@ -443,7 +443,7 @@ class MetaReferenceInferenceImpl(
|
|||
event_type=ChatCompletionResponseEventType.progress,
|
||||
delta=ToolCallDelta(
|
||||
content=tool_call,
|
||||
parse_status=ToolCallParseStatus.success,
|
||||
parse_status=ToolCallParseStatus.succeeded,
|
||||
),
|
||||
stop_reason=stop_reason,
|
||||
)
|
||||
|
|
|
@ -215,7 +215,7 @@ async def convert_chat_completion_response_stream(
|
|||
event_type=event_type,
|
||||
delta=ToolCallDelta(
|
||||
content=tool_call,
|
||||
parse_status=ToolCallParseStatus.success,
|
||||
parse_status=ToolCallParseStatus.succeeded,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
|
@ -501,7 +501,7 @@ async def convert_openai_chat_completion_stream(
|
|||
event_type=next(event_type),
|
||||
delta=ToolCallDelta(
|
||||
content=_convert_openai_tool_calls(choice.delta.tool_calls)[0],
|
||||
parse_status=ToolCallParseStatus.success,
|
||||
parse_status=ToolCallParseStatus.succeeded,
|
||||
),
|
||||
logprobs=_convert_openai_logprobs(choice.logprobs),
|
||||
)
|
||||
|
|
|
@ -475,7 +475,7 @@ class TestInference:
|
|||
|
||||
last = grouped[ChatCompletionResponseEventType.progress][-1]
|
||||
# assert last.event.stop_reason == expected_stop_reason
|
||||
assert last.event.delta.parse_status == ToolCallParseStatus.success
|
||||
assert last.event.delta.parse_status == ToolCallParseStatus.succeeded
|
||||
assert last.event.delta.content.type == "tool_call"
|
||||
|
||||
call = last.event.delta.content
|
||||
|
|
|
@ -245,7 +245,7 @@ async def process_chat_completion_stream_response(
|
|||
event_type=ChatCompletionResponseEventType.progress,
|
||||
delta=ToolCallDelta(
|
||||
content="",
|
||||
parse_status=ToolCallParseStatus.failure,
|
||||
parse_status=ToolCallParseStatus.failed,
|
||||
),
|
||||
stop_reason=stop_reason,
|
||||
)
|
||||
|
@ -257,7 +257,7 @@ async def process_chat_completion_stream_response(
|
|||
event_type=ChatCompletionResponseEventType.progress,
|
||||
delta=ToolCallDelta(
|
||||
content=tool_call,
|
||||
parse_status=ToolCallParseStatus.success,
|
||||
parse_status=ToolCallParseStatus.succeeded,
|
||||
),
|
||||
stop_reason=stop_reason,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue