Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
SLR722 committed Jan 14, 2025
2 parents 9401587 + a174938 commit de12a03
Show file tree
Hide file tree
Showing 20 changed files with 381 additions and 414 deletions.
82 changes: 64 additions & 18 deletions docs/resources/llama-stack-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -3843,8 +3843,8 @@
"properties": {
"role": {
"type": "string",
"const": "ipython",
"default": "ipython"
"const": "tool",
"default": "tool"
},
"call_id": {
"type": "string"
Expand Down Expand Up @@ -4185,14 +4185,7 @@
"$ref": "#/components/schemas/ChatCompletionResponseEventType"
},
"delta": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ToolCallDelta"
}
]
"$ref": "#/components/schemas/ContentDelta"
},
"logprobs": {
"type": "array",
Expand Down Expand Up @@ -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": {
Expand All @@ -4250,6 +4287,11 @@
"ToolCallDelta": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "tool_call",
"default": "tool_call"
},
"content": {
"oneOf": [
{
Expand All @@ -4266,6 +4308,7 @@
},
"additionalProperties": false,
"required": [
"type",
"content",
"parse_status"
]
Expand All @@ -4275,8 +4318,8 @@
"enum": [
"started",
"in_progress",
"failure",
"success"
"failed",
"succeeded"
]
},
"CompletionRequest": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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\" />"
Expand Down Expand Up @@ -9392,6 +9437,7 @@
"CompletionRequest",
"CompletionResponse",
"CompletionResponseStreamChunk",
"ContentDelta",
"CreateAgentRequest",
"CreateAgentSessionRequest",
"CreateAgentTurnRequest",
Expand Down
55 changes: 44 additions & 11 deletions docs/resources/llama-stack-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ components:
AgentTurnResponseStepProgressPayload:
additionalProperties: false
properties:
delta:
$ref: '#/components/schemas/ContentDelta'
event_type:
const: step_progress
default: step_progress
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -2664,16 +2689,21 @@ 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
ToolCallParseStatus:
enum:
- started
- in_progress
- failure
- success
- failed
- succeeded
type: string
ToolChoice:
enum:
Expand Down Expand Up @@ -2888,8 +2918,8 @@ components:
content:
$ref: '#/components/schemas/InterleavedContent'
role:
const: ipython
default: ipython
const: tool
default: tool
type: string
tool_name:
oneOf:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -5939,6 +5971,7 @@ x-tagGroups:
- CompletionRequest
- CompletionResponse
- CompletionResponseStreamChunk
- ContentDelta
- CreateAgentRequest
- CreateAgentSessionRequest
- CreateAgentTurnRequest
Expand Down
6 changes: 2 additions & 4 deletions llama_stack/apis/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
from pydantic import BaseModel, ConfigDict, Field
from typing_extensions import Annotated

from llama_stack.apis.common.content_types import InterleavedContent, URL
from llama_stack.apis.common.content_types import ContentDelta, InterleavedContent, URL
from llama_stack.apis.inference import (
CompletionMessage,
SamplingParams,
ToolCall,
ToolCallDelta,
ToolChoice,
ToolPromptFormat,
ToolResponse,
Expand Down Expand Up @@ -216,8 +215,7 @@ class AgentTurnResponseStepProgressPayload(BaseModel):
step_type: StepType
step_id: str

text_delta: Optional[str] = None
tool_call_delta: Optional[ToolCallDelta] = None
delta: ContentDelta


@json_schema_type
Expand Down
Loading

0 comments on commit de12a03

Please sign in to comment.