Skip to content

Commit 8548f45

Browse files
authored
Merge pull request #2175 from tisnik/lcore-2755-finalization
LCORE-2755: Finalization
2 parents 05a32a4 + b12ebf3 commit 8548f45

2 files changed

Lines changed: 217 additions & 0 deletions

File tree

src/utils/models_dumper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import models.api.responses.successful as s
66
import models.common as c
77
import models.common.agents as a
8+
import models.common.responses as cr
89
import models.compaction as models_compaction
910
from utils.openapi_schema_dumper import dump_openapi_schema
1011

@@ -135,6 +136,8 @@ def dump_models(filename: str) -> None:
135136
a.ToolCallStreamPayload,
136137
a.ToolResultStreamPayload,
137138
a.TurnCompleteStreamPayload,
139+
cr.InputToolMCP,
140+
cr.ResponsesApiParams,
138141
]:
139142
models.append(model)
140143
dump_openapi_schema(models, filename)

tests/unit/utils/test_models_dumper.py

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6068,6 +6068,219 @@ def test_dump_models(tmpdir: Path) -> None:
60686068
}
60696069
]
60706070
},
6071+
"ResponsesApiParams": {
6072+
"description": "Parameters for a Llama Stack Responses API request.\n\nAll fields accepted by the Llama Stack client responses.create() body are\nincluded so that dumped model can be passed directly to response create.",
6073+
"properties": {
6074+
"input": {
6075+
"$ref": "`#/components/schemas/`ResponseInput",
6076+
"description": "The input text or structured input items"
6077+
},
6078+
"model": {
6079+
"description": "The full model ID in format \"provider/model\"",
6080+
"title": "Model",
6081+
"type": "string"
6082+
},
6083+
"conversation": {
6084+
"description": "The conversation ID in llama-stack format",
6085+
"title": "Conversation",
6086+
"type": "string"
6087+
},
6088+
"include": {
6089+
"type": "array",
6090+
"nullable": true,
6091+
"default": null,
6092+
"description": "Output item types to include in the response",
6093+
"title": "Include"
6094+
},
6095+
"instructions": {
6096+
"type": "string",
6097+
"nullable": true,
6098+
"default": null,
6099+
"description": "The resolved system prompt",
6100+
"title": "Instructions"
6101+
},
6102+
"max_infer_iters": {
6103+
"type": "integer",
6104+
"nullable": true,
6105+
"default": null,
6106+
"description": "Maximum number of inference iterations",
6107+
"title": "Max Infer Iters"
6108+
},
6109+
"max_output_tokens": {
6110+
"type": "integer",
6111+
"nullable": true,
6112+
"default": null,
6113+
"description": "Maximum number of tokens allowed in the response",
6114+
"title": "Max Output Tokens"
6115+
},
6116+
"max_tool_calls": {
6117+
"type": "integer",
6118+
"nullable": true,
6119+
"default": null,
6120+
"description": "Maximum tool calls allowed in a single response",
6121+
"title": "Max Tool Calls"
6122+
},
6123+
"metadata": {
6124+
"type": "object",
6125+
"nullable": true,
6126+
"default": null,
6127+
"description": "Custom metadata for tracking or logging",
6128+
"title": "Metadata"
6129+
},
6130+
"parallel_tool_calls": {
6131+
"type": "boolean",
6132+
"nullable": true,
6133+
"default": null,
6134+
"description": "Whether the model can make multiple tool calls in parallel",
6135+
"title": "Parallel Tool Calls"
6136+
},
6137+
"previous_response_id": {
6138+
"type": "string",
6139+
"nullable": true,
6140+
"default": null,
6141+
"description": "Identifier of the previous response in a multi-turn conversation",
6142+
"title": "Previous Response Id"
6143+
},
6144+
"prompt": {
6145+
"anyOf": [
6146+
{
6147+
"$ref": "`#/components/schemas/`OpenAIResponsePrompt"
6148+
},
6149+
{
6150+
"type": "null"
6151+
}
6152+
],
6153+
"default": null,
6154+
"description": "Prompt template with variables for dynamic substitution"
6155+
},
6156+
"reasoning": {
6157+
"anyOf": [
6158+
{
6159+
"$ref": "`#/components/schemas/`OpenAIResponseReasoning"
6160+
},
6161+
{
6162+
"type": "null"
6163+
}
6164+
],
6165+
"default": null,
6166+
"description": "Reasoning configuration for the response"
6167+
},
6168+
"safety_identifier": {
6169+
"type": "string",
6170+
"nullable": true,
6171+
"default": null,
6172+
"description": "Stable identifier for safety monitoring and abuse detection",
6173+
"title": "Safety Identifier"
6174+
},
6175+
"store": {
6176+
"description": "Whether to store the response",
6177+
"title": "Store",
6178+
"type": "boolean"
6179+
},
6180+
"stream": {
6181+
"description": "Whether to stream the response",
6182+
"title": "Stream",
6183+
"type": "boolean"
6184+
},
6185+
"temperature": {
6186+
"type": "number",
6187+
"nullable": true,
6188+
"default": null,
6189+
"description": "Sampling temperature (e.g. 0.0-2.0)",
6190+
"title": "Temperature"
6191+
},
6192+
"text": {
6193+
"anyOf": [
6194+
{
6195+
"$ref": "`#/components/schemas/`OpenAIResponseText"
6196+
},
6197+
{
6198+
"type": "null"
6199+
}
6200+
],
6201+
"default": null,
6202+
"description": "Text response configuration (format constraints)"
6203+
},
6204+
"tool_choice": {
6205+
"anyOf": [
6206+
{
6207+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceMode"
6208+
},
6209+
{
6210+
"discriminator": {
6211+
"mapping": {
6212+
"allowed_tools": "`#/components/schemas/`OpenAIResponseInputToolChoiceAllowedTools",
6213+
"custom": "`#/components/schemas/`OpenAIResponseInputToolChoiceCustomTool",
6214+
"file_search": "`#/components/schemas/`OpenAIResponseInputToolChoiceFileSearch",
6215+
"function": "`#/components/schemas/`OpenAIResponseInputToolChoiceFunctionTool",
6216+
"mcp": "`#/components/schemas/`OpenAIResponseInputToolChoiceMCPTool",
6217+
"web_search": "`#/components/schemas/`OpenAIResponseInputToolChoiceWebSearch",
6218+
"web_search_2025_08_26": "`#/components/schemas/`OpenAIResponseInputToolChoiceWebSearch",
6219+
"web_search_preview": "`#/components/schemas/`OpenAIResponseInputToolChoiceWebSearch",
6220+
"web_search_preview_2025_03_11": "`#/components/schemas/`OpenAIResponseInputToolChoiceWebSearch"
6221+
},
6222+
"propertyName": "type"
6223+
},
6224+
"oneOf": [
6225+
{
6226+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceAllowedTools"
6227+
},
6228+
{
6229+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceFileSearch"
6230+
},
6231+
{
6232+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceWebSearch"
6233+
},
6234+
{
6235+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceFunctionTool"
6236+
},
6237+
{
6238+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceMCPTool"
6239+
},
6240+
{
6241+
"$ref": "`#/components/schemas/`OpenAIResponseInputToolChoiceCustomTool"
6242+
}
6243+
]
6244+
},
6245+
{
6246+
"type": "null"
6247+
}
6248+
],
6249+
"default": null,
6250+
"description": "Tool selection strategy",
6251+
"title": "Tool Choice"
6252+
},
6253+
"tools": {
6254+
"type": "array",
6255+
"nullable": true,
6256+
"default": null,
6257+
"description": "Prepared tool groups for Responses API (same type as ResponsesRequest.tools)",
6258+
"title": "Tools"
6259+
},
6260+
"extra_headers": {
6261+
"type": "object",
6262+
"nullable": true,
6263+
"default": null,
6264+
"description": "Extra HTTP headers to send with the request (e.g. x-llamastack-provider-data)",
6265+
"title": "Extra Headers"
6266+
},
6267+
"omit_conversation": {
6268+
"default": false,
6269+
"description": "When True, the conversation parameter is dropped from the request body while remaining on the object for identity. Set by conversation compaction (LCORE-1572): once a conversation is compacted, lightspeed-stack supplies explicit input and must not let Llama Stack reload the full history via the conversation parameter.",
6270+
"title": "Omit Conversation",
6271+
"type": "boolean"
6272+
}
6273+
},
6274+
"required": [
6275+
"input",
6276+
"model",
6277+
"conversation",
6278+
"store",
6279+
"stream"
6280+
],
6281+
"title": "ResponsesApiParams",
6282+
"type": "object"
6283+
},
60716284
"ResponsesRequest": {
60726285
"additionalProperties": false,
60736286
"description": "Model representing a request for the Responses API following LCORE specification.\n\nAttributes:\n input: Input text or structured input items containing the query.\n model: Model identifier in format \"provider/model\". Auto-selected if not provided.\n conversation: Conversation ID linking to an existing conversation. Accepts both\n OpenAI and LCORE formats. Mutually exclusive with previous_response_id.\n include: Explicitly specify output item types that are excluded by default but\n should be included in the response.\n instructions: System instructions or guidelines provided to the model (acts as\n the system prompt).\n max_infer_iters: Maximum number of inference iterations the model can perform.\n max_output_tokens: Maximum number of tokens allowed in the response.\n max_tool_calls: Maximum number of tool calls allowed in a single response.\n metadata: Custom metadata dictionary with key-value pairs for tracking or logging.\n parallel_tool_calls: Whether the model can make multiple tool calls in parallel.\n previous_response_id: Identifier of the previous response in a multi-turn\n conversation. Mutually exclusive with conversation.\n prompt: Prompt object containing a template with variables for dynamic\n substitution.\n reasoning: Reasoning configuration for the response.\n safety_identifier: Safety identifier for the response.\n store: Whether to store the response in conversation history. Defaults to True.\n stream: Whether to stream the response as it is generated. Defaults to False.\n temperature: Sampling temperature controlling randomness (typically 0.0\u20132.0).\n text: Text response configuration specifying output format constraints (JSON\n schema, JSON object, or plain text).\n tool_choice: Tool selection strategy (\"auto\", \"required\", \"none\", or specific\n tool configuration).\n tools: List of tools available to the model (file search, web search, function\n calls, MCP tools). Defaults to all tools available to the model.\n generate_topic_summary: LCORE-specific flag indicating whether to generate a\n topic summary for new conversations. Defaults to True.\n shield_ids: LCORE-specific list of safety shield IDs to apply. If None, all\n configured shields are used.\n solr: Optional Solr inline RAG options (mode, filters) or legacy filter-only dict.",
@@ -9050,6 +9263,7 @@ def test_dump_models(tmpdir: Path) -> None:
90509263
"RerankerConfiguration",
90519264
"ResponseInput",
90529265
"ResponseItem",
9266+
"ResponsesApiParams",
90539267
"ResponsesRequest",
90549268
"ResponsesResponse",
90559269
"RlsapiV1Attachment",

0 commit comments

Comments
 (0)