16 lines
416 B
Python
16 lines
416 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SubQuestions(BaseModel):
|
|
"""Structured output model for query decomposition.
|
|
|
|
Used with LangChain's with_structured_output() to guarantee
|
|
the LLM returns a valid list of sub-questions.
|
|
"""
|
|
|
|
questions: list[str] = Field(
|
|
description="2-5 simplified sub-questions, each focused on one aspect",
|
|
min_length=1,
|
|
max_length=5,
|
|
)
|