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

Update pydantic version & fix mypy errors #4811

Merged
merged 6 commits into from
Dec 27, 2024
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
2 changes: 1 addition & 1 deletion python/packages/autogen-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"aioconsole>=0.8.1",
"aiohttp>=3.10.10",
"typing-extensions",
"pydantic<3.0.0,>=2.0.0",
"pydantic<3.0.0,>=2.10.0",
"protobuf~=4.25.1",
"tiktoken>=0.8.0",
"opentelemetry-api~=1.27.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from autogen_core import ComponentModel
from autogen_core.models import ModelCapabilities
from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel
from typing_extensions import Required, TypedDict

from .._azure_token_provider import AzureTokenProvider
Expand Down Expand Up @@ -79,9 +79,6 @@ class CreateArgumentsConfigModel(BaseModel):


class BaseOpenAIClientConfigurationConfigModel(CreateArgumentsConfigModel):
# To allow `model_capabilities` field without triggering pydantic warnings.
model_config = ConfigDict(protected_namespaces=())

model: str
api_key: str | None = None
timeout: float | None = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def build_specific_component_schema(component: type[ComponentConfigImpl[T]], pro
return component_model_schema


def main():
def main() -> None:
outer_model_schema: Dict[str, Any] = {
"type": "object",
"$ref": "#/$defs/ComponentModel",
Expand All @@ -69,7 +69,7 @@ def main():
for key, value in WELL_KNOWN_PROVIDERS.items():
reverse_provider_lookup_table[value].append(key)

def add_type(type: type[ComponentConfigImpl[T]]):
def add_type(type: type[ComponentConfigImpl[T]]) -> None:
canonical = type.component_provider_override or _type_to_provider_str(type)
reverse_provider_lookup_table[canonical].append(canonical)
for provider_str in reverse_provider_lookup_table[canonical]:
Expand Down
Loading
Loading