-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small refactor to be able to have typing and make the code more readable
- Loading branch information
1 parent
0d9396c
commit 8da7955
Showing
4 changed files
with
49 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from enum import Enum | ||
from typing import Optional | ||
|
||
import pydantic | ||
|
||
|
||
class MuxMatcherType(str, Enum): | ||
""" | ||
Represents the different types of matchers we support. | ||
""" | ||
|
||
# Always match this prompt | ||
catch_all = "catch_all" | ||
|
||
|
||
class MuxRule(pydantic.BaseModel): | ||
""" | ||
Represents a mux rule for a provider. | ||
""" | ||
|
||
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] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters