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

rename provider to provider_id in MUX api #819

Merged
merged 1 commit into from
Jan 29, 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
5 changes: 3 additions & 2 deletions src/codegate/api/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,14 @@ async def get_workspace_muxes(
# implementation that fetches the mux rules from the database.
return [
v1_models.MuxRule(
provider="openai",
# Hardcode some UUID just for mocking purposes
provider_id="00000000-0000-0000-0000-000000000001",
model="gpt-3.5-turbo",
matcher_type=v1_models.MuxMatcherType.file_regex,
matcher=".*\\.txt",
),
v1_models.MuxRule(
provider="anthropic",
provider_id="00000000-0000-0000-0000-000000000002",
model="davinci",
matcher_type=v1_models.MuxMatcherType.catch_all,
),
Expand Down
4 changes: 2 additions & 2 deletions src/codegate/api/v1_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ class MuxRule(pydantic.BaseModel):
Represents a mux rule for a provider.
"""

provider: str
provider_id: str
model: str
# The type of matcher to use
matcher_type: MuxMatcherType
# The actual matcher to use. Note that
# this depends on the matcher type.
matcher: Optional[str]
matcher: Optional[str] = None