responseSchema property

Map<String, dynamic>? responseSchema
final

Output response schema of the generated candidate text. Following the JSON Schema specification.

Note: This only applies when the responseMimeType supports a schema; currently this is limited to application/json.

Example:

{
  'type': 'object',
  'properties': {
    'answer': {
      'type': 'string',
      'description': 'The answer to the question being asked',
    },
    'sources': {
      'type': 'array',
      'items': {'type': 'string'},
      'description': 'The sources used to answer the question',
    },
  },
  'required': ['answer', 'sources'],
}

Implementation

final Map<String, dynamic>? responseSchema;