-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add LLMOptions merge (#29)
- Loading branch information
Showing
7 changed files
with
90 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from typing_extensions import Literal, override | ||
|
||
|
||
# Sentinel class used until PEP 0661 is accepted | ||
class NotGiven: | ||
""" | ||
A sentinel singleton class used to distinguish omitted keyword arguments | ||
from those passed in with the value None (which may have different behavior). | ||
For example: | ||
```py | ||
def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: | ||
... | ||
get(timeout=1) # 1s timeout | ||
get(timeout=None) # No timeout | ||
get() # Default timeout behavior, which may not be statically known at the method definition. | ||
``` | ||
""" | ||
|
||
def __bool__(self) -> Literal[False]: | ||
return False | ||
|
||
@override | ||
def __repr__(self) -> str: | ||
return "NOT_GIVEN" | ||
|
||
|
||
NOT_GIVEN = NotGiven() |
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
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