Skip to content

Commit

Permalink
Update pydantic version & fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
srjoglekar246 committed Dec 26, 2024
1 parent 0040016 commit d29cca5
Show file tree
Hide file tree
Showing 4 changed files with 1,008 additions and 1,380 deletions.
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

0 comments on commit d29cca5

Please sign in to comment.