-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump pydantic to 2.8.2 * Run pydantic-bump * More updates * Fix openapi generation * Fix tests * black formatting * Fix integration tests
- Loading branch information
Showing
44 changed files
with
373 additions
and
343 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
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,17 @@ | ||
from pydantic import BaseModel, BeforeValidator, ConfigDict, HttpUrl, TypeAdapter | ||
from typing_extensions import Annotated | ||
|
||
# See: https://github.com/pydantic/pydantic/issues/7186 | ||
# pydantic v2 doesn't treat HttpUrl the same way as in v1 which causes various issue | ||
# This is an attempt to make it behave as similar as possible | ||
HttpUrlTypeAdapter = TypeAdapter(HttpUrl) | ||
HttpUrlStr = Annotated[ | ||
str, | ||
BeforeValidator(lambda value: HttpUrlTypeAdapter.validate_python(value) and value), | ||
] | ||
|
||
|
||
class LLMEngineModel(BaseModel): | ||
"""Common pydantic configurations for model engine""" | ||
|
||
model_config = ConfigDict(protected_namespaces=()) |
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
Oops, something went wrong.