File size: 871 Bytes
b3b0ccd
 
 
 
 
 
 
 
 
 
 
 
45b0535
 
 
 
 
 
 
 
b3b0ccd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from typing import List
from pydantic import BaseModel, Field

class QueryAnalysis(BaseModel):
    is_clear: bool = Field(
        description="Indicates if the user's question is clear and answerable."
    )
    questions: List[str] = Field(
        description="List of rewritten, self-contained questions."
    )
    clarification_needed: str = Field(
        description="Explanation if the question is unclear."
    )
    starts_new_query: bool = Field(
        default=False,
        description="True if the latest message starts a separate request instead of answering the pending clarification."
    )
    is_document_listing: bool = Field(
        default=False,
        description="True only when asking which uploaded documents are available, whether any are available, or to list the app's document library. Not for questions about document contents."
    )