File size: 2,674 Bytes
1f2d50a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"""Response models for KGraph-MCP API."""

from datetime import datetime

from pydantic import BaseModel, Field


class HealthResponse(BaseModel):
    """Health check response model."""

    status: str = Field(description="Service status")
    version: str = Field(description="Application version")
    environment: str = Field(description="Environment name")
    timestamp: datetime = Field(description="Health check timestamp")


class TaskResponse(BaseModel):
    """Task response model."""

    id: int = Field(description="Task ID")
    title: str = Field(description="Task title")
    description: str = Field(description="Task description")
    status: str = Field(description="Task status")
    dependencies: list[int] = Field(description="Task dependencies")


class ToolSuggestionResponse(BaseModel):
    """Tool suggestion response model."""

    tool_id: str = Field(description="Tool identifier")
    name: str = Field(description="Tool name")
    description: str = Field(description="Tool description")
    tags: list[str] = Field(description="Tool tags")
    invocation_command_stub: str = Field(description="Tool invocation command")


class PromptInfo(BaseModel):
    """Prompt information within a planned step."""

    prompt_id: str = Field(description="Prompt identifier")
    name: str = Field(description="Prompt name")
    description: str = Field(description="Prompt description")
    template_string: str = Field(description="Prompt template with variables")
    difficulty_level: str = Field(description="Prompt difficulty level")
    input_variables: list[str] = Field(description="Required input variables")


class PlannedStepResponse(BaseModel):
    """Planned step response model combining tool and prompt."""

    tool: ToolSuggestionResponse = Field(description="Selected tool information")
    prompt: PromptInfo = Field(description="Selected prompt information")
    relevance_score: float | None = Field(
        description="Relevance score for this combination"
    )
    summary: str = Field(description="Human-readable summary of this planned step")


class PlanResponse(BaseModel):
    """Plan generation response model."""

    query: str = Field(description="Original user query")
    planned_steps: list[PlannedStepResponse] = Field(
        description="List of planned steps"
    )
    total_steps: int = Field(description="Total number of planned steps")


class ErrorResponse(BaseModel):
    """Error response model."""

    error: str = Field(description="Error message")
    detail: str | None = Field(default=None, description="Error details")
    error_code: str | None = Field(default=None, description="Error code")