-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate.py
More file actions
66 lines (51 loc) · 1.68 KB
/
Copy pathstate.py
File metadata and controls
66 lines (51 loc) · 1.68 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
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
from typing import Annotated, Literal
from typing_extensions import TypedDict
from pydantic import BaseModel, Field
from langgraph.graph.message import add_messages
class Intent(BaseModel):
project_name : str
features : list[str]
class Design(BaseModel):
pages : list[str]
entities : list[str]
endpoints : list[str]
class entity(BaseModel):
name : str
components : list[str]
class UI(BaseModel):
ui_schema : list[entity]
class endpoint(BaseModel):
path : str
method : Literal["/GET","/POST","/PUT","/PATCH","/DELETE"]
class API(BaseModel):
endpoints : list[endpoint]
class Attribute(BaseModel):
name: str = Field(description="Name of the column/attribute")
type: str = Field(description="SQL data type (e.g. VARCHAR, UUID)")
constraints: str = Field(description="Constraints like PRIMARY KEY, UNIQUE, NOT NULL", default="")
class table(BaseModel):
name: str = Field(description="Name of the table")
attributes : list[Attribute]
class DB(BaseModel):
tables : list[table]
class error(BaseModel):
type : str
field : str
message : str
class Validation(BaseModel):
is_valid : bool
errors : list[error]
class GeneratedFile(BaseModel):
filepath: str = Field(description="Relative path of the file, e.g. 'server.js' or 'src/App.js'")
content: str = Field(description="The complete code content of the file")
class Generation(BaseModel):
files: list[GeneratedFile]
class State(TypedDict):
query : Annotated[list,add_messages]
intent : Intent | None
design : Design | None
ui : UI | None
api : API | None
db : DB | None
validation : Validation | None
generation : Generation | None