You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
max_tokens: int=Field(default=4096, description="Maximum tokens for the response")
396
406
include: ReflectIncludeOptions=Field(
397
407
default_factory=ReflectIncludeOptions, description="Options for including additional data (disabled by default)"
398
408
)
409
+
response_schema: dict|None=Field(
410
+
default=None,
411
+
description="Optional JSON Schema for structured output. When provided, the response will include a 'structured_output' field with the LLM response parsed according to this schema.",
412
+
)
399
413
400
414
401
415
classOpinionItem(BaseModel):
@@ -440,12 +454,20 @@ class ReflectResponse(BaseModel):
440
454
{"id": "123", "text": "AI is used in healthcare", "type": "world"},
441
455
{"id": "456", "text": "I discussed AI applications last week", "type": "experience"},
442
456
],
457
+
"structured_output": {
458
+
"summary": "AI is transformative",
459
+
"key_points": ["Used in healthcare", "Discussed recently"],
460
+
},
443
461
}
444
462
}
445
463
)
446
464
447
465
text: str
448
466
based_on: list[ReflectFact] = [] # Facts used to generate the response
467
+
structured_output: dict|None=Field(
468
+
default=None,
469
+
description="Structured output parsed according to the request's response_schema. Only present when response_schema was provided in the request.",
0 commit comments