Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema for passing full workspace config to CREATE workspace API #1086

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/codegate/api/v1_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import pydantic

import codegate.muxing.models as mux_models
from codegate.db import models as db_models
from codegate.extract_snippets.message_extractor import CodeSnippet
from codegate.providers.base import BaseProvider
Expand Down Expand Up @@ -59,9 +60,19 @@ def from_db_workspaces(
)


class CreateOrRenameWorkspaceRequest(pydantic.BaseModel):
class WorkspaceConfig(pydantic.BaseModel):
system_prompt: str

muxing_rules: List[mux_models.MuxRule]


class FullWorkspace(pydantic.BaseModel):
name: str

config: Optional[WorkspaceConfig] = None


class CreateOrRenameWorkspaceRequest(FullWorkspace):
# If set, rename the workspace to this name. Note that
# the 'name' field is still required and the workspace
# workspace must exist.
Expand Down
2 changes: 2 additions & 0 deletions src/codegate/muxing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class MuxRule(pydantic.BaseModel):
Represents a mux rule for a provider.
"""

# Used for exportable workspaces
provider_name: Optional[str] = None
provider_id: str
model: str
# The type of matcher to use
Expand Down