97e91a83f3
Ruff / Ruff (push) Waiting to run
Test / Core Tests (push) Waiting to run
Test / Offline Coverage Tests (Python 3.10) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.11) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.12) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.13) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.9) (push) Waiting to run
Test / Full Coverage (Python 3.11) (push) Waiting to run
Test / Core Provider Tests (OpenAI) (push) Blocked by required conditions
Test / Core Provider Tests (Anthropic) (push) Blocked by required conditions
Test / Core Provider Tests (Google) (push) Blocked by required conditions
Test / Core Provider Tests (Other) (push) Blocked by required conditions
Test / Anthropic Tests (push) Blocked by required conditions
Test / Gemini Tests (push) Blocked by required conditions
Test / Google GenAI Tests (push) Blocked by required conditions
Test / Vertex AI Tests (push) Blocked by required conditions
Test / OpenAI Tests (push) Blocked by required conditions
Test / Writer Tests (push) Blocked by required conditions
Test / Auto Client Tests (push) Blocked by required conditions
ty / type-check (push) Waiting to run
50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
from __future__ import annotations
|
|
|
|
from typing_extensions import assert_type
|
|
|
|
import openai
|
|
from pydantic import BaseModel
|
|
|
|
from instructor import (
|
|
AsyncInstructor,
|
|
Instructor,
|
|
Maybe,
|
|
Partial,
|
|
from_anyscale,
|
|
from_databricks,
|
|
from_deepseek,
|
|
from_openai,
|
|
from_provider,
|
|
from_together,
|
|
response_schema,
|
|
)
|
|
from instructor.v2.dsl.maybe import MaybeBase
|
|
|
|
|
|
class User(BaseModel):
|
|
name: str
|
|
|
|
|
|
def check_public_factories(
|
|
sync_client: openai.OpenAI,
|
|
async_client: openai.AsyncOpenAI,
|
|
) -> None:
|
|
assert_type(from_openai(sync_client), Instructor)
|
|
assert_type(from_openai(async_client), AsyncInstructor)
|
|
assert_type(from_anyscale("model"), Instructor)
|
|
assert_type(from_anyscale("model", async_client=True), AsyncInstructor)
|
|
assert_type(from_together("model"), Instructor)
|
|
assert_type(from_together("model", async_client=True), AsyncInstructor)
|
|
assert_type(from_databricks("model"), Instructor)
|
|
assert_type(from_databricks("model", async_client=True), AsyncInstructor)
|
|
assert_type(from_deepseek("model"), Instructor)
|
|
assert_type(from_deepseek("model", async_client=True), AsyncInstructor)
|
|
assert_type(from_provider("openai/gpt-4o-mini"), Instructor)
|
|
assert_type(from_provider("openai/gpt-4o-mini", async_client=True), AsyncInstructor)
|
|
|
|
|
|
def check_public_model_helpers() -> None:
|
|
assert_type(response_schema(User), type[User])
|
|
assert_type(Maybe(User), type[MaybeBase[User]])
|
|
assert_type(Partial[User], type[User])
|