Declarative Agent YAML: outputSchema loses nested object and array item properties in generated ResponseFormat #7614
|
Hi, I’m running into an issue with Agent Framework declarative agent YAML when using nested objects and arrays in After creating the agent with: ChatClientPromptAgentFactory.CreateFromYamlAsync(yaml)the generated Agent YAMLkind: prompt
name: AssistantAgent
description: Helpful assistant
instructions: "You are a helpful assistant"
model:
id: gpt-5.6-luna
outputSchema:
type: object
properties:
rationale:
type: record
required: true
properties:
test:
type: string
test2:
type: string
results:
type: table
properties:
id:
type: string
value:
type: stringActual generated ResponseFormat{
"type": "object",
"properties": {
"rationale": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": false
}
}
},
"additionalProperties": false
}Expected behaviorI would expect the generated {
"type": "object",
"properties": {
"rationale": {
"type": "object",
"properties": {
"test": {
"type": "string"
},
"test2": {
"type": "string"
}
},
"additionalProperties": false
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}QuestionIs this currently a limitation/bug in the YAML-to-
In short: how should sub-objects and arrays be defined in declarative agent YAML so their properties survive into the generated Thanks. |
Replies: 1 comment
|
The nested fields need to be part of the structured This shape preserves the children: outputSchema:
type: object
properties:
rationale:
type:
kind: record
properties:
test:
type: string
test2:
type: string
required: true
results:
type:
kind: table
properties:
id:
type: string
value:
type: string
That also matches the current conversion path: |
The nested fields need to be part of the structured
typevalue. With the scalar shorthandtype: record/type: table, the YAML reader creates aRecordDataType/TableDataTypewith an emptyPropertiescollection; the siblingpropertiesmapping is not used to populate that data type.This shape preserves the children:
tableis the objec…