chore: fix all ruff lint errors + format — 0 errors, 306 tests pass
This commit is contained in:
@@ -7,6 +7,7 @@ from pydantic import BaseModel, Field
|
||||
|
||||
class CopilotQueryRequest(BaseModel):
|
||||
"""Natural language query to the AI copilot."""
|
||||
|
||||
query: str = Field(..., min_length=1, max_length=2000)
|
||||
conversation_id: str | None = None
|
||||
context: dict = Field(default_factory=dict)
|
||||
@@ -14,6 +15,7 @@ class CopilotQueryRequest(BaseModel):
|
||||
|
||||
class CopilotAction(BaseModel):
|
||||
"""A proposed API action derived from NL input."""
|
||||
|
||||
method: str = Field(..., pattern="^(GET|POST|PATCH|DELETE)$")
|
||||
path: str = Field(..., min_length=1)
|
||||
body: dict | None = None
|
||||
@@ -23,6 +25,7 @@ class CopilotAction(BaseModel):
|
||||
|
||||
class CopilotQueryResponse(BaseModel):
|
||||
"""Response from copilot query — proposed actions for user confirmation."""
|
||||
|
||||
conversation_id: str
|
||||
message: str
|
||||
proposed_actions: list[CopilotAction] = Field(default_factory=list)
|
||||
@@ -30,12 +33,14 @@ class CopilotQueryResponse(BaseModel):
|
||||
|
||||
class CopilotExecuteRequest(BaseModel):
|
||||
"""Execute a proposed action after user confirmation."""
|
||||
|
||||
conversation_id: str
|
||||
action: CopilotAction
|
||||
|
||||
|
||||
class CopilotExecuteResponse(BaseModel):
|
||||
"""Result of executing a proposed action."""
|
||||
|
||||
conversation_id: str
|
||||
success: bool
|
||||
status_code: int
|
||||
@@ -45,6 +50,7 @@ class CopilotExecuteResponse(BaseModel):
|
||||
|
||||
class CopilotMessageResponse(BaseModel):
|
||||
"""A single message in conversation history."""
|
||||
|
||||
id: str
|
||||
role: str
|
||||
content: str
|
||||
@@ -56,6 +62,7 @@ class CopilotMessageResponse(BaseModel):
|
||||
|
||||
class CopilotHistoryResponse(BaseModel):
|
||||
"""Paginated conversation history."""
|
||||
|
||||
items: list[CopilotMessageResponse]
|
||||
total: int
|
||||
page: int
|
||||
|
||||
Reference in New Issue
Block a user