16 lines
480 B
Python
16 lines
480 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="1-3 simplified sub-questions, each focused on one aspect並總格成以下格式 '標籤式主題: 具體提問/要求' ",
|
|
min_length=1,
|
|
max_length=3,
|
|
)
|