-
-
Notifications
You must be signed in to change notification settings - Fork 749
Expand file tree
/
Copy pathschemas.py
More file actions
27 lines (22 loc) · 1.01 KB
/
Copy pathschemas.py
File metadata and controls
27 lines (22 loc) · 1.01 KB
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
# src/codegraphcontext/api/schemas.py
from pydantic import BaseModel, Field
from typing import Dict, Any, List, Optional
class IndexRequest(BaseModel):
path: str = Field(..., description="Local path to the repository or file to index")
repo_name: Optional[str] = Field(None, description="Optional name for the repository")
branch: str = "main"
force: bool = False
class QueryRequest(BaseModel):
query: str = Field(..., description="Cypher query to execute")
params: Dict[str, Any] = Field(default_factory=dict, description="Parameters for the query")
class SearchRequest(BaseModel):
query: str = Field(..., description="Search query")
top_k: int = 10
class ToolCallRequest(BaseModel):
name: str = Field(..., description="Name of the MCP tool to call")
arguments: Dict[str, Any] = Field(default_factory=dict, description="Arguments for the tool")
class ApiResponse(BaseModel):
status: str
message: Optional[str] = None
data: Optional[Any] = None
error: Optional[str] = None