数据导入schema分析功能接口和测试用例
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
|
||||
|
||||
class LLMRole(str, Enum):
|
||||
@ -90,3 +90,46 @@ class DataImportAnalysisRequest(BaseModel):
|
||||
class DataImportAnalysisResponse(BaseModel):
|
||||
import_record_id: str
|
||||
llm_response: LLMResponse
|
||||
|
||||
|
||||
class DataImportAnalysisJobRequest(BaseModel):
|
||||
import_record_id: str = Field(
|
||||
..., description="Unique identifier for this import request run."
|
||||
)
|
||||
rows: List[Union[Dict[str, Any], List[Any]]] = Field(
|
||||
...,
|
||||
description="Sample rows from the import payload. Accepts list of dicts or list of lists.",
|
||||
)
|
||||
headers: Optional[List[str]] = Field(
|
||||
None,
|
||||
description="Ordered list of table headers associated with the data sample.",
|
||||
)
|
||||
raw_csv: Optional[str] = Field(
|
||||
None,
|
||||
description="Optional raw CSV representation of the sample rows, if already prepared.",
|
||||
)
|
||||
table_schema: Optional[Any] = Field(
|
||||
None,
|
||||
description="Optional schema description for the table. Can be a string or JSON-serialisable structure.",
|
||||
)
|
||||
callback_url: HttpUrl = Field(
|
||||
...,
|
||||
description="URL to notify when the analysis completes. Receives JSON payload with status/results.",
|
||||
)
|
||||
llm_model: str = Field(
|
||||
"gpt-4.1-mini",
|
||||
description="Target LLM model identifier. Defaults to gpt-4.1-mini.",
|
||||
)
|
||||
temperature: Optional[float] = Field(
|
||||
None,
|
||||
description="Optional override for model temperature when generating analysis output.",
|
||||
)
|
||||
max_output_tokens: Optional[int] = Field(
|
||||
None,
|
||||
description="Optional maximum number of tokens to generate in the analysis response.",
|
||||
)
|
||||
|
||||
|
||||
class DataImportAnalysisJobAck(BaseModel):
|
||||
import_record_id: str = Field(..., description="Echo of the import record identifier")
|
||||
status: str = Field("accepted", description="Processing status acknowledgement.")
|
||||
|
||||
Reference in New Issue
Block a user