File tree Expand file tree Collapse file tree 5 files changed +31
-2
lines changed Expand file tree Collapse file tree 5 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ from fastapi import APIRouter
2
+ from fastapi .routing import APIRoute
3
+
4
+ v1 = APIRouter ()
5
+
6
+
7
+ def uniq_name (route : APIRoute ):
8
+ return f"v1_{ route .name } "
9
+
10
+
11
+ @v1 .get ("/workspaces" , tags = ["Workspaces" ], generate_unique_id_function = uniq_name )
12
+ async def list_workspaces ():
13
+ raise NotImplementedError
14
+
15
+ @v1 .post ("/workspaces" , tags = ["Workspaces" ], generate_unique_id_function = uniq_name )
16
+ async def create_workspace ():
17
+ raise NotImplementedError
18
+
19
+ @v1 .get ("/workspaces/{workspace_name}" , tags = ["Workspaces" ], generate_unique_id_function = uniq_name )
20
+ async def get_workspace (workspace_name : str ):
21
+ raise NotImplementedError
22
+
23
+ @v1 .delete ("/workspaces/{workspace_name}" , tags = ["Workspaces" ],
24
+ generate_unique_id_function = uniq_name )
25
+ async def delete_workspace (workspace_name : str ):
26
+ raise NotImplementedError
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def extract_snippets(message: str) -> List[CodeSnippet]:
127
127
lang_map = {
128
128
"typescript" : "javascript"
129
129
}
130
- lang = lang_map .get (lang , lang )
130
+ lang = lang_map .get (lang , lang )
131
131
snippets .append (CodeSnippet (filepath = filename , code = content , language = lang ))
132
132
133
133
return snippets
Original file line number Diff line number Diff line change 1
- import json
2
1
from typing import AsyncIterator , Optional , Union
3
2
4
3
import structlog
Original file line number Diff line number Diff line change 7
7
from starlette .middleware .errors import ServerErrorMiddleware
8
8
9
9
from codegate import __description__ , __version__
10
+ from codegate .api .v1 import v1
10
11
from codegate .dashboard .dashboard import dashboard_router
11
12
from codegate .pipeline .factory import PipelineFactory
12
13
from codegate .providers .anthropic .provider import AnthropicProvider
@@ -97,4 +98,7 @@ async def health_check():
97
98
app .include_router (system_router )
98
99
app .include_router (dashboard_router )
99
100
101
+ # CodeGate API
102
+ app .include_router (v1 , prefix = "/api/v1" , tags = ["CodeGate API" ])
103
+
100
104
return app
You can’t perform that action at this time.
0 commit comments