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

fix: bump jiter dep #1180

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 instructor/dsl/citation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseModel, Field, model_validator, ValidationInfo
from pydantic import BaseModel, Field, model_validator, ValidationInfo # type: ignore
from collections.abc import Generator


Expand Down
2 changes: 1 addition & 1 deletion instructor/dsl/iterable.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Optional, cast, ClassVar
from collections.abc import AsyncGenerator, Generator, Iterable

from pydantic import BaseModel, Field, create_model
from pydantic import BaseModel, Field, create_model # type: ignore

from instructor.function_calls import OpenAISchema
from instructor.mode import Mode
Expand Down
2 changes: 1 addition & 1 deletion instructor/dsl/maybe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseModel, Field, create_model
from pydantic import BaseModel, Field, create_model # type: ignore
from typing import Generic, Optional, TypeVar

T = TypeVar("T", bound=BaseModel)
Expand Down
2 changes: 1 addition & 1 deletion instructor/dsl/validators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Callable, Optional

from openai import OpenAI
from pydantic import Field
from pydantic import Field # type: ignore

from instructor.function_calls import OpenAISchema
from instructor.client import Instructor
Expand Down
6 changes: 3 additions & 3 deletions instructor/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from urllib.parse import urlparse
import mimetypes
import requests
from pydantic import BaseModel, Field

Check failure on line 21 in instructor/multimodal.py

View workflow job for this annotation

GitHub Actions / Pyright (ubuntu-latest, 3.11)

Type of "Field" is partially unknown   Type of "Field" is "Overload[(default: Unknown, *, alias: str | None = _Unset, alias_priority: int | None = _Unset, validation_alias: str | AliasPath | AliasChoices | None = _Unset, serialization_alias: str | None = _Unset, title: str | None = _Unset, field_title_generator: ((str, FieldInfo) -> str) | None = _Unset, description: str | None = _Unset, examples: list[Any] | None = _Unset, exclude: bool | None = _Unset, discriminator: str | Discriminator | None = _Unset, deprecated: deprecated | str | bool | None = _Unset, json_schema_extra: Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None] | ((Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None]) -> None) | None = _Unset, frozen: bool | None = _Unset, validate_default: bool | None = _Unset, repr: bool = _Unset, init: bool | None = _Unset, init_var: bool | None = _Unset, kw_only: bool | None = _Unset, pattern: str | Pattern[str] | None = _Unset, strict: bool | None = _Unset, coerce_numbers_to_str: bool | None = _Unset, gt: SupportsGt | None = _Unset, ge: SupportsGe | None = _Unset, lt: SupportsLt | None = _Unset, le: SupportsLe | None = _Unset, multiple_of: float | None = _Unset, allow_inf_nan: bool | None = _Unset, max_digits: int | None = _Unset, decimal_places: int | None = _Unset, min_length: int | None = _Unset, max_length: int | None = _Unset, union_mode: Literal['smart', 'left_to_right'] = _Unset, fail_fast: bool | None = _Unset, **extra: **_EmptyKwargs) -> Any, (default: _T@Field, *, alias: str | None = _Unset, alias_priority: int | None = _Unset, validation_alias: str | AliasPath | AliasChoices | None = _Unset, serialization_alias: str | None = _Unset, title: str | None = _Unset, field_title_generator: ((str, FieldInfo) -> str) | None = _Unset, description: str | None = _Unset, examples: list[Any] | None = _Unset, exclude: bool | None = _Unset, discriminator: str | Discriminator | None = _Unset, deprecated: deprecated | str | bool | None = _Unset, json_schema_extra: Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None] | ((Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None]) -> None) | None = _Unset, frozen: bool | None = _Unset, validate_default: bool | None = _Unset, repr: bool = _Unset, init: bool | None = _Unset, init_var: bool | None = _Unset, kw_only: bool | None = _Unset, pattern: str | Pattern[str] | None = _Unset, strict: bool | None = _Unset, coerce_numbers_to_str: bool | None = _Unset, gt: SupportsGt | None = _Unset, ge: SupportsGe | None = _Unset, lt: SupportsLt | None = _Unset, le: SupportsLe | None = _Unset, multiple_of: float | None = _Unset, allow_inf_nan: bool | None = _Unset, max_digits: int | None = _Unset, decimal_places: int | None = _Unset, min_length: int | None = _Unset, max_length: int | None = _Unset, union_mode: Literal['smart', 'left_to_right'] = _Unset, fail_fast: bool | None = _Unset, **extra: **_EmptyKwargs) -> _T@Field, (*, default_factory: (() -> _T@Field) | ((dict[str, Any]) -> _T@Field), alias: str | None = _Unset, alias_priority: int | None = _Unset, validation_alias: str | AliasPath | AliasChoices | None = _Unset, serialization_alias: str | None = _Unset, title: str | None = _Unset, field_title_generator: ((str, FieldInfo) -> str) | None = _Unset, description: str | None = _Unset, examples: list[Any] | None = _Unset, exclude: bool | None = _Unset, discriminator: str | Discriminator | None = _Unset, deprecated: deprecated | str | bool | None = _Unset, json_schema_extra: Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None] | ((Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None]) -> None) | None = _Unset, frozen: bool | None = _Unset, validate_default: bool | None = _Unset, repr: bool = _Unset, init: bool | None = _Unset, init_var: bool | None = _Unset, kw_only: bool | None = _Unset, pattern: str | Pattern[str] | None = _Unset, strict: bool | None = _Unset, coerce_numbers_to_str: bool | None = _Unset, gt: SupportsGt | None = _Unset, ge: SupportsGe | None = _Unset, lt: SupportsLt

Check failure on line 21 in instructor/multimodal.py

View workflow job for this annotation

