From cbe2d467aea799fb1f5e594b2aedbe74ec3ee4c3 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Fri, 17 Jan 2025 18:34:32 -0800 Subject: [PATCH 1/7] v0.1.0 SDK update --- Sources/LlamaStackClient/Agents/Agents.swift | 4 +- .../LlamaStackClient/Agents/ChatAgent.swift | 161 +- .../LlamaStackClient/Agents/CustomTools.swift | 10 +- .../LlamaStackClient/Agents/LocalAgents.swift | 30 +- .../Agents/RemoteAgents.swift | 36 +- .../Agents/TypeExtensions.swift | 90 +- .../Inference/RemoteInference.swift | 4 +- Sources/LlamaStackClient/openapi.yaml | 3977 ++++++++++------- 8 files changed, 2419 insertions(+), 1893 deletions(-) diff --git a/Sources/LlamaStackClient/Agents/Agents.swift b/Sources/LlamaStackClient/Agents/Agents.swift index 2261905..6f7725c 100644 --- a/Sources/LlamaStackClient/Agents/Agents.swift +++ b/Sources/LlamaStackClient/Agents/Agents.swift @@ -5,7 +5,7 @@ import OpenAPIURLSession public protocol Agents { func create(request: Components.Schemas.CreateAgentRequest) async throws -> Components.Schemas.AgentCreateResponse - func createSession(request: Components.Schemas.CreateAgentSessionRequest) async throws -> Components.Schemas.AgentSessionCreateResponse + func createSession(agent_id: String, request: Components.Schemas.CreateAgentSessionRequest) async throws -> Components.Schemas.AgentSessionCreateResponse - func createTurn(request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream + func createTurn(agent_id: String, session_id: String, request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream } diff --git a/Sources/LlamaStackClient/Agents/ChatAgent.swift b/Sources/LlamaStackClient/Agents/ChatAgent.swift index d99b38b..3430f21 100644 --- a/Sources/LlamaStackClient/Agents/ChatAgent.swift +++ b/Sources/LlamaStackClient/Agents/ChatAgent.swift @@ -31,10 +31,10 @@ class ChatAgent { return session } - public func createAndExecuteTurn(request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream { + public func createAndExecuteTurn(agent_id: String, session_id: String, request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream { return AsyncStream { continuation in Task { - let session = sessions[request.session_id] + let session = sessions[session_id] let turnId = UUID().uuidString let startTime = Date() @@ -48,67 +48,69 @@ class ChatAgent { ) // TODO: Build out step history - let steps: [Components.Schemas.Turn.stepsPayloadPayload] = [] - var outputMessage: Components.Schemas.CompletionMessage? = nil - - for await chunk in self.run( - session: session!, - turnId: turnId, - inputMessages: request.messages.map { $0.toChatCompletionRequest() }, - attachments: request.attachments ?? [], - samplingParams: agentConfig.sampling_params - ) { - let payload = chunk.event.payload - switch (payload) { - case .AgentTurnResponseStepStartPayload(_): - break - case .AgentTurnResponseStepProgressPayload(_): - break - case .AgentTurnResponseStepCompletePayload(let step): - switch (step.step_details) { - case .InferenceStep(let step): - outputMessage = step.model_response - case .ToolExecutionStep(_): - break - case .ShieldCallStep(_): - break - case .MemoryRetrievalStep(_): - break - } - case .AgentTurnResponseTurnStartPayload(_): - break - case .AgentTurnResponseTurnCompletePayload(_): - break - } - - continuation.yield(chunk) - } - - let turn = Components.Schemas.Turn( - input_messages: request.messages.map { $0.toAgenticSystemTurnCreateRequest() }, - output_attachments: [], - output_message: outputMessage!, - session_id: request.session_id, - started_at: Date(), - steps: steps, - turn_id: turnId - ) - - await MainActor.run { - var s = self.sessions[request.session_id] - s!.turns.append(turn) - } - - continuation.yield( - Components.Schemas.AgentTurnResponseStreamChunk( - event: Components.Schemas.AgentTurnResponseEvent( - payload: - .AgentTurnResponseTurnCompletePayload(Components.Schemas.AgentTurnResponseTurnCompletePayload( - event_type: .turn_complete, - turn: turn)) - ) - ) - ) +// let steps: [Components.Schemas.Turn.stepsPayloadPayload] = [] +// var outputMessage: Components.Schemas.CompletionMessage? = nil +// +// for await chunk in self.run( +// session: session!, +// turnId: turnId, +// inputMessages: request.messages.map { $0.toAgenticSystemTurnCreateRequest() }, +// attachments: [], +// samplingParams: agentConfig.sampling_params +// ) { +// let payload = chunk.event.payload +// switch (payload) { +// case .AgentTurnResponseStepStartPayload(_): +// break +// case .AgentTurnResponseStepProgressPayload(_): +// break +// case .AgentTurnResponseStepCompletePayload(let step): +// switch (step.step_details) { +// case .InferenceStep(let step): +// outputMessage = step.model_response +// case .ToolExecutionStep(_): +// break +// case .ShieldCallStep(_): +// break +// case .MemoryRetrievalStep(_): +// break +// } +// case .AgentTurnResponseTurnStartPayload(_): +// break +// case .AgentTurnResponseTurnCompletePayload(_): +// break +// } +// +// continuation.yield(chunk) +// } +// +// continuation.finish() + +// let turn = Components.Schemas.Turn( +// input_messages: request.messages.map { $0.toAgenticSystemTurnCreateRequest() }, +// output_attachments: [], +// output_message: outputMessage!, +// session_id: request.session_id, +// started_at: Date(), +// steps: steps, +// turn_id: turnId +// ) +// +// await MainActor.run { +// var s = self.sessions[request.session_id] +// s!.turns.append(turn) +// } +// +// continuation.yield( +// Components.Schemas.AgentTurnResponseStreamChunk( +// event: Components.Schemas.AgentTurnResponseEvent( +// payload: +// .AgentTurnResponseTurnCompletePayload(Components.Schemas.AgentTurnResponseTurnCompletePayload( +// event_type: .turn_complete, +// turn: turn)) +// ) +// ) +// ) } } } @@ -116,8 +118,8 @@ class ChatAgent { public func run( session: Components.Schemas.Session, turnId: String, - inputMessages: [Components.Schemas.ChatCompletionRequest.messagesPayloadPayload], - attachments: [Components.Schemas.Attachment], + inputMessages: [Components.Schemas.Message], + attachments: [Components.Schemas.Turn.output_attachmentsPayload], samplingParams: Components.Schemas.SamplingParams?, stream: Bool = false ) -> AsyncStream { @@ -129,19 +131,35 @@ class ChatAgent { messages: inputMessages, model_id: agentConfig.model, stream: true, - tools: agentConfig.toolDefinitions + tools: [] //agentConfig.client_tools ) ) { switch(chunk.event.delta) { - case .case1(let s): + case .TextDelta(let s): + continuation.yield( + Components.Schemas.AgentTurnResponseStreamChunk( + event: Components.Schemas.AgentTurnResponseEvent( + payload: + .AgentTurnResponseStepProgressPayload( + Components.Schemas.AgentTurnResponseStepProgressPayload( + delta: .TextDelta(s), + event_type: .step_progress, + step_id: UUID().uuidString, + step_type: .inference + ) + ) + ) + ) + ) + case .ImageDelta(let s): continuation.yield( Components.Schemas.AgentTurnResponseStreamChunk( event: Components.Schemas.AgentTurnResponseEvent( payload: .AgentTurnResponseStepProgressPayload( Components.Schemas.AgentTurnResponseStepProgressPayload( + delta: .ImageDelta(s), event_type: .step_progress, - model_response_text_delta: s, step_id: UUID().uuidString, step_type: .inference ) @@ -149,17 +167,17 @@ class ChatAgent { ) ) ) - case .ToolCallDelta(let toolDelta): + case .ToolCallDelta(let s): continuation.yield( Components.Schemas.AgentTurnResponseStreamChunk( event: Components.Schemas.AgentTurnResponseEvent( payload: .AgentTurnResponseStepProgressPayload( Components.Schemas.AgentTurnResponseStepProgressPayload( + delta: .ToolCallDelta(s), event_type: .step_progress, step_id: UUID().uuidString, - step_type: .inference, - tool_call_delta: toolDelta + step_type: .inference ) ) ) @@ -167,6 +185,7 @@ class ChatAgent { ) } } + continuation.finish() } catch { print("Error occurred: \(error)") } diff --git a/Sources/LlamaStackClient/Agents/CustomTools.swift b/Sources/LlamaStackClient/Agents/CustomTools.swift index c9657c4..54d8b69 100644 --- a/Sources/LlamaStackClient/Agents/CustomTools.swift +++ b/Sources/LlamaStackClient/Agents/CustomTools.swift @@ -3,11 +3,10 @@ import OpenAPIRuntime public class CustomTools { - public class func getCreateEventTool() -> Components.Schemas.FunctionCallToolDefinition { - return Components.Schemas.FunctionCallToolDefinition( + public class func getCreateEventTool() -> Components.Schemas.ToolDefinition { + return Components.Schemas.ToolDefinition( description: "Create a calendar event", - function_name: "create_event", - parameters: Components.Schemas.FunctionCallToolDefinition.parametersPayload( + parameters: Components.Schemas.ToolDefinition.parametersPayload( additionalProperties: [ "event_name": Components.Schemas.ToolParamDefinition( description: "The name of the meeting", @@ -26,7 +25,8 @@ public class CustomTools { ), ] ), - _type: .function_call + tool_name: Components.Schemas.ToolDefinition.tool_namePayload.case2( "create_event") + ) } } diff --git a/Sources/LlamaStackClient/Agents/LocalAgents.swift b/Sources/LlamaStackClient/Agents/LocalAgents.swift index b569ac7..c35ea7f 100644 --- a/Sources/LlamaStackClient/Agents/LocalAgents.swift +++ b/Sources/LlamaStackClient/Agents/LocalAgents.swift @@ -22,30 +22,28 @@ public class LocalAgents: Agents { instructions: "You are a helpful assistant", max_infer_iters: 1, model: "Meta-Llama3.1-8B-Instruct", - output_shields: [], - tools: [ - Components.Schemas.AgentConfig.toolsPayloadPayload.FunctionCallToolDefinition( - CustomTools.getCreateEventTool() - ) - ] + output_shields: [] +// tools: [ +// Components.Schemas.AgentConfig.toolsPayloadPayload.FunctionCallToolDefinition( +// CustomTools.getCreateEventTool() +// ) +// ] ) ) ) let agentId = createSystemResponse.agent_id - let createSessionResponse = try await createSession( - request: Components.Schemas.CreateAgentSessionRequest(agent_id: agentId, session_name: "pocket-llama") + let createSessionResponse = try await createSession(agent_id: agentId, + request: Components.Schemas.CreateAgentSessionRequest(session_name: "pocket-llama") ) let agenticSystemSessionId = createSessionResponse.session_id let request = Components.Schemas.CreateAgentTurnRequest( - agent_id: agentId, messages: messages, - session_id: agenticSystemSessionId, stream: true ) - return try await createTurn(request: request) + return try await createTurn(agent_id: agentId, session_id: agenticSystemSessionId, request: request) } public func create(request: Components.Schemas.CreateAgentRequest) async throws -> Components.Schemas.AgentCreateResponse { @@ -60,16 +58,16 @@ public class LocalAgents: Agents { return Components.Schemas.AgentCreateResponse(agent_id: agentId) } - public func createSession(request: Components.Schemas.CreateAgentSessionRequest) async throws -> Components.Schemas.AgentSessionCreateResponse { - let agent = agents[request.agent_id] + public func createSession(agent_id: String, request: Components.Schemas.CreateAgentSessionRequest) async throws -> Components.Schemas.AgentSessionCreateResponse { + let agent = agents[agent_id] let session = agent!.createSession(name: request.session_name) return Components.Schemas.AgentSessionCreateResponse( session_id: session.session_id ) } - public func createTurn(request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream { - let agent = agents[request.agent_id]! - return try await agent.createAndExecuteTurn(request: request) + public func createTurn(agent_id: String, session_id: String, request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream { + let agent = agents[agent_id]! + return try await agent.createAndExecuteTurn(agent_id: agent_id, session_id: session_id, request: request) } } diff --git a/Sources/LlamaStackClient/Agents/RemoteAgents.swift b/Sources/LlamaStackClient/Agents/RemoteAgents.swift index 76bdb08..c05aee2 100644 --- a/Sources/LlamaStackClient/Agents/RemoteAgents.swift +++ b/Sources/LlamaStackClient/Agents/RemoteAgents.swift @@ -25,49 +25,51 @@ public class RemoteAgents: Agents { instructions: "You are a helpful assistant", max_infer_iters: 1, model: "Meta-Llama3.1-8B-Instruct", - output_shields: ["llama_guard"], - tools: [ - Components.Schemas.AgentConfig.toolsPayloadPayload.FunctionCallToolDefinition( - CustomTools.getCreateEventTool() - ) - ] + output_shields: ["llama_guard"] +// tools: [ +// Components.Schemas.AgentConfig.toolsPayloadPayload.FunctionCallToolDefinition( +// CustomTools.getCreateEventTool() +// ) +// ] ) ) ) let agentId = createSystemResponse.agent_id let createSessionResponse = try await createSession( - request: Components.Schemas.CreateAgentSessionRequest(agent_id: agentId, session_name: "pocket-llama") + agent_id: agentId, request: Components.Schemas.CreateAgentSessionRequest(session_name: "pocket-llama") ) let agenticSystemSessionId = createSessionResponse.session_id let request = Components.Schemas.CreateAgentTurnRequest( - agent_id: agentId, messages: messages, - session_id: agenticSystemSessionId, stream: true ) - return try await createTurn(request: request) + return try await createTurn(agent_id: agentId, session_id: agenticSystemSessionId, request: request) } public func create(request: Components.Schemas.CreateAgentRequest) async throws -> Components.Schemas.AgentCreateResponse { - let response = try await client.post_sol_alpha_sol_agents_sol_create(body: Operations.post_sol_alpha_sol_agents_sol_create.Input.Body.json(request)) + let response = try await client.post_sol_v1_sol_agents(body: Operations.post_sol_v1_sol_agents.Input.Body.json(request)) return try response.ok.body.json } - public func createSession(request: Components.Schemas.CreateAgentSessionRequest) async throws -> Components.Schemas.AgentSessionCreateResponse { - let response = try await client.post_sol_alpha_sol_agents_sol_session_sol_create(body: Operations.post_sol_alpha_sol_agents_sol_session_sol_create.Input.Body.json(request)) + public func createSession(agent_id: String, request: Components.Schemas.CreateAgentSessionRequest) async throws -> Components.Schemas.AgentSessionCreateResponse { + let response = try await client.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session( + path: Operations.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session.Input.Path(agent_id: agent_id), + headers: Operations.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session.Input.Headers.init(), + body: Operations.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session.Input.Body.json(request)) return try response.ok.body.json } - public func createTurn(request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream { + public func createTurn(agent_id: String, session_id: String, request: Components.Schemas.CreateAgentTurnRequest) async throws -> AsyncStream { return AsyncStream { continuation in Task { do { - let response = try await self.client.post_sol_alpha_sol_agents_sol_turn_sol_create( - body: Operations.post_sol_alpha_sol_agents_sol_turn_sol_create.Input.Body.json(request) - ) + let response = try await self.client.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session_sol__lcub_session_id_rcub__sol_turn( + path: Operations.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session_sol__lcub_session_id_rcub__sol_turn.Input.Path(agent_id: agent_id, session_id: session_id), + headers: Operations.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session_sol__lcub_session_id_rcub__sol_turn.Input.Headers.init(), + body: Operations.post_sol_v1_sol_agents_sol__lcub_agent_id_rcub__sol_session_sol__lcub_session_id_rcub__sol_turn.Input.Body.json(request)) let stream = try response.ok.body.text_event_hyphen_stream.asDecodedServerSentEventsWithJSONData( of: Components.Schemas.AgentTurnResponseStreamChunk.self ) diff --git a/Sources/LlamaStackClient/Agents/TypeExtensions.swift b/Sources/LlamaStackClient/Agents/TypeExtensions.swift index a036f3c..54bae70 100644 --- a/Sources/LlamaStackClient/Agents/TypeExtensions.swift +++ b/Sources/LlamaStackClient/Agents/TypeExtensions.swift @@ -2,21 +2,21 @@ import Foundation import OpenAPIRuntime import OpenAPIURLSession -public extension Components.Schemas.ChatCompletionRequest.messagesPayloadPayload { +public extension Components.Schemas.CreateAgentTurnRequest.messagesPayloadPayload { func toAgenticSystemTurnCreateRequest() -> Components.Schemas.CreateAgentTurnRequest.messagesPayloadPayload? { switch self { case .UserMessage(let userMessage): return .UserMessage(userMessage) case .ToolResponseMessage(let toolResponseMessage): return .ToolResponseMessage(toolResponseMessage) - case .SystemMessage, .CompletionMessage: - return nil +// case .SystemMessage, .CompletionMessage: +// return nil } } } public extension Components.Schemas.CreateAgentTurnRequest.messagesPayloadPayload { - func toChatCompletionRequest() -> Components.Schemas.ChatCompletionRequest.messagesPayloadPayload { + func toChatCompletionRequest() -> Components.Schemas.CreateAgentTurnRequest.messagesPayloadPayload { switch self { case .UserMessage(let userMessage): return .UserMessage(userMessage) @@ -35,55 +35,55 @@ public extension Components.Schemas.CreateAgentTurnRequest.messagesPayloadPayloa } } -public extension Components.Schemas.AgentConfig.toolsPayloadPayload { - func toToolDefinition() -> Components.Schemas.ToolDefinition { - switch self { - case .SearchToolDefinition(_): - return Components.Schemas.ToolDefinition( - tool_name: .BuiltinTool(.brave_search) - ) - case .WolframAlphaToolDefinition(_): - return Components.Schemas.ToolDefinition( - tool_name: .BuiltinTool(.wolfram_alpha) - ) - case .PhotogenToolDefinition(_): - return Components.Schemas.ToolDefinition( - tool_name: .BuiltinTool(.photogen) - ) - case .CodeInterpreterToolDefinition(_): - return Components.Schemas.ToolDefinition( - tool_name: .BuiltinTool(.code_interpreter) - ) - case .FunctionCallToolDefinition(let tool): - return Components.Schemas.ToolDefinition( - description: tool.description, - parameters: tool.parameters.toToolDefinitionParameters(), - tool_name: .case2(tool.function_name) - ) - case .MemoryToolDefinition(let value): - return Components.Schemas.ToolDefinition( - description: "Memory Tool", - parameters: nil, - tool_name: .case2("memory") - ) - } - } -} +//public extension Components.Schemas.AgentConfig.toolsPayloadPayload { +// func toToolDefinition() -> Components.Schemas.ToolDefinition { +// switch self { +// case .SearchToolDefinition(_): +// return Components.Schemas.ToolDefinition( +// tool_name: .BuiltinTool(.brave_search) +// ) +// case .WolframAlphaToolDefinition(_): +// return Components.Schemas.ToolDefinition( +// tool_name: .BuiltinTool(.wolfram_alpha) +// ) +// case .PhotogenToolDefinition(_): +// return Components.Schemas.ToolDefinition( +// tool_name: .BuiltinTool(.photogen) +// ) +// case .CodeInterpreterToolDefinition(_): +// return Components.Schemas.ToolDefinition( +// tool_name: .BuiltinTool(.code_interpreter) +// ) +// case .FunctionCallToolDefinition(let tool): +// return Components.Schemas.ToolDefinition( +// description: tool.description, +// parameters: tool.parameters.toToolDefinitionParameters(), +// tool_name: .case2(tool.function_name) +// ) +// case .MemoryToolDefinition(let value): +// return Components.Schemas.ToolDefinition( +// description: "Memory Tool", +// parameters: nil, +// tool_name: .case2("memory") +// ) +// } +// } +//} -public extension Components.Schemas.AgentConfig { - var toolDefinitions: [Components.Schemas.ToolDefinition]? { - return tools?.map { $0.toToolDefinition() } - } -} +//public extension Components.Schemas.AgentConfig { +// var toolDefinitions: [Components.Schemas.ToolDef]? { +// return client_tools?.map { $0.toToolDefinition() } +// } +//} -public extension Components.Schemas.FunctionCallToolDefinition.parametersPayload { +public extension Components.Schemas.ToolDefinition.parametersPayload { func toToolDefinitionParameters() -> Components.Schemas.ToolDefinition.parametersPayload { return Components.Schemas.ToolDefinition.parametersPayload(additionalProperties: self.additionalProperties) } } public extension Components.Schemas.ToolDefinition.parametersPayload { - init(fromFunctionCallParameters params: Components.Schemas.FunctionCallToolDefinition.parametersPayload) { + init(fromFunctionCallParameters params: Components.Schemas.ToolDefinition.parametersPayload) { self.init(additionalProperties: params.additionalProperties) } } diff --git a/Sources/LlamaStackClient/Inference/RemoteInference.swift b/Sources/LlamaStackClient/Inference/RemoteInference.swift index a6c5686..caf5bcd 100644 --- a/Sources/LlamaStackClient/Inference/RemoteInference.swift +++ b/Sources/LlamaStackClient/Inference/RemoteInference.swift @@ -18,8 +18,8 @@ public class RemoteInference: Inference { return AsyncStream { continuation in Task { do { - let response = try await self.client.post_sol_alpha_sol_inference_sol_chat_hyphen_completion( - body: Operations.post_sol_alpha_sol_inference_sol_chat_hyphen_completion.Input.Body.json(request) + let response = try await self.client.post_sol_v1_sol_inference_sol_chat_hyphen_completion( + body: Operations.post_sol_v1_sol_inference_sol_chat_hyphen_completion.Input.Body.json(request) ) let stream = try response.ok.body.text_event_hyphen_stream.asDecodedServerSentEventsWithJSONData( of: Components.Schemas.ChatCompletionResponseStreamChunk.self diff --git a/Sources/LlamaStackClient/openapi.yaml b/Sources/LlamaStackClient/openapi.yaml index bf9da81..a2c6a19 100644 --- a/Sources/LlamaStackClient/openapi.yaml +++ b/Sources/LlamaStackClient/openapi.yaml @@ -17,6 +17,10 @@ components: AgentConfig: additionalProperties: false properties: + client_tools: + items: + $ref: '#/components/schemas/ToolDef' + type: array enable_session_persistence: type: boolean input_shields: @@ -42,15 +46,9 @@ components: tool_prompt_format: $ref: '#/components/schemas/ToolPromptFormat' default: json - tools: + toolgroups: items: - oneOf: - - $ref: '#/components/schemas/SearchToolDefinition' - - $ref: '#/components/schemas/WolframAlphaToolDefinition' - - $ref: '#/components/schemas/PhotogenToolDefinition' - - $ref: '#/components/schemas/CodeInterpreterToolDefinition' - - $ref: '#/components/schemas/FunctionCallToolDefinition' - - $ref: '#/components/schemas/MemoryToolDefinition' + $ref: '#/components/schemas/AgentTool' type: array required: - max_infer_iters @@ -86,6 +84,26 @@ components: required: - step type: object + AgentTool: + oneOf: + - type: string + - additionalProperties: false + properties: + args: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + name: + type: string + required: + - name + - args + type: object AgentTurnResponseEvent: additionalProperties: false properties: @@ -113,6 +131,8 @@ components: - $ref: '#/components/schemas/ToolExecutionStep' - $ref: '#/components/schemas/ShieldCallStep' - $ref: '#/components/schemas/MemoryRetrievalStep' + step_id: + type: string step_type: enum: - inference @@ -123,17 +143,18 @@ components: required: - event_type - step_type + - step_id - step_details type: object AgentTurnResponseStepProgressPayload: additionalProperties: false properties: + delta: + $ref: '#/components/schemas/ContentDelta' event_type: const: step_progress default: step_progress type: string - model_response_text_delta: - type: string step_id: type: string step_type: @@ -143,14 +164,11 @@ components: - 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 + - delta type: object AgentTurnResponseStepStartPayload: additionalProperties: false @@ -217,6 +235,13 @@ components: - event_type - turn_id type: object + AggregationFunctionType: + enum: + - average + - median + - categorical_count + - accuracy + type: string AppEvalTaskConfig: additionalProperties: false properties: @@ -231,6 +256,7 @@ components: oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' type: object type: const: app @@ -261,24 +287,19 @@ components: - dataset_id - rows type: object - Attachment: + BasicScoringFnParams: additionalProperties: false properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array - - $ref: '#/components/schemas/URL' - mime_type: + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + type: + const: basic + default: basic type: string required: - - content - - mime_type + - type type: object BatchChatCompletionRequest: additionalProperties: false @@ -293,11 +314,7 @@ components: messages_batch: items: items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - - $ref: '#/components/schemas/CompletionMessage' + $ref: '#/components/schemas/Message' type: array type: array model: @@ -331,14 +348,7 @@ components: properties: content_batch: items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' type: array logprobs: additionalProperties: false @@ -409,54 +419,12 @@ components: type: object messages: items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - - $ref: '#/components/schemas/CompletionMessage' + $ref: '#/components/schemas/Message' type: array model_id: type: string response_format: - oneOf: - - additionalProperties: false - properties: - json_schema: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - type: - const: json_schema - default: json_schema - type: string - required: - - type - - json_schema - type: object - - additionalProperties: false - properties: - bnf: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - type: - const: grammar - default: grammar - type: string - required: - - type - - bnf - type: object + $ref: '#/components/schemas/ResponseFormat' sampling_params: $ref: '#/components/schemas/SamplingParams' stream: @@ -490,9 +458,7 @@ components: additionalProperties: false properties: delta: - oneOf: - - type: string - - $ref: '#/components/schemas/ToolCallDelta' + $ref: '#/components/schemas/ContentDelta' event_type: $ref: '#/components/schemas/ChatCompletionResponseEventType' logprobs: @@ -523,42 +489,11 @@ components: type: object Checkpoint: description: Checkpoint created during training runs - CodeInterpreterToolDefinition: - additionalProperties: false - properties: - enable_inline_code_execution: - default: true - type: boolean - input_shields: - items: - type: string - type: array - output_shields: - items: - type: string - type: array - remote_execution: - $ref: '#/components/schemas/RestAPIExecutionConfig' - type: - const: code_interpreter - default: code_interpreter - type: string - required: - - type - - enable_inline_code_execution - type: object CompletionMessage: additionalProperties: false properties: content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' role: const: assistant default: assistant @@ -579,14 +514,7 @@ components: additionalProperties: false properties: content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' logprobs: additionalProperties: false properties: @@ -597,45 +525,7 @@ components: model_id: type: string response_format: - oneOf: - - additionalProperties: false - properties: - json_schema: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - type: - const: json_schema - default: json_schema - type: string - required: - - type - - json_schema - type: object - - additionalProperties: false - properties: - bnf: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - type: - const: grammar - default: grammar - type: string - required: - - type - - bnf - type: object + $ref: '#/components/schemas/ResponseFormat' sampling_params: $ref: '#/components/schemas/SamplingParams' stream: @@ -675,6 +565,11 @@ components: - delta title: streamed completion response. type: object + ContentDelta: + oneOf: + - $ref: '#/components/schemas/TextDelta' + - $ref: '#/components/schemas/ImageDelta' + - $ref: '#/components/schemas/ToolCallDelta' CreateAgentRequest: additionalProperties: false properties: @@ -686,22 +581,32 @@ components: CreateAgentSessionRequest: additionalProperties: false properties: - agent_id: - type: string session_name: type: string required: - - agent_id - session_name type: object CreateAgentTurnRequest: additionalProperties: false properties: - agent_id: - type: string - attachments: + documents: items: - $ref: '#/components/schemas/Attachment' + additionalProperties: false + properties: + content: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - items: + $ref: '#/components/schemas/InterleavedContentItem' + type: array + - $ref: '#/components/schemas/URL' + mime_type: + type: string + required: + - content + - mime_type + type: object type: array messages: items: @@ -709,13 +614,13 @@ components: - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/ToolResponseMessage' type: array - session_id: - type: string stream: type: boolean + toolgroups: + items: + $ref: '#/components/schemas/AgentTool' + type: array required: - - agent_id - - session_id - messages type: object DPOAlignmentConfig: @@ -735,102 +640,37 @@ components: - epsilon - gamma type: object + DataConfig: + additionalProperties: false + properties: + batch_size: + type: integer + data_format: + $ref: '#/components/schemas/DatasetFormat' + dataset_id: + type: string + packed: + default: false + type: boolean + shuffle: + type: boolean + train_on_input: + default: false + type: boolean + validation_dataset_id: + type: string + required: + - dataset_id + - batch_size + - shuffle + - data_format + type: object Dataset: additionalProperties: false properties: dataset_schema: additionalProperties: - oneOf: - - additionalProperties: false - properties: - type: - const: string - default: string - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: number - default: number - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: boolean - default: boolean - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: array - default: array - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: object - default: object - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: json - default: json - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: union - default: union - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: chat_completion_input - default: chat_completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: completion_input - default: completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: agent_turn_input - default: agent_turn_input - type: string - required: - - type - type: object + $ref: '#/components/schemas/ParamType' type: object identifier: type: string @@ -862,60 +702,33 @@ components: - url - metadata type: object - DeleteAgentsRequest: - additionalProperties: false - properties: - agent_id: - type: string - required: - - agent_id - type: object - DeleteAgentsSessionRequest: - additionalProperties: false - properties: - agent_id: - type: string - session_id: - type: string - required: - - agent_id - - session_id - type: object - DoraFinetuningConfig: + DatasetFormat: + enum: + - instruct + - dialog + type: string + EfficiencyConfig: additionalProperties: false properties: - alpha: - type: integer - apply_lora_to_mlp: + enable_activation_checkpointing: + default: false type: boolean - apply_lora_to_output: + enable_activation_offloading: + default: false + type: boolean + fsdp_cpu_offload: + default: false + type: boolean + memory_efficient_fsdp_wrap: + default: false type: boolean - lora_attn_modules: - items: - type: string - type: array - rank: - type: integer - required: - - lora_attn_modules - - apply_lora_to_mlp - - apply_lora_to_output - - rank - - alpha type: object EmbeddingsRequest: additionalProperties: false properties: contents: items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' type: array model_id: type: string @@ -1016,68 +829,11 @@ components: oneOf: - $ref: '#/components/schemas/BenchmarkEvalTaskConfig' - $ref: '#/components/schemas/AppEvalTaskConfig' - task_id: - type: string required: - - task_id - input_rows - scoring_functions - task_config type: object - FinetuningAlgorithm: - enum: - - full - - lora - - qlora - - dora - type: string - FunctionCallToolDefinition: - additionalProperties: false - properties: - description: - type: string - function_name: - type: string - input_shields: - items: - type: string - type: array - output_shields: - items: - type: string - type: array - parameters: - additionalProperties: - $ref: '#/components/schemas/ToolParamDefinition' - type: object - remote_execution: - $ref: '#/components/schemas/RestAPIExecutionConfig' - type: - const: function_call - default: function_call - type: string - required: - - type - - function_name - - description - - parameters - type: object - GetAgentsSessionRequest: - additionalProperties: false - properties: - turn_ids: - items: - type: string - type: array - type: object - GetSpanTreeRequest: - additionalProperties: false - properties: - attributes_to_return: - items: - type: string - type: array - type: object GraphMemoryBank: additionalProperties: false properties: @@ -1112,6 +868,16 @@ components: required: - memory_bank_type type: object + GreedySamplingStrategy: + additionalProperties: false + properties: + type: + const: greedy + default: greedy + type: string + required: + - type + type: object HealthInfo: additionalProperties: false properties: @@ -1120,30 +886,42 @@ components: required: - status type: object - ImageMedia: + ImageContentItem: additionalProperties: false properties: - image: - oneOf: - - additionalProperties: false - properties: - format: - type: string - format_description: - type: string - title: This class represents an image object. To create - type: object - - $ref: '#/components/schemas/URL' + data: + contentEncoding: base64 + type: string + type: + const: image + default: image + type: string + url: + $ref: '#/components/schemas/URL' required: - - image + - type type: object - InferenceStep: + ImageDelta: additionalProperties: false properties: - completed_at: - format: date-time + data: + contentEncoding: base64 type: string - model_response: + type: + const: image + default: image + type: string + required: + - type + - data + type: object + InferenceStep: + additionalProperties: false + properties: + completed_at: + format: date-time + type: string + model_response: $ref: '#/components/schemas/CompletionMessage' started_at: format: date-time @@ -1177,29 +955,49 @@ components: - bank_id - documents type: object - Job: - additionalProperties: false - properties: - job_id: + InterleavedContent: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - items: + $ref: '#/components/schemas/InterleavedContentItem' + type: array + InterleavedContentItem: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + InvokeToolRequest: + additionalProperties: false + properties: + args: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + tool_name: type: string required: - - job_id + - tool_name + - args type: object - JobCancelRequest: + Job: additionalProperties: false properties: job_id: type: string - task_id: - type: string required: - - task_id - job_id type: object JobStatus: enum: - completed - in_progress + - failed + - scheduled type: string KeyValueMemoryBank: additionalProperties: false @@ -1272,6 +1070,10 @@ components: LLMAsJudgeScoringFnParams: additionalProperties: false properties: + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array judge_model: type: string judge_score_regexes: @@ -1288,6 +1090,122 @@ components: - type - judge_model type: object + ListDatasetsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/Dataset' + type: array + required: + - data + type: object + ListEvalTasksResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/EvalTask' + type: array + required: + - data + type: object + ListMemoryBanksResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/MemoryBank' + type: array + required: + - data + type: object + ListModelsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + required: + - data + type: object + ListPostTrainingJobsResponse: + additionalProperties: false + properties: + data: + items: + additionalProperties: false + properties: + job_uuid: + type: string + required: + - job_uuid + type: object + type: array + required: + - data + type: object + ListProvidersResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/ProviderInfo' + type: array + required: + - data + type: object + ListRoutesResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/RouteInfo' + type: array + required: + - data + type: object + ListScoringFunctionsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/ScoringFn' + type: array + required: + - data + type: object + ListShieldsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/Shield' + type: array + required: + - data + type: object + ListToolGroupsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + required: + - data + type: object + ListToolsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/Tool' + type: array + required: + - data + type: object LogEventRequest: additionalProperties: false properties: @@ -1324,26 +1242,41 @@ components: items: type: string type: array + quantize_base: + default: false + type: boolean rank: type: integer + type: + const: LoRA + default: LoRA + type: string + use_dora: + default: false + type: boolean required: + - type - lora_attn_modules - apply_lora_to_mlp - apply_lora_to_output - rank - alpha type: object + MemoryBank: + oneOf: + - $ref: '#/components/schemas/VectorMemoryBank' + - $ref: '#/components/schemas/KeyValueMemoryBank' + - $ref: '#/components/schemas/KeywordMemoryBank' + - $ref: '#/components/schemas/GraphMemoryBank' MemoryBankDocument: additionalProperties: false properties: content: oneOf: - type: string - - $ref: '#/components/schemas/ImageMedia' + - $ref: '#/components/schemas/InterleavedContentItem' - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' + $ref: '#/components/schemas/InterleavedContentItem' type: array - $ref: '#/components/schemas/URL' document_id: @@ -1371,14 +1304,7 @@ components: format: date-time type: string inserted_context: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' memory_bank_ids: items: type: string @@ -1401,135 +1327,12 @@ components: - memory_bank_ids - inserted_context type: object - MemoryToolDefinition: - additionalProperties: false - properties: - input_shields: - items: - type: string - type: array - max_chunks: - default: 10 - type: integer - max_tokens_in_context: - default: 4096 - type: integer - memory_bank_configs: - items: - oneOf: - - additionalProperties: false - properties: - bank_id: - type: string - type: - const: vector - default: vector - type: string - required: - - bank_id - - type - type: object - - additionalProperties: false - properties: - bank_id: - type: string - keys: - items: - type: string - type: array - type: - const: keyvalue - default: keyvalue - type: string - required: - - bank_id - - type - - keys - type: object - - additionalProperties: false - properties: - bank_id: - type: string - type: - const: keyword - default: keyword - type: string - required: - - bank_id - - type - type: object - - additionalProperties: false - properties: - bank_id: - type: string - entities: - items: - type: string - type: array - type: - const: graph - default: graph - type: string - required: - - bank_id - - type - - entities - type: object - type: array - output_shields: - items: - type: string - type: array - query_generator_config: - oneOf: - - additionalProperties: false - properties: - sep: - default: ' ' - type: string - type: - const: default - default: default - type: string - required: - - type - - sep - type: object - - additionalProperties: false - properties: - model: - type: string - template: - type: string - type: - const: llm - default: llm - type: string - required: - - type - - model - - template - type: object - - additionalProperties: false - properties: - type: - const: custom - default: custom - type: string - required: - - type - type: object - type: - const: memory - default: memory - type: string - required: - - type - - memory_bank_configs - - query_generator_config - - max_tokens_in_context - - max_chunks - type: object + Message: + oneOf: + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + - $ref: '#/components/schemas/CompletionMessage' MetricEvent: additionalProperties: false properties: @@ -1584,6 +1387,9 @@ components: - type: array - type: object type: object + model_type: + $ref: '#/components/schemas/ModelType' + default: llm provider_id: type: string provider_resource_id: @@ -1598,6 +1404,7 @@ components: - provider_id - type - metadata + - model_type type: object ModelCandidate: additionalProperties: false @@ -1617,27 +1424,34 @@ components: - model - sampling_params type: object + ModelType: + enum: + - llm + - embedding + type: string OptimizerConfig: additionalProperties: false properties: lr: type: number - lr_min: - type: number + num_warmup_steps: + type: integer optimizer_type: - enum: - - adam - - adamw - - sgd - type: string + $ref: '#/components/schemas/OptimizerType' weight_decay: type: number required: - optimizer_type - lr - - lr_min - weight_decay + - num_warmup_steps type: object + OptimizerType: + enum: + - adam + - adamw + - sgd + type: string PaginatedRowsResult: additionalProperties: false properties: @@ -1660,26 +1474,98 @@ components: - rows - total_count type: object - PhotogenToolDefinition: - additionalProperties: false - properties: - input_shields: - items: + ParamType: + oneOf: + - additionalProperties: false + properties: + type: + const: string + default: string type: string - type: array - output_shields: - items: + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: number + default: number type: string - type: array - remote_execution: - $ref: '#/components/schemas/RestAPIExecutionConfig' - type: - const: photogen - default: photogen - type: string - required: - - type - type: object + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: boolean + default: boolean + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: array + default: array + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: object + default: object + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: json + default: json + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: union + default: union + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: chat_completion_input + default: chat_completion_input + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: completion_input + default: completion_input + type: string + required: + - type + type: object + - additionalProperties: false + properties: + type: + const: agent_turn_input + default: agent_turn_input + type: string + required: + - type + type: object PostTrainingJob: additionalProperties: false properties: @@ -1702,27 +1588,6 @@ components: - checkpoints title: Artifacts of a finetuning job. type: object - PostTrainingJobLogStream: - additionalProperties: false - properties: - job_uuid: - type: string - log_lines: - items: - type: string - type: array - required: - - job_uuid - - log_lines - title: Stream of logs from a finetuning job. - type: object - PostTrainingJobStatus: - enum: - - running - - completed - - failed - - scheduled - type: string PostTrainingJobStatusResponse: additionalProperties: false properties: @@ -1751,7 +1616,7 @@ components: format: date-time type: string status: - $ref: '#/components/schemas/PostTrainingJobStatus' + $ref: '#/components/schemas/JobStatus' required: - job_uuid - status @@ -1761,14 +1626,10 @@ components: PreferenceOptimizeRequest: additionalProperties: false properties: - algorithm: - $ref: '#/components/schemas/RLHFAlgorithm' algorithm_config: $ref: '#/components/schemas/DPOAlignmentConfig' - dataset_id: - type: string finetuned_model: - $ref: '#/components/schemas/URL' + type: string hyperparam_search_config: additionalProperties: oneOf: @@ -1789,20 +1650,12 @@ components: - type: array - type: object type: object - optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' training_config: $ref: '#/components/schemas/TrainingConfig' - validation_dataset_id: - type: string required: - job_uuid - finetuned_model - - dataset_id - - validation_dataset_id - - algorithm - algorithm_config - - optimizer_config - training_config - hyperparam_search_config - logger_config @@ -1810,35 +1663,32 @@ components: ProviderInfo: additionalProperties: false properties: + api: + type: string provider_id: type: string provider_type: type: string required: + - api - provider_id - provider_type type: object - QLoraFinetuningConfig: + QATFinetuningConfig: additionalProperties: false properties: - alpha: - type: integer - apply_lora_to_mlp: - type: boolean - apply_lora_to_output: - type: boolean - lora_attn_modules: - items: - type: string - type: array - rank: + group_size: type: integer + quantizer_name: + type: string + type: + const: QAT + default: QAT + type: string required: - - lora_attn_modules - - apply_lora_to_mlp - - apply_lora_to_output - - rank - - alpha + - type + - quantizer_name + - group_size type: object QueryCondition: additionalProperties: false @@ -1881,14 +1731,7 @@ components: - type: object type: object query: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' required: - bank_id - query @@ -1901,14 +1744,7 @@ components: additionalProperties: false properties: content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' document_id: type: string token_count: @@ -1927,46 +1763,43 @@ components: - chunks - scores type: object - QuerySpansRequest: + QuerySpanTreeResponse: additionalProperties: false properties: - attribute_filters: - items: - $ref: '#/components/schemas/QueryCondition' - type: array - attributes_to_return: - items: - type: string - type: array - max_depth: - type: integer + data: + additionalProperties: + $ref: '#/components/schemas/SpanWithStatus' + type: object required: - - attribute_filters - - attributes_to_return + - data type: object - QueryTracesRequest: + QuerySpansResponse: additionalProperties: false properties: - attribute_filters: + data: items: - $ref: '#/components/schemas/QueryCondition' + $ref: '#/components/schemas/Span' type: array - limit: - type: integer - offset: - type: integer - order_by: + required: + - data + type: object + QueryTracesResponse: + additionalProperties: false + properties: + data: items: - type: string + $ref: '#/components/schemas/Trace' type: array + required: + - data type: object - RLHFAlgorithm: - enum: - - dpo - type: string RegexParserScoringFnParams: additionalProperties: false properties: + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array parsing_regexes: items: type: string @@ -1985,97 +1818,7 @@ components: type: string dataset_schema: additionalProperties: - oneOf: - - additionalProperties: false - properties: - type: - const: string - default: string - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: number - default: number - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: boolean - default: boolean - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: array - default: array - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: object - default: object - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: json - default: json - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: union - default: union - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: chat_completion_input - default: chat_completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: completion_input - default: completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: agent_turn_input - default: agent_turn_input - type: string - required: - - type - type: object + $ref: '#/components/schemas/ParamType' type: object metadata: additionalProperties: @@ -2159,6 +1902,8 @@ components: type: object model_id: type: string + model_type: + $ref: '#/components/schemas/ModelType' provider_id: type: string provider_model_id: @@ -2175,102 +1920,13 @@ components: oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' provider_id: type: string provider_scoring_fn_id: type: string return_type: - oneOf: - - additionalProperties: false - properties: - type: - const: string - default: string - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: number - default: number - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: boolean - default: boolean - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: array - default: array - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: object - default: object - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: json - default: json - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: union - default: union - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: chat_completion_input - default: chat_completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: completion_input - default: completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: agent_turn_input - default: agent_turn_input - type: string - required: - - type - type: object + $ref: '#/components/schemas/ParamType' scoring_fn_id: type: string required: @@ -2299,30 +1955,10 @@ components: required: - shield_id type: object - RestAPIExecutionConfig: + RegisterToolGroupRequest: additionalProperties: false properties: - body: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - headers: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - method: - $ref: '#/components/schemas/RestAPIMethod' - params: + args: additionalProperties: oneOf: - type: boolean @@ -2331,19 +1967,56 @@ components: - type: array - type: object type: object - url: + mcp_endpoint: $ref: '#/components/schemas/URL' + provider_id: + type: string + toolgroup_id: + type: string required: - - url - - method + - toolgroup_id + - provider_id type: object - RestAPIMethod: - enum: - - GET - - POST - - PUT - - DELETE - type: string + ResponseFormat: + oneOf: + - additionalProperties: false + properties: + json_schema: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + type: + const: json_schema + default: json_schema + type: string + required: + - type + - json_schema + type: object + - additionalProperties: false + properties: + bnf: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + type: + const: grammar + default: grammar + type: string + required: + - type + - bnf + type: object RouteInfo: additionalProperties: false properties: @@ -2367,10 +2040,7 @@ components: oneOf: - $ref: '#/components/schemas/BenchmarkEvalTaskConfig' - $ref: '#/components/schemas/AppEvalTaskConfig' - task_id: - type: string required: - - task_id - task_config type: object RunShieldRequest: @@ -2378,11 +2048,7 @@ components: properties: messages: items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - - $ref: '#/components/schemas/CompletionMessage' + $ref: '#/components/schemas/Message' type: array params: additionalProperties: @@ -2436,26 +2102,13 @@ components: default: 1.0 type: number strategy: - $ref: '#/components/schemas/SamplingStrategy' - default: greedy - temperature: - default: 0.0 - type: number - top_k: - default: 0 - type: integer - top_p: - default: 0.95 - type: number + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' required: - strategy type: object - SamplingStrategy: - enum: - - greedy - - top_p - - top_k - type: string SaveSpansToDatasetRequest: additionalProperties: false properties: @@ -2489,6 +2142,7 @@ components: - oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' type: object required: - dataset_id @@ -2527,6 +2181,7 @@ components: - oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' type: object required: - input_rows @@ -2562,102 +2217,13 @@ components: oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' provider_id: type: string provider_resource_id: type: string return_type: - oneOf: - - additionalProperties: false - properties: - type: - const: string - default: string - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: number - default: number - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: boolean - default: boolean - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: array - default: array - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: object - default: object - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: json - default: json - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: union - default: union - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: chat_completion_input - default: chat_completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: completion_input - default: completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: agent_turn_input - default: agent_turn_input - type: string - required: - - type - type: object + $ref: '#/components/schemas/ParamType' type: const: scoring_function default: scoring_function @@ -2697,46 +2263,11 @@ components: - score_rows - aggregated_results type: object - SearchToolDefinition: - additionalProperties: false - properties: - api_key: - type: string - engine: - default: brave - enum: - - bing - - brave - - tavily - type: string - input_shields: - items: - type: string - type: array - output_shields: - items: - type: string - type: array - remote_execution: - $ref: '#/components/schemas/RestAPIExecutionConfig' - type: - const: brave_search - default: brave_search - type: string - required: - - type - - api_key - - engine - type: object Session: additionalProperties: false properties: memory_bank: - oneOf: - - $ref: '#/components/schemas/VectorMemoryBank' - - $ref: '#/components/schemas/KeyValueMemoryBank' - - $ref: '#/components/schemas/KeywordMemoryBank' - - $ref: '#/components/schemas/GraphMemoryBank' + $ref: '#/components/schemas/MemoryBank' session_id: type: string session_name: @@ -2873,7 +2404,7 @@ components: - ok - error type: string - SpanWithChildren: + SpanWithStatus: additionalProperties: false properties: attributes: @@ -2885,10 +2416,6 @@ components: - type: array - type: object type: object - children: - items: - $ref: '#/components/schemas/SpanWithChildren' - type: array end_time: format: date-time type: string @@ -2910,7 +2437,6 @@ components: - trace_id - name - start_time - - children type: object StopReason: enum: @@ -2955,14 +2481,11 @@ components: SupervisedFineTuneRequest: additionalProperties: false properties: - algorithm: - $ref: '#/components/schemas/FinetuningAlgorithm' algorithm_config: oneOf: - $ref: '#/components/schemas/LoraFinetuningConfig' - - $ref: '#/components/schemas/QLoraFinetuningConfig' - - $ref: '#/components/schemas/DoraFinetuningConfig' - dataset_id: + - $ref: '#/components/schemas/QATFinetuningConfig' + checkpoint_dir: type: string hyperparam_search_config: additionalProperties: @@ -2986,34 +2509,21 @@ components: type: object model: type: string - optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' training_config: $ref: '#/components/schemas/TrainingConfig' - validation_dataset_id: - type: string required: - job_uuid - - model - - dataset_id - - validation_dataset_id - - algorithm - - algorithm_config - - optimizer_config - training_config - hyperparam_search_config - logger_config + - model type: object SyntheticDataGenerateRequest: additionalProperties: false properties: dialogs: items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - - $ref: '#/components/schemas/CompletionMessage' + $ref: '#/components/schemas/Message' type: array filtering_function: enum: @@ -3063,14 +2573,7 @@ components: additionalProperties: false properties: content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' role: const: system default: system @@ -3079,6 +2582,32 @@ components: - role - content type: object + TextContentItem: + additionalProperties: false + properties: + text: + type: string + type: + const: text + default: text + type: string + required: + - type + - text + type: object + TextDelta: + additionalProperties: false + properties: + text: + type: string + type: + const: text + default: text + type: string + required: + - type + - text + type: object TokenLogProbs: additionalProperties: false properties: @@ -3089,24 +2618,66 @@ components: required: - logprobs_by_token type: object - ToolCall: + Tool: additionalProperties: false properties: - arguments: + description: + type: string + identifier: + type: string + metadata: additionalProperties: oneOf: - - type: string - - type: integer - - type: number - type: boolean - - items: - oneOf: - - type: string - - type: integer - - type: number - - type: boolean - type: array - - additionalProperties: + - type: number + - type: string + - type: array + - type: object + type: object + parameters: + items: + $ref: '#/components/schemas/ToolParameter' + type: array + provider_id: + type: string + provider_resource_id: + type: string + tool_host: + $ref: '#/components/schemas/ToolHost' + toolgroup_id: + type: string + type: + const: tool + default: tool + type: string + required: + - identifier + - provider_resource_id + - provider_id + - type + - toolgroup_id + - tool_host + - description + - parameters + type: object + ToolCall: + additionalProperties: false + properties: + arguments: + additionalProperties: + oneOf: + - type: string + - type: integer + - type: number + - type: boolean + - items: + oneOf: + - type: string + - type: integer + - type: number + - type: boolean + type: array + - additionalProperties: oneOf: - type: string - type: integer @@ -3134,7 +2705,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 @@ -3142,14 +2718,37 @@ components: enum: - started - in_progress - - failure - - success + - failed + - succeeded type: string ToolChoice: enum: - auto - required type: string + ToolDef: + additionalProperties: false + properties: + description: + type: string + metadata: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + name: + type: string + parameters: + items: + $ref: '#/components/schemas/ToolParameter' + type: array + required: + - name + type: object ToolDefinition: additionalProperties: false properties: @@ -3198,6 +2797,54 @@ components: - tool_calls - tool_responses type: object + ToolGroup: + additionalProperties: false + properties: + args: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + identifier: + type: string + mcp_endpoint: + $ref: '#/components/schemas/URL' + provider_id: + type: string + provider_resource_id: + type: string + type: + const: tool_group + default: tool_group + type: string + required: + - identifier + - provider_resource_id + - provider_id + - type + type: object + ToolHost: + enum: + - distribution + - client + - model_context_protocol + type: string + ToolInvocationResult: + additionalProperties: false + properties: + content: + $ref: '#/components/schemas/InterleavedContent' + error_code: + type: integer + error_message: + type: string + required: + - content + type: object ToolParamDefinition: additionalProperties: false properties: @@ -3218,6 +2865,31 @@ components: required: - param_type type: object + ToolParameter: + additionalProperties: false + properties: + default: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: + type: string + name: + type: string + parameter_type: + type: string + required: + default: true + type: boolean + required: + - name + - parameter_type + - description + - required + type: object ToolPromptFormat: description: "`json` --\n Refers to the json format for calling tools.\n\ \ The json format takes the form like\n {\n \"type\": \"function\"\ @@ -3240,14 +2912,7 @@ components: call_id: type: string content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' tool_name: oneOf: - $ref: '#/components/schemas/BuiltinTool' @@ -3263,17 +2928,10 @@ components: call_id: type: string content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' role: - const: ipython - default: ipython + const: tool + default: tool type: string tool_name: oneOf: @@ -3285,6 +2943,34 @@ components: - tool_name - content type: object + TopKSamplingStrategy: + additionalProperties: false + properties: + top_k: + type: integer + type: + const: top_k + default: top_k + type: string + required: + - type + - top_k + type: object + TopPSamplingStrategy: + additionalProperties: false + properties: + temperature: + type: number + top_p: + default: 0.95 + type: number + type: + const: top_p + default: top_p + type: string + required: + - type + type: object Trace: additionalProperties: false properties: @@ -3306,28 +2992,30 @@ components: TrainingConfig: additionalProperties: false properties: - batch_size: + data_config: + $ref: '#/components/schemas/DataConfig' + dtype: + default: bf16 + type: string + efficiency_config: + $ref: '#/components/schemas/EfficiencyConfig' + gradient_accumulation_steps: type: integer - enable_activation_checkpointing: - type: boolean - fsdp_cpu_offload: - type: boolean - memory_efficient_fsdp_wrap: - type: boolean - n_epochs: + max_steps_per_epoch: type: integer - n_iters: + max_validation_steps: type: integer - shuffle: - type: boolean + n_epochs: + type: integer + optimizer_config: + $ref: '#/components/schemas/OptimizerConfig' required: - n_epochs - - batch_size - - shuffle - - n_iters - - enable_activation_checkpointing - - memory_efficient_fsdp_wrap - - fsdp_cpu_offload + - max_steps_per_epoch + - gradient_accumulation_steps + - max_validation_steps + - data_config + - optimizer_config type: object Turn: additionalProperties: false @@ -3343,7 +3031,22 @@ components: type: array output_attachments: items: - $ref: '#/components/schemas/Attachment' + additionalProperties: false + properties: + content: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - items: + $ref: '#/components/schemas/InterleavedContentItem' + type: array + - $ref: '#/components/schemas/URL' + mime_type: + type: string + required: + - content + - mime_type + type: object type: array output_message: $ref: '#/components/schemas/CompletionMessage' @@ -3373,32 +3076,12 @@ components: title: A single turn in an interaction with an Agentic System. type: object URL: - format: uri - pattern: ^(https?://|file://|data:) - type: string - UnregisterDatasetRequest: - additionalProperties: false - properties: - dataset_id: - type: string - required: - - dataset_id - type: object - UnregisterMemoryBankRequest: - additionalProperties: false - properties: - memory_bank_id: - type: string - required: - - memory_bank_id - type: object - UnregisterModelRequest: additionalProperties: false properties: - model_id: + uri: type: string required: - - model_id + - uri type: object UnstructuredLogEvent: additionalProperties: false @@ -3439,23 +3122,9 @@ components: additionalProperties: false properties: content: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' context: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ImageMedia' - type: array + $ref: '#/components/schemas/InterleavedContent' role: const: user default: user @@ -3469,6 +3138,9 @@ components: properties: chunk_size_in_tokens: type: integer + embedding_dimension: + default: 384 + type: integer embedding_model: type: string identifier: @@ -3514,51 +3186,43 @@ components: - embedding_model - chunk_size_in_tokens type: object + VersionInfo: + additionalProperties: false + properties: + version: + type: string + required: + - version + type: object ViolationLevel: enum: - info - warn - error type: string - WolframAlphaToolDefinition: - additionalProperties: false - properties: - api_key: - type: string - input_shields: - items: - type: string - type: array - output_shields: - items: - type: string - type: array - remote_execution: - $ref: '#/components/schemas/RestAPIExecutionConfig' - type: - const: wolfram_alpha - default: wolfram_alpha - type: string - required: - - type - - api_key - type: object 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." title: Llama Stack Specification - version: alpha + version: v1 jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema openapi: 3.1.0 paths: - /alpha/agents/create: + /v1/agents: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3577,34 +3241,52 @@ paths: description: OK tags: - Agents - /alpha/agents/delete: - post: + /v1/agents/{agent_id}: + delete: parameters: + - in: path + name: agent_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteAgentsRequest' - required: true responses: '200': description: OK tags: - Agents - /alpha/agents/session/create: + /v1/agents/{agent_id}/session: post: parameters: - - description: JSON-encoded provider data which will be made available to the + - in: path + name: agent_id + required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3623,53 +3305,71 @@ paths: description: OK tags: - Agents - /alpha/agents/session/delete: - post: + /v1/agents/{agent_id}/session/{session_id}: + delete: parameters: + - in: path + name: session_id + required: true + schema: + type: string + - in: path + name: agent_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteAgentsSessionRequest' - required: true responses: '200': description: OK tags: - Agents - /alpha/agents/session/get: - post: + get: parameters: - - in: query - name: agent_id + - in: path + name: session_id required: true schema: type: string - - in: query - name: session_id + - in: path + name: agent_id required: true schema: type: string + - in: query + name: turn_ids + required: false + schema: + items: + type: string + type: array - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetAgentsSessionRequest' - required: true responses: '200': content: @@ -3679,52 +3379,30 @@ paths: description: OK tags: - Agents - /alpha/agents/step/get: - get: + /v1/agents/{agent_id}/session/{session_id}/turn: + post: parameters: - - in: query + - in: path name: agent_id required: true schema: type: string - - in: query + - in: path name: session_id required: true schema: type: string - - in: query - name: turn_id - required: true - schema: - type: string - - in: query - name: step_id - required: true - schema: - type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AgentStepResponse' - description: OK - tags: - - Agents - /alpha/agents/turn/create: - post: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3746,20 +3424,20 @@ paths: streamed agent turn completion response. tags: - Agents - /alpha/agents/turn/get: + /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: parameters: - - in: query + - in: path name: agent_id required: true schema: type: string - - in: query + - in: path name: session_id required: true schema: type: string - - in: query + - in: path name: turn_id required: true schema: @@ -3767,7 +3445,14 @@ paths: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3780,38 +3465,66 @@ paths: description: OK tags: - Agents - /alpha/batch-inference/chat-completion: - post: + /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: + get: parameters: + - in: path + name: agent_id + required: true + schema: + type: string + - in: path + name: session_id + required: true + schema: + type: string + - in: path + name: turn_id + required: true + schema: + type: string + - in: path + name: step_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BatchChatCompletionRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/BatchChatCompletionResponse' + $ref: '#/components/schemas/AgentStepResponse' description: OK tags: - - BatchInference (Coming Soon) - /alpha/batch-inference/completion: + - Agents + /v1/batch-inference/chat-completion: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3819,24 +3532,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BatchCompletionRequest' + $ref: '#/components/schemas/BatchChatCompletionRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/BatchCompletionResponse' + $ref: '#/components/schemas/BatchChatCompletionResponse' description: OK tags: - BatchInference (Coming Soon) - /alpha/datasetio/append-rows: + /v1/batch-inference/completion: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3844,14 +3564,18 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppendRowsRequest' + $ref: '#/components/schemas/BatchCompletionRequest' required: true responses: '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchCompletionResponse' description: OK tags: - - DatasetIO - /alpha/datasetio/get-rows-paginated: + - BatchInference (Coming Soon) + /v1/datasetio/rows: get: parameters: - in: query @@ -3877,7 +3601,14 @@ paths: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3890,57 +3621,72 @@ paths: description: OK tags: - DatasetIO - /alpha/datasets/get: - get: + post: parameters: - - in: query - name: dataset_id - required: true - schema: - type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AppendRowsRequest' + required: true responses: '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/Dataset' description: OK tags: - - Datasets - /alpha/datasets/list: + - DatasetIO + /v1/datasets: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/Dataset' + $ref: '#/components/schemas/ListDatasetsResponse' description: OK tags: - Datasets - /alpha/datasets/register: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3955,39 +3701,51 @@ paths: description: OK tags: - Datasets - /alpha/datasets/unregister: - post: + /v1/datasets/{dataset_id}: + delete: parameters: + - in: path + name: dataset_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnregisterDatasetRequest' - required: true responses: '200': description: OK tags: - Datasets - /alpha/eval-tasks/get: get: parameters: - - in: query - name: name + - in: path + name: dataset_id required: true schema: type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -3997,36 +3755,49 @@ paths: application/json: schema: oneOf: - - $ref: '#/components/schemas/EvalTask' + - $ref: '#/components/schemas/Dataset' description: OK tags: - - EvalTasks - /alpha/eval-tasks/list: + - Datasets + /v1/eval-tasks: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/EvalTask' + $ref: '#/components/schemas/ListEvalTasksResponse' description: OK tags: - EvalTasks - /alpha/eval-tasks/register: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4041,13 +3812,57 @@ paths: description: OK tags: - EvalTasks - /alpha/eval/evaluate-rows: + /v1/eval-tasks/{eval_task_id}: + get: + parameters: + - in: path + name: eval_task_id + required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/EvalTask' + description: OK + tags: + - EvalTasks + /v1/eval/tasks/{task_id}/evaluations: post: parameters: + - in: path + name: task_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4066,13 +3881,25 @@ paths: description: OK tags: - Eval - /alpha/eval/job/cancel: + /v1/eval/tasks/{task_id}/jobs: post: parameters: + - in: path + name: task_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4080,22 +3907,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/JobCancelRequest' + $ref: '#/components/schemas/RunEvalRequest' required: true responses: '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Job' description: OK tags: - Eval - /alpha/eval/job/result: - get: + /v1/eval/tasks/{task_id}/jobs/{job_id}: + delete: parameters: - - in: query + - in: path name: task_id required: true schema: type: string - - in: query + - in: path name: job_id required: true schema: @@ -4103,28 +3934,30 @@ paths: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EvaluateResponse' description: OK tags: - Eval - /alpha/eval/job/status: get: parameters: - - in: query + - in: path name: task_id required: true schema: type: string - - in: query + - in: path name: job_id required: true schema: @@ -4132,7 +3965,14 @@ paths: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4146,38 +3986,56 @@ paths: description: OK tags: - Eval - /alpha/eval/run-eval: - post: + /v1/eval/tasks/{task_id}/jobs/{job_id}/result: + get: parameters: + - in: path + name: job_id + required: true + schema: + type: string + - in: path + name: task_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunEvalRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Job' + $ref: '#/components/schemas/EvaluateResponse' description: OK tags: - Eval - /alpha/health: + /v1/health: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4190,13 +4048,20 @@ paths: description: OK tags: - Inspect - /alpha/inference/chat-completion: + /v1/inference/chat-completion: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4217,13 +4082,20 @@ paths: description: Chat completion response. **OR** SSE-stream of these events. tags: - Inference - /alpha/inference/completion: + /v1/inference/completion: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4244,13 +4116,20 @@ paths: description: Completion response. **OR** streamed completion response. tags: - Inference - /alpha/inference/embeddings: + /v1/inference/embeddings: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4269,18 +4148,46 @@ paths: description: OK tags: - Inference - /alpha/memory-banks/get: + /v1/inspect/providers: get: parameters: - - in: query - name: memory_bank_id - required: true + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false schema: type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListProvidersResponse' + description: OK + tags: + - Inspect + /v1/inspect/routes: + get: + parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4289,45 +4196,49 @@ paths: content: application/json: schema: - oneOf: - - oneOf: - - $ref: '#/components/schemas/VectorMemoryBank' - - $ref: '#/components/schemas/KeyValueMemoryBank' - - $ref: '#/components/schemas/KeywordMemoryBank' - - $ref: '#/components/schemas/GraphMemoryBank' + $ref: '#/components/schemas/ListRoutesResponse' description: OK tags: - - MemoryBanks - /alpha/memory-banks/list: + - Inspect + /v1/memory-banks: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/VectorMemoryBank' - - $ref: '#/components/schemas/KeyValueMemoryBank' - - $ref: '#/components/schemas/KeywordMemoryBank' - - $ref: '#/components/schemas/GraphMemoryBank' + $ref: '#/components/schemas/ListMemoryBanksResponse' description: OK tags: - MemoryBanks - /alpha/memory-banks/register: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4339,37 +4250,89 @@ paths: required: true responses: '200': - description: OK + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/VectorMemoryBank' + - $ref: '#/components/schemas/KeyValueMemoryBank' + - $ref: '#/components/schemas/KeywordMemoryBank' + - $ref: '#/components/schemas/GraphMemoryBank' + description: '' tags: - MemoryBanks - /alpha/memory-banks/unregister: - post: + /v1/memory-banks/{memory_bank_id}: + delete: parameters: + - in: path + name: memory_bank_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnregisterMemoryBankRequest' + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + description: OK + tags: + - MemoryBanks + get: + parameters: + - in: path + name: memory_bank_id required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string responses: '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/MemoryBank' description: OK tags: - MemoryBanks - /alpha/memory/insert: + /v1/memory/insert: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4384,13 +4347,20 @@ paths: description: OK tags: - Memory - /alpha/memory/query: + /v1/memory/query: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4409,57 +4379,45 @@ paths: description: OK tags: - Memory - /alpha/models/get: + /v1/models: get: parameters: - - in: query - name: identifier - required: true - schema: - type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/Model' - description: OK - tags: - - Models - /alpha/models/list: - get: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/Model' + $ref: '#/components/schemas/ListModelsResponse' description: OK tags: - Models - /alpha/models/register: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4478,28 +4436,65 @@ paths: description: OK tags: - Models - /alpha/models/unregister: - post: + /v1/models/{model_id}: + delete: parameters: + - in: path + name: model_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnregisterModelRequest' + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + description: OK + tags: + - Models + get: + parameters: + - in: path + name: model_id required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string responses: '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Model' description: OK tags: - Models - /alpha/post-training/job/artifacts: + /v1/post-training/job/artifacts: get: parameters: - in: query @@ -4510,7 +4505,14 @@ paths: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4519,17 +4521,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' + oneOf: + - $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' description: OK tags: - PostTraining (Coming Soon) - /alpha/post-training/job/cancel: + /v1/post-training/job/cancel: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4544,7 +4554,7 @@ paths: description: OK tags: - PostTraining (Coming Soon) - /alpha/post-training/job/logs: + /v1/post-training/job/status: get: parameters: - in: query @@ -4555,31 +4565,14 @@ paths: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PostTrainingJobLogStream' - description: OK - tags: - - PostTraining (Coming Soon) - /alpha/post-training/job/status: - get: - parameters: - - in: query - name: job_uuid - required: true - schema: - type: string - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4588,36 +4581,51 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJobStatusResponse' + oneOf: + - $ref: '#/components/schemas/PostTrainingJobStatusResponse' description: OK tags: - PostTraining (Coming Soon) - /alpha/post-training/jobs: + /v1/post-training/jobs: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/PostTrainingJob' + $ref: '#/components/schemas/ListPostTrainingJobsResponse' description: OK tags: - PostTraining (Coming Soon) - /alpha/post-training/preference-optimize: + /v1/post-training/preference-optimize: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4636,13 +4644,20 @@ paths: description: OK tags: - PostTraining (Coming Soon) - /alpha/post-training/supervised-fine-tune: + /v1/post-training/supervised-fine-tune: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4661,34 +4676,52 @@ paths: description: OK tags: - PostTraining (Coming Soon) - /alpha/providers/list: - get: + /v1/safety/run-shield: + post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunShieldRequest' + required: true responses: '200': content: application/json: schema: - additionalProperties: - $ref: '#/components/schemas/ProviderInfo' - type: object + $ref: '#/components/schemas/RunShieldResponse' description: OK tags: - - Inspect - /alpha/routes/list: + - Safety + /v1/scoring-functions: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4697,136 +4730,529 @@ paths: content: application/json: schema: - additionalProperties: - items: - $ref: '#/components/schemas/RouteInfo' - type: array - type: object + $ref: '#/components/schemas/ListScoringFunctionsResponse' description: OK tags: - - Inspect - /alpha/safety/run-shield: + - ScoringFunctions + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterScoringFunctionRequest' + required: true + responses: + '200': + description: OK + tags: + - ScoringFunctions + /v1/scoring-functions/{scoring_fn_id}: + get: + parameters: + - in: path + name: scoring_fn_id + required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ScoringFn' + description: OK + tags: + - ScoringFunctions + /v1/scoring/score: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreResponse' + description: OK + tags: + - Scoring + /v1/scoring/score-batch: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreBatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreBatchResponse' + description: OK + tags: + - Scoring + /v1/shields: + get: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListShieldsResponse' + description: OK + tags: + - Shields + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterShieldRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Shield' + description: OK + tags: + - Shields + /v1/shields/{identifier}: + get: + parameters: + - in: path + name: identifier + required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Shield' + description: OK + tags: + - Shields + /v1/synthetic-data-generation/generate: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticDataGenerateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticDataGenerationResponse' + description: OK + tags: + - SyntheticDataGeneration (Coming Soon) + /v1/telemetry/events: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LogEventRequest' + required: true + responses: + '200': + description: OK + tags: + - Telemetry + /v1/telemetry/spans: + get: + parameters: + - in: query + name: attribute_filters + required: true + schema: + items: + $ref: '#/components/schemas/QueryCondition' + type: array + - in: query + name: attributes_to_return + required: true + schema: + items: + type: string + type: array + - in: query + name: max_depth + required: false + schema: + type: integer + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySpansResponse' + description: OK + tags: + - Telemetry + /v1/telemetry/spans/export: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SaveSpansToDatasetRequest' + required: true + responses: + '200': + description: OK + tags: + - Telemetry + /v1/telemetry/spans/{span_id}/tree: + get: + parameters: + - in: path + name: span_id + required: true + schema: + type: string + - in: query + name: attributes_to_return + required: false + schema: + items: + type: string + type: array + - in: query + name: max_depth + required: false + schema: + type: integer + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySpanTreeResponse' + description: OK + tags: + - Telemetry + /v1/telemetry/traces: + get: + parameters: + - in: query + name: attribute_filters + required: false + schema: + items: + $ref: '#/components/schemas/QueryCondition' + type: array + - in: query + name: limit + required: false + schema: + type: integer + - in: query + name: offset + required: false + schema: + type: integer + - in: query + name: order_by + required: false + schema: + items: + type: string + type: array + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunShieldRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RunShieldResponse' + $ref: '#/components/schemas/QueryTracesResponse' description: OK tags: - - Safety - /alpha/scoring-functions/get: + - Telemetry + /v1/telemetry/traces/{trace_id}: get: parameters: - - in: query - name: scoring_fn_id + - in: path + name: trace_id required: true schema: type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/ScoringFn' - description: OK - tags: - - ScoringFunctions - /alpha/scoring-functions/list: - get: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/ScoringFn' + $ref: '#/components/schemas/Trace' description: OK tags: - - ScoringFunctions - /alpha/scoring-functions/register: - post: + - Telemetry + /v1/telemetry/traces/{trace_id}/spans/{span_id}: + get: parameters: + - in: path + name: trace_id + required: true + schema: + type: string + - in: path + name: span_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterScoringFunctionRequest' - required: true - responses: - '200': - description: OK - tags: - - ScoringFunctions - /alpha/scoring/score: - post: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ScoreRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ScoreResponse' + $ref: '#/components/schemas/Span' description: OK tags: - - Scoring - /alpha/scoring/score-batch: + - Telemetry + /v1/tool-runtime/invoke: post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4834,68 +5260,94 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchRequest' + $ref: '#/components/schemas/InvokeToolRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchResponse' + $ref: '#/components/schemas/ToolInvocationResult' description: OK + summary: Run a tool with the given arguments tags: - - Scoring - /alpha/shields/get: + - ToolRuntime + /v1/tool-runtime/list-tools: get: parameters: - in: query - name: identifier - required: true + name: tool_group_id + required: false schema: type: string + - in: query + name: mcp_endpoint + required: false + schema: + $ref: '#/components/schemas/URL' - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/json: + application/jsonl: schema: - oneOf: - - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/ToolDef' description: OK tags: - - Shields - /alpha/shields/list: + - ToolRuntime + /v1/toolgroups: get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/ListToolGroupsResponse' description: OK + summary: List tool groups with optional provider tags: - - Shields - /alpha/shields/register: + - ToolGroups post: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string @@ -4903,169 +5355,161 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RegisterShieldRequest' + $ref: '#/components/schemas/RegisterToolGroupRequest' required: true responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Shield' description: OK + summary: Register a tool group tags: - - Shields - /alpha/synthetic-data-generation/generate: - post: + - ToolGroups + /v1/toolgroups/{toolgroup_id}: + delete: parameters: + - in: path + name: toolgroup_id + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SyntheticDataGenerateRequest' - required: true responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SyntheticDataGenerationResponse' description: OK + summary: Unregister a tool group tags: - - SyntheticDataGeneration (Coming Soon) - /alpha/telemetry/get-span-tree: - post: + - ToolGroups + get: parameters: - - in: query - name: span_id + - in: path + name: toolgroup_id required: true schema: type: string - - in: query - name: max_depth - required: false - schema: - type: integer - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetSpanTreeRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SpanWithChildren' + $ref: '#/components/schemas/ToolGroup' description: OK tags: - - Telemetry - /alpha/telemetry/log-event: - post: + - ToolGroups + /v1/tools: + get: parameters: + - in: query + name: toolgroup_id + required: false + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LogEventRequest' - required: true - responses: - '200': - description: OK - tags: - - Telemetry - /alpha/telemetry/query-spans: - post: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansRequest' - required: true responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/Span' + $ref: '#/components/schemas/ListToolsResponse' description: OK + summary: List tools with optional tool group tags: - - Telemetry - /alpha/telemetry/query-traces: - post: + - ToolGroups + /v1/tools/{tool_name}: + get: parameters: + - in: path + name: tool_name + required: true + schema: + type: string - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesRequest' - required: true responses: '200': content: - application/jsonl: + application/json: schema: - $ref: '#/components/schemas/Trace' + $ref: '#/components/schemas/Tool' description: OK tags: - - Telemetry - /alpha/telemetry/save-spans-to-dataset: - post: + - ToolGroups + /v1/version: + get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API in: header - name: X-LlamaStack-ProviderData + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SaveSpansToDatasetRequest' - required: true responses: '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VersionInfo' description: OK tags: - - Telemetry + - Inspect servers: - url: http://any-hosted-llama-stack.com tags: @@ -5082,6 +5526,8 @@ tags: - description: name: AgentStepResponse +- description: + name: AgentTool - description: 'Streamed agent execution response. @@ -5109,14 +5555,18 @@ tags: /> name: AgentTurnResponseTurnStartPayload - name: Agents +- description: + name: AggregationFunctionType - description: name: AppEvalTaskConfig - description: name: AppendRowsRequest -- description: - name: Attachment +- description: + name: BasicScoringFnParams - description: name: BatchChatCompletionRequest @@ -5166,9 +5616,6 @@ tags: ' name: Checkpoint -- description: - name: CodeInterpreterToolDefinition - description: name: CompletionMessage @@ -5186,6 +5633,8 @@ tags: ' name: CompletionResponseStreamChunk +- description: + name: ContentDelta - description: name: CreateAgentRequest @@ -5198,19 +5647,17 @@ tags: - description: name: DPOAlignmentConfig +- description: + name: DataConfig - description: name: Dataset +- description: + name: DatasetFormat - name: DatasetIO - name: Datasets -- description: - name: DeleteAgentsRequest -- description: - name: DeleteAgentsSessionRequest -- description: - name: DoraFinetuningConfig + name: EfficiencyConfig - description: name: EmbeddingsRequest @@ -5227,28 +5674,22 @@ tags: - description: name: EvaluateRowsRequest -- description: - name: FinetuningAlgorithm -- description: - name: FunctionCallToolDefinition -- description: - name: GetAgentsSessionRequest -- description: - name: GetSpanTreeRequest - description: name: GraphMemoryBank - description: name: GraphMemoryBankParams +- description: + name: GreedySamplingStrategy - description: name: HealthInfo -- description: - name: ImageMedia +- description: + name: ImageContentItem +- description: + name: ImageDelta - name: Inference - description: name: InferenceStep @@ -5256,11 +5697,17 @@ tags: /> name: InsertDocumentsRequest - name: Inspect +- description: + name: InterleavedContent +- description: + name: InterleavedContentItem +- description: + name: InvokeToolRequest - description: name: Job -- description: - name: JobCancelRequest - description: name: JobStatus - description: name: LLMAsJudgeScoringFnParams +- description: + name: ListDatasetsResponse +- description: + name: ListEvalTasksResponse +- description: + name: ListMemoryBanksResponse +- description: + name: ListModelsResponse +- description: + name: ListPostTrainingJobsResponse +- description: + name: ListProvidersResponse +- description: + name: ListRoutesResponse +- description: + name: ListScoringFunctionsResponse +- description: + name: ListShieldsResponse +- description: + name: ListToolGroupsResponse +- description: + name: ListToolsResponse - description: name: LogEventRequest @@ -5287,6 +5767,8 @@ tags: /> name: LoraFinetuningConfig - name: Memory +- description: + name: MemoryBank - description: name: MemoryBankDocument @@ -5294,25 +5776,27 @@ tags: - description: name: MemoryRetrievalStep -- description: - name: MemoryToolDefinition +- description: + name: Message - description: name: MetricEvent - description: name: Model - description: name: ModelCandidate +- description: + name: ModelType - name: Models - description: name: OptimizerConfig +- description: + name: OptimizerType - description: name: PaginatedRowsResult -- description: - name: PhotogenToolDefinition +- description: + name: ParamType - name: PostTraining (Coming Soon) - description: @@ -5323,14 +5807,6 @@ tags: ' name: PostTrainingJobArtifactsResponse -- description: 'Stream of logs from a finetuning job. - - - ' - name: PostTrainingJobLogStream -- description: - name: PostTrainingJobStatus - description: 'Status of a finetuning job. @@ -5342,9 +5818,9 @@ tags: name: PreferenceOptimizeRequest - description: name: ProviderInfo -- description: - name: QLoraFinetuningConfig + name: QATFinetuningConfig - description: name: QueryCondition - description: name: QueryDocumentsResponse -- description: - name: QuerySpansRequest -- description: - name: QueryTracesRequest -- description: - name: RLHFAlgorithm + name: QuerySpansResponse +- description: + name: QueryTracesResponse - description: name: RegexParserScoringFnParams @@ -5385,11 +5862,11 @@ tags: - description: name: RegisterShieldRequest -- description: - name: RestAPIExecutionConfig -- description: - name: RestAPIMethod + name: RegisterToolGroupRequest +- description: + name: ResponseFormat - description: name: RouteInfo - description: @@ -5406,9 +5883,6 @@ tags: name: SafetyViolation - description: name: SamplingParams -- description: - name: SamplingStrategy - description: name: SaveSpansToDatasetRequest @@ -5428,9 +5902,6 @@ tags: - name: ScoringFunctions - description: name: ScoringResult -- description: - name: SearchToolDefinition - description: 'A single session of an interaction with an Agentic System. @@ -5453,9 +5924,8 @@ tags: name: SpanStartPayload - description: name: SpanStatus -- description: - name: SpanWithChildren +- description: + name: SpanWithStatus - description: name: StopReason - description: name: SystemMessage - name: Telemetry +- description: + name: TextContentItem +- description: + name: TextDelta - description: name: TokenLogProbs +- description: + name: Tool - description: name: ToolCall - description: @@ -5489,14 +5966,26 @@ tags: name: ToolCallParseStatus - description: name: ToolChoice +- description: + name: ToolDef - description: name: ToolDefinition - description: name: ToolExecutionStep +- description: + name: ToolGroup +- name: ToolGroups +- description: + name: ToolHost +- description: + name: ToolInvocationResult - description: name: ToolParamDefinition +- description: + name: ToolParameter - description: "This Enum refers to the prompt format for calling custom / zero shot\ \ tools\n\n`json` --\n Refers to the json format for calling tools.\n The\ \ json format takes the form like\n {\n \"type\": \"function\",\n \ @@ -5513,6 +6002,13 @@ tags: - description: name: ToolResponseMessage +- name: ToolRuntime +- description: + name: TopKSamplingStrategy +- description: + name: TopPSamplingStrategy - description: name: Trace - description: @@ -5524,15 +6020,6 @@ tags: name: Turn - description: name: URL -- description: - name: UnregisterDatasetRequest -- description: - name: UnregisterMemoryBankRequest -- description: - name: UnregisterModelRequest - description: name: UnstructuredLogEvent @@ -5544,11 +6031,10 @@ tags: - description: name: VectorMemoryBankParams +- description: + name: VersionInfo - description: name: ViolationLevel -- description: - name: WolframAlphaToolDefinition x-tagGroups: - name: Operations tags: @@ -5570,6 +6056,8 @@ x-tagGroups: - Shields - SyntheticDataGeneration (Coming Soon) - Telemetry + - ToolGroups + - ToolRuntime - name: Types tags: - AgentCandidate @@ -5577,6 +6065,7 @@ x-tagGroups: - AgentCreateResponse - AgentSessionCreateResponse - AgentStepResponse + - AgentTool - AgentTurnResponseEvent - AgentTurnResponseStepCompletePayload - AgentTurnResponseStepProgressPayload @@ -5584,9 +6073,10 @@ x-tagGroups: - AgentTurnResponseStreamChunk - AgentTurnResponseTurnCompletePayload - AgentTurnResponseTurnStartPayload + - AggregationFunctionType - AppEvalTaskConfig - AppendRowsRequest - - Attachment + - BasicScoringFnParams - BatchChatCompletionRequest - BatchChatCompletionResponse - BatchCompletionRequest @@ -5600,69 +6090,81 @@ x-tagGroups: - ChatCompletionResponseEventType - ChatCompletionResponseStreamChunk - Checkpoint - - CodeInterpreterToolDefinition - CompletionMessage - CompletionRequest - CompletionResponse - CompletionResponseStreamChunk + - ContentDelta - CreateAgentRequest - CreateAgentSessionRequest - CreateAgentTurnRequest - DPOAlignmentConfig + - DataConfig - Dataset - - DeleteAgentsRequest - - DeleteAgentsSessionRequest - - DoraFinetuningConfig + - DatasetFormat + - EfficiencyConfig - EmbeddingsRequest - EmbeddingsResponse - EvalTask - EvaluateResponse - EvaluateRowsRequest - - FinetuningAlgorithm - - FunctionCallToolDefinition - - GetAgentsSessionRequest - - GetSpanTreeRequest - GraphMemoryBank - GraphMemoryBankParams + - GreedySamplingStrategy - HealthInfo - - ImageMedia + - ImageContentItem + - ImageDelta - InferenceStep - InsertDocumentsRequest + - InterleavedContent + - InterleavedContentItem + - InvokeToolRequest - Job - - JobCancelRequest - JobStatus - KeyValueMemoryBank - KeyValueMemoryBankParams - KeywordMemoryBank - KeywordMemoryBankParams - LLMAsJudgeScoringFnParams + - ListDatasetsResponse + - ListEvalTasksResponse + - ListMemoryBanksResponse + - ListModelsResponse + - ListPostTrainingJobsResponse + - ListProvidersResponse + - ListRoutesResponse + - ListScoringFunctionsResponse + - ListShieldsResponse + - ListToolGroupsResponse + - ListToolsResponse - LogEventRequest - LogSeverity - LoraFinetuningConfig + - MemoryBank - MemoryBankDocument - MemoryRetrievalStep - - MemoryToolDefinition + - Message - MetricEvent - Model - ModelCandidate + - ModelType - OptimizerConfig + - OptimizerType - PaginatedRowsResult - - PhotogenToolDefinition + - ParamType - PostTrainingJob - PostTrainingJobArtifactsResponse - - PostTrainingJobLogStream - - PostTrainingJobStatus - PostTrainingJobStatusResponse - PreferenceOptimizeRequest - ProviderInfo - - QLoraFinetuningConfig + - QATFinetuningConfig - QueryCondition - QueryConditionOp - QueryDocumentsRequest - QueryDocumentsResponse - - QuerySpansRequest - - QueryTracesRequest - - RLHFAlgorithm + - QuerySpanTreeResponse + - QuerySpansResponse + - QueryTracesResponse - RegexParserScoringFnParams - RegisterDatasetRequest - RegisterEvalTaskRequest @@ -5670,15 +6172,14 @@ x-tagGroups: - RegisterModelRequest - RegisterScoringFunctionRequest - RegisterShieldRequest - - RestAPIExecutionConfig - - RestAPIMethod + - RegisterToolGroupRequest + - ResponseFormat - RouteInfo - RunEvalRequest - RunShieldRequest - RunShieldResponse - SafetyViolation - SamplingParams - - SamplingStrategy - SaveSpansToDatasetRequest - ScoreBatchRequest - ScoreBatchResponse @@ -5686,7 +6187,6 @@ x-tagGroups: - ScoreResponse - ScoringFn - ScoringResult - - SearchToolDefinition - Session - Shield - ShieldCallStep @@ -5694,34 +6194,41 @@ x-tagGroups: - SpanEndPayload - SpanStartPayload - SpanStatus - - SpanWithChildren + - SpanWithStatus - StopReason - StructuredLogEvent - SupervisedFineTuneRequest - SyntheticDataGenerateRequest - SyntheticDataGenerationResponse - SystemMessage + - TextContentItem + - TextDelta - TokenLogProbs + - Tool - ToolCall - ToolCallDelta - ToolCallParseStatus - ToolChoice + - ToolDef - ToolDefinition - ToolExecutionStep + - ToolGroup + - ToolHost + - ToolInvocationResult - ToolParamDefinition + - ToolParameter - ToolPromptFormat - ToolResponse - ToolResponseMessage + - TopKSamplingStrategy + - TopPSamplingStrategy - Trace - TrainingConfig - Turn - URL - - UnregisterDatasetRequest - - UnregisterMemoryBankRequest - - UnregisterModelRequest - UnstructuredLogEvent - UserMessage - VectorMemoryBank - VectorMemoryBankParams + - VersionInfo - ViolationLevel - - WolframAlphaToolDefinition From 7cd3ad44efd53ebf01fb8d8297e2a0dbea985135 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Sun, 19 Jan 2025 12:53:44 -0800 Subject: [PATCH 2/7] README update with steps to set up remote inferencing and link to new iOS quick start demo with video --- README.md | 78 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 5a40fab..fd51d50 100644 --- a/README.md +++ b/README.md @@ -9,47 +9,81 @@ llama-stack-client-swift brings the inference and agents APIs of [Llama Stack](h - **Inference & Agents:** Leverage remote Llama Stack distributions for inference, code execution, and safety. - **Custom Tool Calling:** Provide Swift tools that Llama agents can understand and use. +## Quick Demo +See [here](https://github.com/meta-llama/llama-stack-apps/tree/ios_demo/examples/ios_quick_demo/iOSQuickDemo) for a complete iOS demo ([video](https://drive.google.com/file/d/1HnME3VmsYlyeFgsIOMlxZy5c8S2xP4r4/view?usp=sharing)) using a remote Llama Stack server for inferencing. + ## Installation -1. Xcode > File > Add Package Dependencies... +1. Click "Xcode > File > Add Package Dependencies...". + +2. Add this repo URL at the top right: `https://github.com/meta-llama/llama-stack-client-swift`. -2. Add this repo URL at the top right: `https://github.com/meta-llama/llama-stack-client-swift` +3. Select and add `llama-stack-client-swift` to your app target. -3. Select and add `llama-stack-client-swift` to your app target +4. On the first build: Enable & Trust the OpenAPIGenerator extension when prompted. -4. On the first build: Enable & Trust the OpenAPIGenerator extension when prompted +5. Set up a remote Llama Stack distributions, assuming you have a [Fireworks](https://fireworks.ai/account/api-keys) or [Together](https://api.together.ai/) API key, which you can get easily by clicking the link: -5. `import LlamaStackClient` and test out a call: +``` +conda create -n llama-stack python=3.10 +conda activate llama-stack +pip install llama-stack=0.1.0 +``` +Then, either: +``` +llama stack build --template fireworks --image-type conda +export FIREWORKS_API_KEY="" +llama stack run fireworks +``` +or +``` +llama stack build --template together --image-type conda +export TOGETHER_API_KEY="" +llama stack run together +``` + +The default port is 5000 for `llama stack run` and you can specify a different port by adding `--port ` to the end of `llama stack run fireworks|together`. + +6. Replace the `RemoteInference` url below with the your host IP and port: ```swift import LlamaStackClient + let inference = RemoteInference(url: URL(string: "http://127.0.0.1:5000")!) + +do { for await chunk in try await inference.chatCompletion( - request: - Components.Schemas.ChatCompletionRequest( - messages: [ - .UserMessage(Components.Schemas.UserMessage( - content: .case1("Hello Llama!"), - role: .user) - ) - ], model_id: "Meta-Llama3.1-8B-Instruct", - stream: true) - ) { + request: + Components.Schemas.ChatCompletionRequest( + messages: [ + .UserMessage(Components.Schemas.UserMessage( + content: .case1(userInput), + role: .user) + ) + ], model_id: "meta-llama/Llama-3.1-8B-Instruct", + stream: true) + ) { switch (chunk.event.delta) { - case .case1(let s): - print(s) - case .ToolCallDelta(_): + case .TextDelta(let s): + print(s.text) + break + case .ImageDelta(let s): + print("> \(s)") + break + case .ToolCallDelta(let s): + print("> \(s)") break } } +} +catch { + print("Error: \(error)") +} ``` -## Contributing - ### Syncing the API spec -Llama Stack types are generated from the OpenAPI spec in the [main repo](https://github.com/meta-llama/llama-stack). -That spec is synced to this repo via a git submodule and script. We'll typically take care of this and you shouldn't need to run this. +Llama Stack `Types.swift` file is generated from the Llama Stack [API spec](https://github.com/meta-llama/llama-stack/blob/main/docs/resources/llama-stack-spec.yaml) in the main [Llama Stack repo](https://github.com/meta-llama/llama-stack). That spec is synced to this repo via a git submodule and script. You shouldn't need to run this, unless the API spec and your remote server get updated. ``` git submodule update --init --recursive From 99f6b20865db22b51d714d1da0e244e9e4e2c8a5 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Tue, 21 Jan 2025 09:27:31 -0800 Subject: [PATCH 3/7] README update --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fd51d50..cc53f15 100644 --- a/README.md +++ b/README.md @@ -89,3 +89,6 @@ Llama Stack `Types.swift` file is generated from the Llama Stack [API spec](http git submodule update --init --recursive scripts/generate_swift_types.sh ``` + +This will update the `openapi.yaml` file in the Llama Stack Swift SDK source folder `Sources/LlamaStackClient`. + From 9f63c524351449a67eb4a4608dfb2ec00830f077 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Tue, 21 Jan 2025 18:55:33 -0800 Subject: [PATCH 4/7] custom tool SDK update for 0.1.0 --- .../LlamaStackClient/Agents/CustomTools.swift | 27 +++++++++++++++++++ .../Agents/RemoteAgents.swift | 7 ++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Sources/LlamaStackClient/Agents/CustomTools.swift b/Sources/LlamaStackClient/Agents/CustomTools.swift index 54d8b69..697624e 100644 --- a/Sources/LlamaStackClient/Agents/CustomTools.swift +++ b/Sources/LlamaStackClient/Agents/CustomTools.swift @@ -3,6 +3,7 @@ import OpenAPIRuntime public class CustomTools { + // for chat completion (inference) tool calling public class func getCreateEventTool() -> Components.Schemas.ToolDefinition { return Components.Schemas.ToolDefinition( description: "Create a calendar event", @@ -29,4 +30,30 @@ public class CustomTools { ) } + + // for agent tool calling + public class func getCreateEventToolForAgent() -> Components.Schemas.ToolDef { + return Components.Schemas.ToolDef( + description: "Create a calendar event", + metadata: nil, + name: "create_event", + parameters: [ + Components.Schemas.ToolParameter( + description: "The name of the meeting", + name: "event_name", + parameter_type: "string", + required: true), + Components.Schemas.ToolParameter( + description: "Start date in yyyy-MM-dd HH:mm format, eg. '2024-01-01 13:00'", + name: "start", + parameter_type: "string", + required: true), + Components.Schemas.ToolParameter( + description: "End date in yyyy-MM-dd HH:mm format, eg. '2024-01-01 14:00'", + name: "end", + parameter_type: "string", + required: true) + ] + ) + } } diff --git a/Sources/LlamaStackClient/Agents/RemoteAgents.swift b/Sources/LlamaStackClient/Agents/RemoteAgents.swift index c05aee2..d2e8a62 100644 --- a/Sources/LlamaStackClient/Agents/RemoteAgents.swift +++ b/Sources/LlamaStackClient/Agents/RemoteAgents.swift @@ -20,12 +20,13 @@ public class RemoteAgents: Agents { let createSystemResponse = try await create( request: Components.Schemas.CreateAgentRequest( agent_config: Components.Schemas.AgentConfig( + client_tools: [ CustomTools.getCreateEventToolForAgent() ], enable_session_persistence: false, - input_shields: ["llama_guard"], + //input_shields: ["llama_guard"], instructions: "You are a helpful assistant", max_infer_iters: 1, - model: "Meta-Llama3.1-8B-Instruct", - output_shields: ["llama_guard"] + model: "Meta-Llama3.1-8B-Instruct" + //output_shields: ["llama_guard"] // tools: [ // Components.Schemas.AgentConfig.toolsPayloadPayload.FunctionCallToolDefinition( // CustomTools.getCreateEventTool() From 79c09df273967ffdca0868efc4580bc28a3aafc0 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 22 Jan 2025 11:32:56 -0800 Subject: [PATCH 5/7] RemoteAgents.swift cleanup --- Sources/LlamaStackClient/Agents/RemoteAgents.swift | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Sources/LlamaStackClient/Agents/RemoteAgents.swift b/Sources/LlamaStackClient/Agents/RemoteAgents.swift index d2e8a62..6b0529e 100644 --- a/Sources/LlamaStackClient/Agents/RemoteAgents.swift +++ b/Sources/LlamaStackClient/Agents/RemoteAgents.swift @@ -22,16 +22,11 @@ public class RemoteAgents: Agents { agent_config: Components.Schemas.AgentConfig( client_tools: [ CustomTools.getCreateEventToolForAgent() ], enable_session_persistence: false, - //input_shields: ["llama_guard"], + input_shields: ["llama_guard"], instructions: "You are a helpful assistant", max_infer_iters: 1, - model: "Meta-Llama3.1-8B-Instruct" - //output_shields: ["llama_guard"] -// tools: [ -// Components.Schemas.AgentConfig.toolsPayloadPayload.FunctionCallToolDefinition( -// CustomTools.getCreateEventTool() -// ) -// ] + model: "Meta-Llama3.1-8B-Instruct", + output_shields: ["llama_guard"] ) ) ) From d9556a5dec2f712f562b82382ed2cd19391ff245 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 22 Jan 2025 18:30:41 -0800 Subject: [PATCH 6/7] updated openapi.yaml for 0.1rc12 --- Sources/LlamaStackClient/openapi.yaml | 1290 +++++++++++++------------ 1 file changed, 681 insertions(+), 609 deletions(-) diff --git a/Sources/LlamaStackClient/openapi.yaml b/Sources/LlamaStackClient/openapi.yaml index a2c6a19..f269a13 100644 --- a/Sources/LlamaStackClient/openapi.yaml +++ b/Sources/LlamaStackClient/openapi.yaml @@ -104,6 +104,16 @@ components: - name - args type: object + AgentTurnInputType: + additionalProperties: false + properties: + type: + const: agent_turn_input + default: agent_turn_input + type: string + required: + - type + type: object AgentTurnResponseEvent: additionalProperties: false properties: @@ -287,6 +297,16 @@ components: - dataset_id - rows type: object + ArrayType: + additionalProperties: false + properties: + type: + const: array + default: array + type: string + required: + - type + type: object BasicScoringFnParams: additionalProperties: false properties: @@ -392,6 +412,16 @@ components: - type - eval_candidate type: object + BooleanType: + additionalProperties: false + properties: + type: + const: boolean + default: boolean + type: string + required: + - type + type: object BuiltinTool: enum: - brave_search @@ -407,6 +437,16 @@ components: required: - job_uuid type: object + ChatCompletionInputType: + additionalProperties: false + properties: + type: + const: chat_completion_input + default: chat_completion_input + type: string + required: + - type + type: object ChatCompletionRequest: additionalProperties: false properties: @@ -489,6 +529,16 @@ components: type: object Checkpoint: description: Checkpoint created during training runs + CompletionInputType: + additionalProperties: false + properties: + type: + const: completion_input + default: completion_input + type: string + required: + - type + type: object CompletionMessage: additionalProperties: false properties: @@ -707,6 +757,20 @@ components: - instruct - dialog type: string + DefaultRAGQueryGeneratorConfig: + additionalProperties: false + properties: + separator: + default: ' ' + type: string + type: + const: default + default: default + type: string + required: + - type + - separator + type: object EfficiencyConfig: additionalProperties: false properties: @@ -834,40 +898,6 @@ components: - scoring_functions - task_config type: object - GraphMemoryBank: - additionalProperties: false - properties: - identifier: - type: string - memory_bank_type: - const: graph - default: graph - type: string - provider_id: - type: string - provider_resource_id: - type: string - type: - const: memory_bank - default: memory_bank - type: string - required: - - identifier - - provider_resource_id - - provider_id - - type - - memory_bank_type - type: object - GraphMemoryBankParams: - additionalProperties: false - properties: - memory_bank_type: - const: graph - default: graph - type: string - required: - - memory_bank_type - type: object GreedySamplingStrategy: additionalProperties: false properties: @@ -889,22 +919,27 @@ components: ImageContentItem: additionalProperties: false properties: - data: - contentEncoding: base64 - type: string + image: + additionalProperties: false + properties: + data: + contentEncoding: base64 + type: string + url: + $ref: '#/components/schemas/URL' + type: object type: const: image default: image type: string - url: - $ref: '#/components/schemas/URL' required: - type + - image type: object ImageDelta: additionalProperties: false properties: - data: + image: contentEncoding: base64 type: string type: @@ -913,7 +948,7 @@ components: type: string required: - type - - data + - image type: object InferenceStep: additionalProperties: false @@ -940,20 +975,52 @@ components: - step_type - model_response type: object - InsertDocumentsRequest: + InsertChunksRequest: additionalProperties: false properties: - bank_id: - type: string - documents: + chunks: items: - $ref: '#/components/schemas/MemoryBankDocument' + additionalProperties: false + properties: + content: + $ref: '#/components/schemas/InterleavedContent' + metadata: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + required: + - content + - metadata + type: object type: array ttl_seconds: type: integer + vector_db_id: + type: string + required: + - vector_db_id + - chunks + type: object + InsertRequest: + additionalProperties: false + properties: + chunk_size_in_tokens: + type: integer + documents: + items: + $ref: '#/components/schemas/RAGDocument' + type: array + vector_db_id: + type: string required: - - bank_id - documents + - vector_db_id + - chunk_size_in_tokens type: object InterleavedContent: oneOf: @@ -969,7 +1036,7 @@ components: InvokeToolRequest: additionalProperties: false properties: - args: + kwargs: additionalProperties: oneOf: - type: boolean @@ -982,7 +1049,7 @@ components: type: string required: - tool_name - - args + - kwargs type: object Job: additionalProperties: false @@ -999,73 +1066,15 @@ components: - failed - scheduled type: string - KeyValueMemoryBank: + JsonType: additionalProperties: false properties: - identifier: - type: string - memory_bank_type: - const: keyvalue - default: keyvalue - type: string - provider_id: - type: string - provider_resource_id: - type: string type: - const: memory_bank - default: memory_bank - type: string - required: - - identifier - - provider_resource_id - - provider_id - - type - - memory_bank_type - type: object - KeyValueMemoryBankParams: - additionalProperties: false - properties: - memory_bank_type: - const: keyvalue - default: keyvalue - type: string - required: - - memory_bank_type - type: object - KeywordMemoryBank: - additionalProperties: false - properties: - identifier: - type: string - memory_bank_type: - const: keyword - default: keyword - type: string - provider_id: - type: string - provider_resource_id: - type: string - type: - const: memory_bank - default: memory_bank + const: json + default: json type: string required: - - identifier - - provider_resource_id - - provider_id - type - - memory_bank_type - type: object - KeywordMemoryBankParams: - additionalProperties: false - properties: - memory_bank_type: - const: keyword - default: keyword - type: string - required: - - memory_bank_type type: object LLMAsJudgeScoringFnParams: additionalProperties: false @@ -1090,32 +1099,38 @@ components: - type - judge_model type: object - ListDatasetsResponse: + LLMRAGQueryGeneratorConfig: additionalProperties: false properties: - data: - items: - $ref: '#/components/schemas/Dataset' - type: array + model: + type: string + template: + type: string + type: + const: llm + default: llm + type: string required: - - data + - type + - model + - template type: object - ListEvalTasksResponse: + ListDatasetsResponse: additionalProperties: false properties: data: items: - $ref: '#/components/schemas/EvalTask' + $ref: '#/components/schemas/Dataset' type: array required: - data type: object - ListMemoryBanksResponse: + ListEvalTasksResponse: additionalProperties: false properties: data: items: - $ref: '#/components/schemas/MemoryBank' + $ref: '#/components/schemas/EvalTask' type: array required: - data @@ -1206,6 +1221,16 @@ components: required: - data type: object + ListVectorDBsResponse: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/VectorDB' + type: array + required: + - data + type: object LogEventRequest: additionalProperties: false properties: @@ -1262,41 +1287,6 @@ components: - rank - alpha type: object - MemoryBank: - oneOf: - - $ref: '#/components/schemas/VectorMemoryBank' - - $ref: '#/components/schemas/KeyValueMemoryBank' - - $ref: '#/components/schemas/KeywordMemoryBank' - - $ref: '#/components/schemas/GraphMemoryBank' - MemoryBankDocument: - additionalProperties: false - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - items: - $ref: '#/components/schemas/InterleavedContentItem' - type: array - - $ref: '#/components/schemas/URL' - document_id: - type: string - metadata: - additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object - type: object - mime_type: - type: string - required: - - document_id - - content - - metadata - type: object MemoryRetrievalStep: additionalProperties: false properties: @@ -1305,10 +1295,6 @@ components: type: string inserted_context: $ref: '#/components/schemas/InterleavedContent' - memory_bank_ids: - items: - type: string - type: array started_at: format: date-time type: string @@ -1320,11 +1306,13 @@ components: type: string turn_id: type: string + vector_db_ids: + type: string required: - turn_id - step_id - step_type - - memory_bank_ids + - vector_db_ids - inserted_context type: object Message: @@ -1429,6 +1417,26 @@ components: - llm - embedding type: string + NumberType: + additionalProperties: false + properties: + type: + const: number + default: number + type: string + required: + - type + type: object + ObjectType: + additionalProperties: false + properties: + type: + const: object + default: object + type: string + required: + - type + type: object OptimizerConfig: additionalProperties: false properties: @@ -1476,96 +1484,16 @@ components: type: object ParamType: oneOf: - - additionalProperties: false - properties: - type: - const: string - default: string - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: number - default: number - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: boolean - default: boolean - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: array - default: array - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: object - default: object - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: json - default: json - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: union - default: union - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: chat_completion_input - default: chat_completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: completion_input - default: completion_input - type: string - required: - - type - type: object - - additionalProperties: false - properties: - type: - const: agent_turn_input - default: agent_turn_input - type: string - required: - - type - type: object + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' PostTrainingJob: additionalProperties: false properties: @@ -1690,6 +1618,57 @@ components: - quantizer_name - group_size type: object + QueryChunksRequest: + additionalProperties: false + properties: + params: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + query: + $ref: '#/components/schemas/InterleavedContent' + vector_db_id: + type: string + required: + - vector_db_id + - query + type: object + QueryChunksResponse: + additionalProperties: false + properties: + chunks: + items: + additionalProperties: false + properties: + content: + $ref: '#/components/schemas/InterleavedContent' + metadata: + additionalProperties: + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object + type: object + required: + - content + - metadata + type: object + type: array + scores: + items: + type: number + type: array + required: + - chunks + - scores + type: object QueryCondition: additionalProperties: false properties: @@ -1716,82 +1695,105 @@ components: - gt - lt type: string - QueryDocumentsRequest: + QueryRequest: additionalProperties: false properties: - bank_id: - type: string - params: + content: + $ref: '#/components/schemas/InterleavedContent' + query_config: + $ref: '#/components/schemas/RAGQueryConfig' + vector_db_ids: + items: + type: string + type: array + required: + - content + - vector_db_ids + type: object + QuerySpanTreeResponse: + additionalProperties: false + properties: + data: additionalProperties: - oneOf: - - type: boolean - - type: number - - type: string - - type: array - - type: object + $ref: '#/components/schemas/SpanWithStatus' type: object - query: - $ref: '#/components/schemas/InterleavedContent' required: - - bank_id - - query + - data type: object - QueryDocumentsResponse: + QuerySpansResponse: additionalProperties: false properties: - chunks: + data: items: - additionalProperties: false - properties: - content: - $ref: '#/components/schemas/InterleavedContent' - document_id: - type: string - token_count: - type: integer - required: - - content - - token_count - - document_id - type: object + $ref: '#/components/schemas/Span' type: array - scores: + required: + - data + type: object + QueryTracesResponse: + additionalProperties: false + properties: + data: items: - type: number + $ref: '#/components/schemas/Trace' type: array required: - - chunks - - scores + - data type: object - QuerySpanTreeResponse: + RAGDocument: additionalProperties: false properties: - data: + content: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - items: + $ref: '#/components/schemas/InterleavedContentItem' + type: array + - $ref: '#/components/schemas/URL' + document_id: + type: string + metadata: additionalProperties: - $ref: '#/components/schemas/SpanWithStatus' + oneOf: + - type: boolean + - type: number + - type: string + - type: array + - type: object type: object + mime_type: + type: string required: - - data + - document_id + - content + - metadata type: object - QuerySpansResponse: + RAGQueryConfig: additionalProperties: false properties: - data: - items: - $ref: '#/components/schemas/Span' - type: array + max_chunks: + default: 5 + type: integer + max_tokens_in_context: + default: 4096 + type: integer + query_generator_config: + $ref: '#/components/schemas/RAGQueryGeneratorConfig' required: - - data + - query_generator_config + - max_tokens_in_context + - max_chunks type: object - QueryTracesResponse: + RAGQueryGeneratorConfig: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + RAGQueryResult: additionalProperties: false properties: - data: - items: - $ref: '#/components/schemas/Trace' - type: array - required: - - data + content: + $ref: '#/components/schemas/InterleavedContent' type: object RegexParserScoringFnParams: additionalProperties: false @@ -1869,25 +1871,6 @@ components: - dataset_id - scoring_functions type: object - RegisterMemoryBankRequest: - additionalProperties: false - properties: - memory_bank_id: - type: string - params: - oneOf: - - $ref: '#/components/schemas/VectorMemoryBankParams' - - $ref: '#/components/schemas/KeyValueMemoryBankParams' - - $ref: '#/components/schemas/KeywordMemoryBankParams' - - $ref: '#/components/schemas/GraphMemoryBankParams' - provider_id: - type: string - provider_memory_bank_id: - type: string - required: - - memory_bank_id - - params - type: object RegisterModelRequest: additionalProperties: false properties: @@ -1977,6 +1960,23 @@ components: - toolgroup_id - provider_id type: object + RegisterVectorDbRequest: + additionalProperties: false + properties: + embedding_dimension: + type: integer + embedding_model: + type: string + provider_id: + type: string + provider_vector_db_id: + type: string + vector_db_id: + type: string + required: + - vector_db_id + - embedding_model + type: object ResponseFormat: oneOf: - additionalProperties: false @@ -2266,8 +2266,6 @@ components: Session: additionalProperties: false properties: - memory_bank: - $ref: '#/components/schemas/MemoryBank' session_id: type: string session_name: @@ -2444,6 +2442,16 @@ components: - end_of_message - out_of_tokens type: string + StringType: + additionalProperties: false + properties: + type: + const: string + default: string + type: string + required: + - type + type: object StructuredLogEvent: additionalProperties: false properties: @@ -2699,19 +2707,19 @@ components: ToolCallDelta: additionalProperties: false properties: - content: + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + tool_call: oneOf: - type: string - $ref: '#/components/schemas/ToolCall' - parse_status: - $ref: '#/components/schemas/ToolCallParseStatus' type: const: tool_call default: tool_call type: string required: - type - - content + - tool_call - parse_status type: object ToolCallParseStatus: @@ -3083,6 +3091,16 @@ components: required: - uri type: object + UnionType: + additionalProperties: false + properties: + type: + const: union + default: union + type: string + required: + - type + type: object UnstructuredLogEvent: additionalProperties: false properties: @@ -3133,58 +3151,30 @@ components: - role - content type: object - VectorMemoryBank: + VectorDB: additionalProperties: false properties: - chunk_size_in_tokens: - type: integer embedding_dimension: - default: 384 type: integer embedding_model: type: string identifier: type: string - memory_bank_type: - const: vector - default: vector - type: string - overlap_size_in_tokens: - type: integer provider_id: type: string provider_resource_id: type: string type: - const: memory_bank - default: memory_bank + const: vector_db + default: vector_db type: string required: - identifier - provider_resource_id - provider_id - type - - memory_bank_type - - embedding_model - - chunk_size_in_tokens - type: object - VectorMemoryBankParams: - additionalProperties: false - properties: - chunk_size_in_tokens: - type: integer - embedding_model: - type: string - memory_bank_type: - const: vector - default: vector - type: string - overlap_size_in_tokens: - type: integer - required: - - memory_bank_type - embedding_model - - chunk_size_in_tokens + - embedding_dimension type: object VersionInfo: additionalProperties: false @@ -4148,179 +4138,8 @@ paths: description: OK tags: - Inference - /v1/inspect/providers: - get: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API - in: header - name: X-LlamaStack-Provider-Data - required: false - schema: - type: string - - description: Version of the client making the request. This is used to ensure - that the client and server are compatible. - in: header - name: X-LlamaStack-Client-Version - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListProvidersResponse' - description: OK - tags: - - Inspect - /v1/inspect/routes: - get: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API - in: header - name: X-LlamaStack-Provider-Data - required: false - schema: - type: string - - description: Version of the client making the request. This is used to ensure - that the client and server are compatible. - in: header - name: X-LlamaStack-Client-Version - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListRoutesResponse' - description: OK - tags: - - Inspect - /v1/memory-banks: - get: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API - in: header - name: X-LlamaStack-Provider-Data - required: false - schema: - type: string - - description: Version of the client making the request. This is used to ensure - that the client and server are compatible. - in: header - name: X-LlamaStack-Client-Version - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListMemoryBanksResponse' - description: OK - tags: - - MemoryBanks - post: - parameters: - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API - in: header - name: X-LlamaStack-Provider-Data - required: false - schema: - type: string - - description: Version of the client making the request. This is used to ensure - that the client and server are compatible. - in: header - name: X-LlamaStack-Client-Version - required: false - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterMemoryBankRequest' - required: true - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/VectorMemoryBank' - - $ref: '#/components/schemas/KeyValueMemoryBank' - - $ref: '#/components/schemas/KeywordMemoryBank' - - $ref: '#/components/schemas/GraphMemoryBank' - description: '' - tags: - - MemoryBanks - /v1/memory-banks/{memory_bank_id}: - delete: - parameters: - - in: path - name: memory_bank_id - required: true - schema: - type: string - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API - in: header - name: X-LlamaStack-Provider-Data - required: false - schema: - type: string - - description: Version of the client making the request. This is used to ensure - that the client and server are compatible. - in: header - name: X-LlamaStack-Client-Version - required: false - schema: - type: string - responses: - '200': - description: OK - tags: - - MemoryBanks - get: - parameters: - - in: path - name: memory_bank_id - required: true - schema: - type: string - - description: JSON-encoded provider data which will be made available to the - adapter servicing the API - in: header - name: X-LlamaStack-Provider-Data - required: false - schema: - type: string - - description: Version of the client making the request. This is used to ensure - that the client and server are compatible. - in: header - name: X-LlamaStack-Client-Version - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/MemoryBank' - description: OK - tags: - - MemoryBanks - /v1/memory/insert: - post: + /v1/inspect/providers: + get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API @@ -4336,19 +4155,17 @@ paths: required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InsertDocumentsRequest' - required: true responses: '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListProvidersResponse' description: OK tags: - - Memory - /v1/memory/query: - post: + - Inspect + /v1/inspect/routes: + get: parameters: - description: JSON-encoded provider data which will be made available to the adapter servicing the API @@ -4364,21 +4181,15 @@ paths: required: false schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryDocumentsRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/QueryDocumentsResponse' + $ref: '#/components/schemas/ListRoutesResponse' description: OK tags: - - Memory + - Inspect /v1/models: get: parameters: @@ -5308,6 +5119,68 @@ paths: description: OK tags: - ToolRuntime + /v1/tool-runtime/rag-tool/insert: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InsertRequest' + required: true + responses: + '200': + description: OK + summary: Index documents so they can be used by the RAG system + tags: + - ToolRuntime + /v1/tool-runtime/rag-tool/query: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RAGQueryResult' + description: OK + summary: Query the RAG system for context; typically invoked by the agent + tags: + - ToolRuntime /v1/toolgroups: get: parameters: @@ -5484,6 +5357,181 @@ paths: description: OK tags: - ToolGroups + /v1/vector-dbs: + get: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListVectorDBsResponse' + description: OK + tags: + - VectorDBs + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterVectorDbRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VectorDB' + description: OK + tags: + - VectorDBs + /v1/vector-dbs/{vector_db_id}: + delete: + parameters: + - in: path + name: vector_db_id + required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + description: OK + tags: + - VectorDBs + get: + parameters: + - in: path + name: vector_db_id + required: true + schema: + type: string + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/VectorDB' + description: OK + tags: + - VectorDBs + /v1/vector-io/insert: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InsertChunksRequest' + required: true + responses: + '200': + description: OK + tags: + - VectorIO + /v1/vector-io/query: + post: + parameters: + - description: JSON-encoded provider data which will be made available to the + adapter servicing the API + in: header + name: X-LlamaStack-Provider-Data + required: false + schema: + type: string + - description: Version of the client making the request. This is used to ensure + that the client and server are compatible. + in: header + name: X-LlamaStack-Client-Version + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryChunksRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/QueryChunksResponse' + description: OK + tags: + - VectorIO /v1/version: get: parameters: @@ -5528,6 +5576,9 @@ tags: name: AgentStepResponse - description: name: AgentTool +- description: + name: AgentTurnInputType - description: 'Streamed agent execution response. @@ -5564,6 +5615,8 @@ tags: - description: name: AppendRowsRequest +- description: + name: ArrayType - description: name: BasicScoringFnParams @@ -5583,11 +5636,16 @@ tags: - description: name: BenchmarkEvalTaskConfig +- description: + name: BooleanType - description: name: BuiltinTool - description: name: CancelTrainingJobRequest +- description: + name: ChatCompletionInputType - description: name: ChatCompletionRequest @@ -5616,6 +5674,9 @@ tags: ' name: Checkpoint +- description: + name: CompletionInputType - description: name: CompletionMessage @@ -5655,6 +5716,9 @@ tags: name: DatasetFormat - name: DatasetIO - name: Datasets +- description: + name: DefaultRAGQueryGeneratorConfig - description: name: EfficiencyConfig @@ -5674,12 +5738,6 @@ tags: - description: name: EvaluateRowsRequest -- description: - name: GraphMemoryBank -- description: - name: GraphMemoryBankParams - description: name: GreedySamplingStrategy @@ -5693,9 +5751,11 @@ tags: - name: Inference - description: name: InferenceStep -- description: - name: InsertDocumentsRequest + name: InsertChunksRequest +- description: + name: InsertRequest - name: Inspect - description: @@ -5710,30 +5770,20 @@ tags: name: Job - description: name: JobStatus -- description: - name: KeyValueMemoryBank -- description: - name: KeyValueMemoryBankParams -- description: - name: KeywordMemoryBank -- description: - name: KeywordMemoryBankParams +- description: + name: JsonType - description: name: LLMAsJudgeScoringFnParams +- description: + name: LLMRAGQueryGeneratorConfig - description: name: ListDatasetsResponse - description: name: ListEvalTasksResponse -- description: - name: ListMemoryBanksResponse - description: name: ListModelsResponse @@ -5758,6 +5808,9 @@ tags: - description: name: ListToolsResponse +- description: + name: ListVectorDBsResponse - description: name: LogEventRequest @@ -5766,13 +5819,6 @@ tags: - description: name: LoraFinetuningConfig -- name: Memory -- description: - name: MemoryBank -- description: - name: MemoryBankDocument -- name: MemoryBanks - description: name: MemoryRetrievalStep @@ -5787,6 +5833,10 @@ tags: - description: name: ModelType - name: Models +- description: + name: NumberType +- description: + name: ObjectType - description: name: OptimizerConfig @@ -5821,17 +5871,19 @@ tags: - description: name: QATFinetuningConfig +- description: + name: QueryChunksRequest +- description: + name: QueryChunksResponse - description: name: QueryCondition - description: name: QueryConditionOp -- description: - name: QueryDocumentsRequest -- description: - name: QueryDocumentsResponse +- description: + name: QueryRequest - description: name: QuerySpanTreeResponse @@ -5841,6 +5893,15 @@ tags: - description: name: QueryTracesResponse +- description: + name: RAGDocument +- description: + name: RAGQueryConfig +- description: + name: RAGQueryGeneratorConfig +- description: + name: RAGQueryResult - description: name: RegexParserScoringFnParams @@ -5850,9 +5911,6 @@ tags: - description: name: RegisterEvalTaskRequest -- description: - name: RegisterMemoryBankRequest - description: name: RegisterModelRequest @@ -5865,6 +5923,9 @@ tags: - description: name: RegisterToolGroupRequest +- description: + name: RegisterVectorDbRequest - description: name: ResponseFormat - description: @@ -5928,6 +5989,8 @@ tags: name: SpanWithStatus - description: name: StopReason +- description: + name: StringType - description: name: StructuredLogEvent @@ -6020,17 +6083,17 @@ tags: name: Turn - description: name: URL +- description: + name: UnionType - description: name: UnstructuredLogEvent - description: name: UserMessage -- description: - name: VectorMemoryBank -- description: - name: VectorMemoryBankParams +- description: + name: VectorDB +- name: VectorDBs +- name: VectorIO - description: name: VersionInfo - description: @@ -6046,8 +6109,6 @@ x-tagGroups: - EvalTasks - Inference - Inspect - - Memory - - MemoryBanks - Models - PostTraining (Coming Soon) - Safety @@ -6058,6 +6119,8 @@ x-tagGroups: - Telemetry - ToolGroups - ToolRuntime + - VectorDBs + - VectorIO - name: Types tags: - AgentCandidate @@ -6066,6 +6129,7 @@ x-tagGroups: - AgentSessionCreateResponse - AgentStepResponse - AgentTool + - AgentTurnInputType - AgentTurnResponseEvent - AgentTurnResponseStepCompletePayload - AgentTurnResponseStepProgressPayload @@ -6076,20 +6140,24 @@ x-tagGroups: - AggregationFunctionType - AppEvalTaskConfig - AppendRowsRequest + - ArrayType - BasicScoringFnParams - BatchChatCompletionRequest - BatchChatCompletionResponse - BatchCompletionRequest - BatchCompletionResponse - BenchmarkEvalTaskConfig + - BooleanType - BuiltinTool - CancelTrainingJobRequest + - ChatCompletionInputType - ChatCompletionRequest - ChatCompletionResponse - ChatCompletionResponseEvent - ChatCompletionResponseEventType - ChatCompletionResponseStreamChunk - Checkpoint + - CompletionInputType - CompletionMessage - CompletionRequest - CompletionResponse @@ -6102,33 +6170,30 @@ x-tagGroups: - DataConfig - Dataset - DatasetFormat + - DefaultRAGQueryGeneratorConfig - EfficiencyConfig - EmbeddingsRequest - EmbeddingsResponse - EvalTask - EvaluateResponse - EvaluateRowsRequest - - GraphMemoryBank - - GraphMemoryBankParams - GreedySamplingStrategy - HealthInfo - ImageContentItem - ImageDelta - InferenceStep - - InsertDocumentsRequest + - InsertChunksRequest + - InsertRequest - InterleavedContent - InterleavedContentItem - InvokeToolRequest - Job - JobStatus - - KeyValueMemoryBank - - KeyValueMemoryBankParams - - KeywordMemoryBank - - KeywordMemoryBankParams + - JsonType - LLMAsJudgeScoringFnParams + - LLMRAGQueryGeneratorConfig - ListDatasetsResponse - ListEvalTasksResponse - - ListMemoryBanksResponse - ListModelsResponse - ListPostTrainingJobsResponse - ListProvidersResponse @@ -6137,17 +6202,18 @@ x-tagGroups: - ListShieldsResponse - ListToolGroupsResponse - ListToolsResponse + - ListVectorDBsResponse - LogEventRequest - LogSeverity - LoraFinetuningConfig - - MemoryBank - - MemoryBankDocument - MemoryRetrievalStep - Message - MetricEvent - Model - ModelCandidate - ModelType + - NumberType + - ObjectType - OptimizerConfig - OptimizerType - PaginatedRowsResult @@ -6158,21 +6224,26 @@ x-tagGroups: - PreferenceOptimizeRequest - ProviderInfo - QATFinetuningConfig + - QueryChunksRequest + - QueryChunksResponse - QueryCondition - QueryConditionOp - - QueryDocumentsRequest - - QueryDocumentsResponse + - QueryRequest - QuerySpanTreeResponse - QuerySpansResponse - QueryTracesResponse + - RAGDocument + - RAGQueryConfig + - RAGQueryGeneratorConfig + - RAGQueryResult - RegexParserScoringFnParams - RegisterDatasetRequest - RegisterEvalTaskRequest - - RegisterMemoryBankRequest - RegisterModelRequest - RegisterScoringFunctionRequest - RegisterShieldRequest - RegisterToolGroupRequest + - RegisterVectorDbRequest - ResponseFormat - RouteInfo - RunEvalRequest @@ -6196,6 +6267,7 @@ x-tagGroups: - SpanStatus - SpanWithStatus - StopReason + - StringType - StructuredLogEvent - SupervisedFineTuneRequest - SyntheticDataGenerateRequest @@ -6226,9 +6298,9 @@ x-tagGroups: - TrainingConfig - Turn - URL + - UnionType - UnstructuredLogEvent - UserMessage - - VectorMemoryBank - - VectorMemoryBankParams + - VectorDB - VersionInfo - ViolationLevel From c4d7367d0c9e51262d25e65d84fa8b106c7b0ff1 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Sat, 25 Jan 2025 09:05:25 -0800 Subject: [PATCH 7/7] code cleanup --- .../LlamaStackClient/Agents/ChatAgent.swift | 65 ------------------- 1 file changed, 65 deletions(-) diff --git a/Sources/LlamaStackClient/Agents/ChatAgent.swift b/Sources/LlamaStackClient/Agents/ChatAgent.swift index 3430f21..206e7f7 100644 --- a/Sources/LlamaStackClient/Agents/ChatAgent.swift +++ b/Sources/LlamaStackClient/Agents/ChatAgent.swift @@ -46,71 +46,6 @@ class ChatAgent { )) )) ) - - // TODO: Build out step history -// let steps: [Components.Schemas.Turn.stepsPayloadPayload] = [] -// var outputMessage: Components.Schemas.CompletionMessage? = nil -// -// for await chunk in self.run( -// session: session!, -// turnId: turnId, -// inputMessages: request.messages.map { $0.toAgenticSystemTurnCreateRequest() }, -// attachments: [], -// samplingParams: agentConfig.sampling_params -// ) { -// let payload = chunk.event.payload -// switch (payload) { -// case .AgentTurnResponseStepStartPayload(_): -// break -// case .AgentTurnResponseStepProgressPayload(_): -// break -// case .AgentTurnResponseStepCompletePayload(let step): -// switch (step.step_details) { -// case .InferenceStep(let step): -// outputMessage = step.model_response -// case .ToolExecutionStep(_): -// break -// case .ShieldCallStep(_): -// break -// case .MemoryRetrievalStep(_): -// break -// } -// case .AgentTurnResponseTurnStartPayload(_): -// break -// case .AgentTurnResponseTurnCompletePayload(_): -// break -// } -// -// continuation.yield(chunk) -// } -// -// continuation.finish() - -// let turn = Components.Schemas.Turn( -// input_messages: request.messages.map { $0.toAgenticSystemTurnCreateRequest() }, -// output_attachments: [], -// output_message: outputMessage!, -// session_id: request.session_id, -// started_at: Date(), -// steps: steps, -// turn_id: turnId -// ) -// -// await MainActor.run { -// var s = self.sessions[request.session_id] -// s!.turns.append(turn) -// } -// -// continuation.yield( -// Components.Schemas.AgentTurnResponseStreamChunk( -// event: Components.Schemas.AgentTurnResponseEvent( -// payload: -// .AgentTurnResponseTurnCompletePayload(Components.Schemas.AgentTurnResponseTurnCompletePayload( -// event_type: .turn_complete, -// turn: turn)) -// ) -// ) -// ) } } }