Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 7cc918b

Browse files
authored
Add schema for passing full workspace config to CREATE workspace API (#1086)
This adds an optional full workspace definition so we can take exported workspaces into use. Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
1 parent cd3de72 commit 7cc918b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/codegate/api/v1_models.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pydantic
77

8+
import codegate.muxing.models as mux_models
89
from codegate.db import models as db_models
910
from codegate.extract_snippets.message_extractor import CodeSnippet
1011
from codegate.providers.base import BaseProvider
@@ -59,9 +60,19 @@ def from_db_workspaces(
5960
)
6061

6162

62-
class CreateOrRenameWorkspaceRequest(pydantic.BaseModel):
63+
class WorkspaceConfig(pydantic.BaseModel):
64+
system_prompt: str
65+
66+
muxing_rules: List[mux_models.MuxRule]
67+
68+
69+
class FullWorkspace(pydantic.BaseModel):
6370
name: str
6471

72+
config: Optional[WorkspaceConfig] = None
73+
74+
75+
class CreateOrRenameWorkspaceRequest(FullWorkspace):
6576
# If set, rename the workspace to this name. Note that
6677
# the 'name' field is still required and the workspace
6778
# workspace must exist.

src/codegate/muxing/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class MuxRule(pydantic.BaseModel):
2626
Represents a mux rule for a provider.
2727
"""
2828

29+
# Used for exportable workspaces
30+
provider_name: Optional[str] = None
2931
provider_id: str
3032
model: str
3133
# The type of matcher to use

0 commit comments

Comments
 (0)