GitHub Actions / Pyright (macos-latest, 3.11)

Type of "Field" is partially unknown   Type of "Field" is "Overload[(default: Unknown, *, alias: str | None = _Unset, alias_priority: int | None = _Unset, validation_alias: str | AliasPath | AliasChoices | None = _Unset, serialization_alias: str | None = _Unset, title: str | None = _Unset, field_title_generator: ((str, FieldInfo) -> str) | None = _Unset, description: str | None = _Unset, examples: list[Any] | None = _Unset, exclude: bool | None = _Unset, discriminator: str | Discriminator | None = _Unset, deprecated: deprecated | str | bool | None = _Unset, json_schema_extra: Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None] | ((Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None]) -> None) | None = _Unset, frozen: bool | None = _Unset, validate_default: bool | None = _Unset, repr: bool = _Unset, init: bool | None = _Unset, init_var: bool | None = _Unset, kw_only: bool | None = _Unset, pattern: str | Pattern[str] | None = _Unset, strict: bool | None = _Unset, coerce_numbers_to_str: bool | None = _Unset, gt: SupportsGt | None = _Unset, ge: SupportsGe | None = _Unset, lt: SupportsLt | None = _Unset, le: SupportsLe | None = _Unset, multiple_of: float | None = _Unset, allow_inf_nan: bool | None = _Unset, max_digits: int | None = _Unset, decimal_places: int | None = _Unset, min_length: int | None = _Unset, max_length: int | None = _Unset, union_mode: Literal['smart', 'left_to_right'] = _Unset, fail_fast: bool | None = _Unset, **extra: **_EmptyKwargs) -> Any, (default: _T@Field, *, alias: str | None = _Unset, alias_priority: int | None = _Unset, validation_alias: str | AliasPath | AliasChoices | None = _Unset, serialization_alias: str | None = _Unset, title: str | None = _Unset, field_title_generator: ((str, FieldInfo) -> str) | None = _Unset, description: str | None = _Unset, examples: list[Any] | None = _Unset, exclude: bool | None = _Unset, discriminator: str | Discriminator | None = _Unset, deprecated: deprecated | str | bool | None = _Unset, json_schema_extra: Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None] | ((Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None]) -> None) | None = _Unset, frozen: bool | None = _Unset, validate_default: bool | None = _Unset, repr: bool = _Unset, init: bool | None = _Unset, init_var: bool | None = _Unset, kw_only: bool | None = _Unset, pattern: str | Pattern[str] | None = _Unset, strict: bool | None = _Unset, coerce_numbers_to_str: bool | None = _Unset, gt: SupportsGt | None = _Unset, ge: SupportsGe | None = _Unset, lt: SupportsLt | None = _Unset, le: SupportsLe | None = _Unset, multiple_of: float | None = _Unset, allow_inf_nan: bool | None = _Unset, max_digits: int | None = _Unset, decimal_places: int | None = _Unset, min_length: int | None = _Unset, max_length: int | None = _Unset, union_mode: Literal['smart', 'left_to_right'] = _Unset, fail_fast: bool | None = _Unset, **extra: **_EmptyKwargs) -> _T@Field, (*, default_factory: (() -> _T@Field) | ((dict[str, Any]) -> _T@Field), alias: str | None = _Unset, alias_priority: int | None = _Unset, validation_alias: str | AliasPath | AliasChoices | None = _Unset, serialization_alias: str | None = _Unset, title: str | None = _Unset, field_title_generator: ((str, FieldInfo) -> str) | None = _Unset, description: str | None = _Unset, examples: list[Any] | None = _Unset, exclude: bool | None = _Unset, discriminator: str | Discriminator | None = _Unset, deprecated: deprecated | str | bool | None = _Unset, json_schema_extra: Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None] | ((Dict[str, int | float | str | bool | List[JsonValue] | JsonDict | None]) -> None) | None = _Unset, frozen: bool | None = _Unset, validate_default: bool | None = _Unset, repr: bool = _Unset, init: bool | None = _Unset, init_var: bool | None = _Unset, kw_only: bool | None = _Unset, pattern: str | Pattern[str] | None = _Unset, strict: bool | None = _Unset, coerce_numbers_to_str: bool | None = _Unset, gt: SupportsGt | None = _Unset, ge: SupportsGe | None = _Unset, lt: SupportsLt
from .mode import Mode

F = TypeVar("F", bound=Callable[..., Any])
Expand All @@ -43,9 +43,9 @@

class Image(BaseModel):
source: Union[str, Path] = Field( # noqa: UP007
..., description="URL, file path, or base64 data of the image"
description="URL, file path, or base64 data of the image"
)
media_type: str = Field(..., description="MIME type of the image")
media_type: str = Field(description="MIME type of the image")
data: Union[str, None] = Field( # noqa: UP007
None, description="Base64 encoded image data", repr=False
)
Expand Down Expand Up @@ -208,7 +208,7 @@
class Audio(BaseModel):
"""Represents an audio that can be loaded from a URL or file path."""

source: Union[str, Path] = Field(..., description="URL or file path of the audio") # noqa: UP007
source: Union[str, Path] = Field(description="URL or file path of the audio") # noqa: UP007
data: Union[str, None] = Field( # noqa: UP007
None, description="Base64 encoded audio data", repr=False
)
Expand Down
2,035 changes: 1,032 additions & 1,003 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rich = "^13.7.0"
aiohttp = "^3.9.1"
tenacity = ">=9.0.0,<10.0.0"
pydantic-core = "^2.18.0"
jiter = ">=0.5,<0.7"
jiter = ">=0.6.1,<0.7"
jinja2 = "^3.1.4"
requests = "^2.32.3"

Expand Down
Loading