SYMBOL INDEX (1910 symbols across 307 files) FILE: docs/hooks/hide_lines.py function on_startup (line 8) | def on_startup(command: str, dirty: bool) -> None: # noqa: ARG001 FILE: examples/anthropic-web-tool/run.py class Citation (line 13) | class Citation(BaseModel): class Response (line 18) | class Response(BaseModel): FILE: examples/anthropic/run.py class Properties (line 9) | class Properties(BaseModel): class User (line 14) | class User(BaseModel): FILE: examples/asyncio-benchmarks/run.py class Person (line 33) | class Person(BaseModel): method validate_age (line 40) | def validate_age(cls, v): function extract_person (line 58) | async def extract_person(text: str) -> Person: function sequential_processing (line 68) | async def sequential_processing() -> tuple[list[Person], float]: function gather_processing (line 85) | async def gather_processing() -> tuple[list[Person], float]: function as_completed_processing (line 107) | async def as_completed_processing() -> tuple[list[Person], float]: function rate_limited_extract_person (line 128) | async def rate_limited_extract_person( function rate_limited_gather (line 136) | async def rate_limited_gather(concurrency_limit: int = 3) -> tuple[list[... function rate_limited_as_completed (line 157) | async def rate_limited_as_completed( function robust_gather_processing (line 185) | async def robust_gather_processing() -> tuple[list[Person], float]: function timeout_gather_processing (line 206) | async def timeout_gather_processing( function progress_tracking_processing (line 230) | async def progress_tracking_processing() -> tuple[list[Person], float]: function chunked_processing (line 253) | async def chunked_processing(chunk_size: int = 3) -> tuple[list[Person],... function benchmark_all_methods (line 273) | async def benchmark_all_methods(): function sync_example (line 359) | def sync_example(): function main (line 382) | async def main(): FILE: examples/auto-ticketer/run.py class PriorityEnum (line 11) | class PriorityEnum(str, Enum): class Subtask (line 17) | class Subtask(BaseModel): class Ticket (line 26) | class Ticket(BaseModel): class ActionItems (line 44) | class ActionItems(BaseModel): function generate (line 52) | def generate(data: str): FILE: examples/automodel/run.py class UserInfo (line 14) | class UserInfo(BaseModel): function test_async_client (line 22) | async def test_async_client( function test_sync_client (line 44) | def test_sync_client(client_name: str, client: instructor.Instructor) ->... function main (line 61) | async def main(): FILE: examples/avail/run.py class DateRange (line 12) | class DateRange(BaseModel): class AvailabilityResponse (line 44) | class AvailabilityResponse(BaseModel): function prepare_dates (line 48) | def prepare_dates(n=7) -> str: function parse_availability (line 63) | def parse_availability(text: str) -> Iterable[AvailabilityResponse]: FILE: examples/avail/run_mixtral.py class DateRange (line 19) | class DateRange(BaseModel): class AvailabilityResponse (line 51) | class AvailabilityResponse(BaseModel): function prepare_dates (line 55) | def prepare_dates(n=7) -> str: function parse_availability (line 70) | def parse_availability(text: str): FILE: examples/batch-classification/run-cache.py class QuestionType (line 12) | class QuestionType(Enum): class QuestionClassification (line 24) | class QuestionClassification(BaseModel): method validate_classification (line 47) | def validate_classification(cls, v): function classify (line 55) | async def classify(data: str): function main (line 70) | async def main(questions: list[str]): FILE: examples/batch-classification/run.py class QuestionType (line 14) | class QuestionType(Enum): class QuestionClassification (line 26) | class QuestionClassification(BaseModel): method validate_classification (line 49) | def validate_classification(cls, v): function classify (line 56) | async def classify(data: str): function main (line 71) | async def main(questions: list[str], *, path_to_jsonl: str = None): FILE: examples/batch-classification/run_langsmith.py class QuestionType (line 16) | class QuestionType(Enum): class QuestionClassification (line 28) | class QuestionClassification(BaseModel): method validate_classification (line 51) | def validate_classification(cls, v): function classify (line 60) | async def classify(data: str): function main (line 75) | async def main(questions: list[str]): FILE: examples/batch_api/in_memory_batch_example.py class User (line 12) | class User(BaseModel): function main (line 20) | def main(): function compare_file_vs_memory (line 165) | def compare_file_vs_memory(): function demo_polling_logic (line 203) | def demo_polling_logic(): FILE: examples/batch_api/run_batch_test.py class User (line 49) | class User(BaseModel): function create_test_messages (line 54) | def create_test_messages() -> list[list[dict]]: function get_expected_results (line 74) | def get_expected_results() -> list[User]: function check_api_key (line 81) | def check_api_key(provider: str) -> bool: function create_openai_batch (line 110) | def create_openai_batch(model: str, messages_list: list[list[dict]]) -> ... function create_anthropic_batch (line 136) | def create_anthropic_batch( function create_google_batch (line 161) | def create_google_batch(model: str, messages_list: list[list[dict]]) -> ... function create (line 179) | def create( function list_batches (line 254) | def list_batches(): function fetch (line 284) | def fetch( function show_results (line 354) | def show_results( function poll_for_results (line 469) | def poll_for_results( function fetch_openai_results_with_status (line 527) | def fetch_openai_results_with_status( function fetch_anthropic_results_with_status (line 567) | def fetch_anthropic_results_with_status( function fetch_openai_results (line 615) | def fetch_openai_results(batch_id: str, validate: bool) -> list[User]: function fetch_anthropic_results (line 659) | def fetch_anthropic_results(batch_id: str, validate: bool) -> list[User]: function fetch_google_results (line 703) | def fetch_google_results(batch_job_name: str, validate: bool) -> list[Us... function validate_results (line 749) | def validate_results(results: list[User], provider_name: str) -> bool: function help (line 782) | def help(): function list_models (line 824) | def list_models(): FILE: examples/caching/example_diskcache.py class UserDetail (line 13) | class UserDetail(BaseModel): function instructor_cache (line 21) | def instructor_cache(func): function extract (line 65) | def extract(data) -> UserDetail: function aextract (line 76) | async def aextract(data) -> UserDetail: function test_extract (line 86) | def test_extract(): function atest_extract (line 102) | async def atest_extract(): FILE: examples/caching/example_redis.py function instructor_cache (line 13) | def instructor_cache(func): class UserDetail (line 38) | class UserDetail(BaseModel): function extract (line 44) | def extract(data) -> UserDetail: function test_extract (line 55) | def test_extract(): FILE: examples/caching/lru.py class UserDetail (line 9) | class UserDetail(BaseModel): function extract (line 15) | def extract(data): function test_extract (line 25) | def test_extract(): FILE: examples/caching/run.py class UserDetail (line 49) | class UserDetail(BaseModel): class CacheMetrics (line 57) | class CacheMetrics: method __init__ (line 60) | def __init__(self): method record_hit (line 69) | def record_hit(self, func_name: str, time_saved: float): method record_miss (line 75) | def record_miss(self, func_name: str): method record_error (line 80) | def record_error(self, func_name: str, error: str): method hit_rate (line 85) | def hit_rate(self) -> float: method get_stats (line 89) | def get_stats(self) -> dict[str, Any]: method reset (line 99) | def reset(self): function smart_cache_key (line 112) | def smart_cache_key( function extract_functools (line 128) | def extract_functools(data: str) -> UserDetail: function monitored_functools_cache (line 144) | def monitored_functools_cache(func: F) -> F: function extract_functools_monitored (line 176) | def extract_functools_monitored(data: str) -> UserDetail: function create_diskcache_decorator (line 188) | def create_diskcache_decorator( function extract_diskcache (line 242) | def extract_diskcache(data: str) -> UserDetail: function create_redis_decorator (line 254) | def create_redis_decorator( function extract_redis (line 319) | def extract_redis(data: str) -> UserDetail: function extract_no_cache (line 331) | def extract_no_cache(data: str) -> UserDetail: function extract_l1 (line 345) | def extract_l1(data: str) -> UserDetail: function extract_l2 (line 350) | def extract_l2(data: str) -> UserDetail: function extract_l3 (line 355) | def extract_l3(data: str) -> UserDetail: function benchmark_caching_strategy (line 365) | def benchmark_caching_strategy( function calculate_cost_savings (line 419) | def calculate_cost_savings(baseline_stats: dict, cached_stats: dict) -> ... function run_async_example (line 458) | async def run_async_example(): function demonstrate_schema_invalidation (line 486) | def demonstrate_schema_invalidation(): function main (line 514) | def main(): FILE: examples/caching_prototype/run_real.py class User (line 10) | class User(BaseModel): function test_autocache (line 15) | def test_autocache(): function test_create_with_completion (line 56) | def test_create_with_completion(): function test_diskcache (line 100) | def test_diskcache(): function test_cache_ttl (line 170) | def test_cache_ttl(): function test_different_inputs (line 221) | def test_different_inputs(): FILE: examples/chain-of-density/chain_of_density.py class InitialSummary (line 11) | class InitialSummary(BaseModel): class RewrittenSummary (line 22) | class RewrittenSummary(BaseModel): method min_entity_density (line 51) | def min_entity_density(cls, v: str): method min_length (line 69) | def min_length(cls, v: str): method has_missing_entities (line 79) | def has_missing_entities(cls, missing_entities: list[str]): method has_no_absent_entities (line 87) | def has_no_absent_entities(cls, absent_entities: list[str]): function summarize_article (line 97) | def summarize_article(article: str, summary_steps: int = 3): FILE: examples/chain-of-density/finetune.py class GeneratedSummary (line 23) | class GeneratedSummary(BaseModel): function distil_summarization (line 42) | def distil_summarization(text: str) -> GeneratedSummary: FILE: examples/citation_with_extraction/citation_fuzzy_match.py class Fact (line 10) | class Fact(BaseModel): method validate_sources (line 20) | def validate_sources(self, info: FieldValidationInfo) -> "Fact": method _get_span (line 41) | def _get_span(self, quote, context, errs=5): method get_spans (line 56) | def get_spans(self, context): class QuestionAnswer (line 61) | class QuestionAnswer(instructor.ResponseSchema): method validate_sources (line 73) | def validate_sources(self) -> "QuestionAnswer": function ask_ai (line 83) | def ask_ai(question: str, context: str) -> QuestionAnswer: FILE: examples/citation_with_extraction/main.py class Fact (line 25) | class Fact(BaseModel): method _get_span (line 41) | def _get_span(self, quote, context): method get_spans (line 56) | def get_spans(self, context): class QuestionAnswer (line 62) | class QuestionAnswer(ResponseSchema, MultiTaskBase): class Question (line 77) | class Question(BaseModel): function stream_extract (line 83) | def stream_extract(question: Question) -> Iterable[Fact]: function get_api_key (line 108) | def get_api_key(request: Request): function extract (line 128) | async def extract(question: Question, openai_key: str = Depends(get_api_... FILE: examples/citation_with_extraction/modal_main.py function fastapi_app (line 11) | def fastapi_app(): FILE: examples/citations/run.py class Statements (line 21) | class Statements(BaseModel): method substring_quote_exists (line 27) | def substring_quote_exists(cls, v: str, info: ValidationInfo): method substring_quote_exists (line 92) | def substring_quote_exists(self, info: ValidationInfo): class AnswerWithCitaton (line 40) | class AnswerWithCitaton(BaseModel): method validate_answer (line 175) | def validate_answer(self, info: ValidationInfo): class Validation (line 75) | class Validation(BaseModel): class Statements (line 87) | class Statements(BaseModel): method substring_quote_exists (line 27) | def substring_quote_exists(cls, v: str, info: ValidationInfo): method substring_quote_exists (line 92) | def substring_quote_exists(self, info: ValidationInfo): class AnswerWithCitaton (line 112) | class AnswerWithCitaton(BaseModel): method validate_answer (line 175) | def validate_answer(self, info: ValidationInfo): class AnswerWithCitaton (line 170) | class AnswerWithCitaton(BaseModel): method validate_answer (line 175) | def validate_answer(self, info: ValidationInfo): FILE: examples/classification/classifiy_with_validation.py class SOCCode (line 37) | class SOCCode(BaseModel): method validate_code (line 45) | def validate_code(cls, v): function classify_job (line 51) | def classify_job(description: str) -> SOCCode: FILE: examples/classification/multi_prediction.py class MultiLabels (line 11) | class MultiLabels(str, enum.Enum): class MultiClassPrediction (line 18) | class MultiClassPrediction(BaseModel): function multi_classify (line 23) | def multi_classify(data: str) -> MultiClassPrediction: FILE: examples/classification/simple_prediction.py class Labels (line 10) | class Labels(str, enum.Enum): class SinglePrediction (line 15) | class SinglePrediction(BaseModel): function classify (line 23) | def classify(data: str) -> SinglePrediction: FILE: examples/codegen-from-schema/create_fastapi_app.py class TemplateVariables (line 53) | class TemplateVariables(BaseModel): function load_json_schema (line 57) | def load_json_schema(json_schema_path: str) -> dict: function generate_pydantic_model (line 65) | def generate_pydantic_model(json_schema_path: str): function extract_jinja_vars (line 73) | def extract_jinja_vars(prompt_template: str) -> list: function render_app_template (line 77) | def render_app_template(template_str: str, **kwargs) -> str: function create_app (line 82) | def create_app( FILE: examples/codegen-from-schema/models.py class Type (line 12) | class Type(Enum): class PhoneNumber (line 18) | class PhoneNumber(BaseModel): class ExtractPerson (line 23) | class ExtractPerson(BaseModel): FILE: examples/codegen-from-schema/run.py class TemplateVariables (line 20) | class TemplateVariables(BaseModel): class RequestSchema (line 24) | class RequestSchema(BaseModel): function extract_person (line 36) | async def extract_person(input: RequestSchema) -> ExtractPerson: FILE: examples/cohere/cohere.py class Person (line 14) | class Person(BaseModel): class Group (line 19) | class Group(BaseModel): FILE: examples/crm/run.py class CRMSource (line 9) | class CRMSource(Enum): class CRMSearch (line 16) | class CRMSearch(BaseModel): class CRMSearchQuery (line 32) | class CRMSearchQuery(BaseModel): function query_crm (line 41) | def query_crm(query: str) -> CRMSearchQuery: FILE: examples/decimals/run.py class Receipt (line 8) | class Receipt(BaseModel): method parse_price (line 14) | def parse_price(cls, v): FILE: examples/distilations/three_digit_mul.py class Multiply (line 18) | class Multiply(BaseModel): function fn (line 25) | def fn(a: int, b: int) -> Multiply: FILE: examples/distilations/three_digit_mul_dispatch.py class Multiply (line 24) | class Multiply(BaseModel): function fn (line 31) | def fn(a: int, b: int) -> Multiply: FILE: examples/evals/eval.py class Status (line 11) | class Status(Enum): class StreamingAccumulatorManager (line 17) | class StreamingAccumulatorManager: method __init__ (line 18) | def __init__(self): method validate_string (line 21) | def validate_string(self, json_string: str, index: int) -> None: method process_validation_error (line 36) | def process_validation_error(self, error, index): method update (line 48) | def update(self, index, data: Any, path: str = "$") -> None: method summarize (line 65) | def summarize(self) -> dict[str, dict]: class StreamingAccumulator (line 69) | class StreamingAccumulator: method __init__ (line 70) | def __init__(self): method update (line 86) | def update(self, index: Any, value: Any) -> None: method summarize (line 108) | def summarize(self, key_name=None) -> dict[str, Union[int, float, dict]]: FILE: examples/evals/models.py class SourceType (line 6) | class SourceType(str, Enum): class Search (line 14) | class Search(BaseModel): class MultiSearch (line 22) | class MultiSearch(BaseModel): FILE: examples/evals/streamlit.py function get_lines (line 12) | def get_lines(stats_key, keys): function render_dropdown_and_button (line 20) | def render_dropdown_and_button(stats_key): FILE: examples/extract-table/run_vision.py function md_to_df (line 22) | def md_to_df(data: Any) -> Any: class Table (line 53) | class Table(BaseModel): class MultipleTables (line 58) | class MultipleTables(BaseModel): function extract (line 78) | def extract(url: str) -> MultipleTables: FILE: examples/extract-table/run_vision_langsmith.py function md_to_df (line 23) | def md_to_df(data: Any) -> Any: class Table (line 54) | class Table(BaseModel): class MultipleTables (line 59) | class MultipleTables(BaseModel): function extract (line 80) | def extract(url: str) -> MultipleTables: FILE: examples/extract-table/run_vision_org.py class People (line 14) | class People(BaseModel): class Organization (line 26) | class Organization(BaseModel): function extract (line 30) | def extract(url: str): FILE: examples/extract-table/run_vision_org_table.py function md_to_df (line 22) | def md_to_df(data: Any) -> Any: class Table (line 53) | class Table(BaseModel): function extract (line 58) | def extract(url: str): FILE: examples/extract-table/run_vision_receipt.py class Item (line 12) | class Item(BaseModel): class Receipt (line 18) | class Receipt(BaseModel): method check_total (line 23) | def check_total(cls, values: "Receipt"): function extract (line 34) | def extract(url: str) -> Receipt: FILE: examples/extract-table/test.py class User (line 11) | class User(BaseModel): class MeetingInfo (line 16) | class MeetingInfo(BaseModel): FILE: examples/extracting-pii/run.py class Data (line 9) | class Data(BaseModel): class PIIDataExtraction (line 15) | class PIIDataExtraction(BaseModel): method scrub_data (line 22) | def scrub_data(self, content): FILE: examples/fastapi_app/main.py class SearchRequest (line 9) | class SearchRequest(BaseModel): class SearchQuery (line 13) | class SearchQuery(ResponseSchema): function search (line 28) | async def search(request: SearchRequest): FILE: examples/fastapi_app/script.py class SearchQuery (line 6) | class SearchQuery(ResponseSchema): FILE: examples/fizzbuzz/run.py function fizzbuzz_gpt (line 9) | def fizzbuzz_gpt(n) -> list[int | str]: FILE: examples/gpt-engineer/generate.py class File (line 10) | class File(ResponseSchema): method save (line 20) | def save(self): class Program (line 25) | class Program(ResponseSchema): function develop (line 33) | def develop(data: str) -> Program: FILE: examples/gpt-engineer/refactor.py class Diff (line 11) | class Diff(ResponseSchema): function refactor (line 62) | def refactor(new_requirements: str, program: Program) -> Diff: FILE: examples/groq/groq_example.py class Character (line 7) | class Character(BaseModel): FILE: examples/groq/groq_example2.py class UserExtract (line 13) | class UserExtract(BaseModel): FILE: examples/hooks/run.py class User (line 18) | class User(pydantic.BaseModel): method validate_age (line 25) | def validate_age(cls, v: int) -> int: class CompletionStats (line 31) | class CompletionStats: method __init__ (line 34) | def __init__(self): method report (line 40) | def report(self): function main (line 49) | def main(): FILE: examples/iterables/run.py class User (line 13) | class User(BaseModel): function stream_extract (line 19) | def stream_extract(input: str) -> Iterable[User]: FILE: examples/knowledge-graph/run.py class Node (line 11) | class Node(BaseModel): class Edge (line 17) | class Edge(BaseModel): class KnowledgeGraph (line 24) | class KnowledgeGraph(BaseModel): function generate_graph (line 29) | def generate_graph(input) -> KnowledgeGraph: function visualize_knowledge_graph (line 42) | def visualize_knowledge_graph(kg: KnowledgeGraph): FILE: examples/knowledge-graph/run_stream.py class Node (line 12) | class Node(BaseModel): method __hash__ (line 17) | def __hash__(self) -> int: class Edge (line 21) | class Edge(BaseModel): method __hash__ (line 27) | def __hash__(self) -> int: class KnowledgeGraph (line 31) | class KnowledgeGraph(BaseModel): method update (line 35) | def update(self, other: "KnowledgeGraph") -> "KnowledgeGraph": method draw (line 42) | def draw(self, prefix: str = None): function generate_graph (line 57) | def generate_graph(input: list[str]) -> KnowledgeGraph: FILE: examples/learn-async/run.py class Timer (line 12) | class Timer: method __init__ (line 13) | def __init__(self, name): method __aenter__ (line 18) | async def __aenter__(self): method __aexit__ (line 21) | async def __aexit__(self, *args, **kwargs): class Person (line 26) | class Person(BaseModel): function extract_person (line 31) | async def extract_person(text: str) -> Person: function main (line 41) | async def main(): FILE: examples/llm-judge-relevance/run.py class Judgment (line 8) | class Judgment(BaseModel): function judge_relevance (line 40) | def judge_relevance(question: str, text: str) -> Judgment: FILE: examples/logfire-fastapi/server.py class UserData (line 11) | class UserData(BaseModel): class MultipleUserData (line 15) | class MultipleUserData(BaseModel): class UserDetail (line 19) | class UserDetail(BaseModel): function endpoint_function (line 33) | async def endpoint_function(data: UserData) -> UserDetail: function extract_many_users (line 46) | async def extract_many_users(data: MultipleUserData): function extract (line 63) | async def extract(data: UserData): FILE: examples/logfire/classify.py class Labels (line 8) | class Labels(str, enum.Enum): class SinglePrediction (line 15) | class SinglePrediction(BaseModel): function classify (line 30) | def classify(data: str) -> SinglePrediction: FILE: examples/logfire/image.py function md_to_df (line 21) | def md_to_df(data: Any) -> Any: class Table (line 49) | class Table(BaseModel): function extract_table_from_image (line 55) | def extract_table_from_image(url: str) -> Iterable[Table]: FILE: examples/logfire/validate.py class Statement (line 15) | class Statement(BaseModel): FILE: examples/logging/run.py class UserDetail (line 14) | class UserDetail(BaseModel): FILE: examples/match_language/run_v1.py class GeneratedSummary (line 53) | class GeneratedSummary(BaseModel): function summarize_text (line 57) | async def summarize_text(text: str): function main (line 78) | async def main(): FILE: examples/match_language/run_v2.py class GeneratedSummary (line 53) | class GeneratedSummary(BaseModel): function summarize_text (line 60) | async def summarize_text(text: str): function main (line 81) | async def main(): FILE: examples/mistral/mistral.py class UserDetails (line 8) | class UserDetails(BaseModel): FILE: examples/multi-actions/run.py class Action (line 11) | class Action(enum.Enum): class Projects (line 17) | class Projects(enum.Enum): class Buckets (line 24) | class Buckets(enum.Enum): class TaskAction (line 33) | class TaskAction(BaseModel): class Response (line 51) | class Response(BaseModel): FILE: examples/multiple_search_queries/segment_search_queries.py class SearchType (line 10) | class SearchType(str, enum.Enum): class Search (line 17) | class Search(BaseModel): method execute (line 26) | async def execute(self): class MultiSearch (line 35) | class MultiSearch(BaseModel): method execute (line 46) | def execute(self): function segment (line 55) | def segment(data: str) -> MultiSearch: FILE: examples/open_source_examples/openrouter.py class UserDetail (line 35) | class UserDetail(BaseModel): FILE: examples/open_source_examples/perplexity.py class UserDetail (line 47) | class UserDetail(BaseModel): FILE: examples/open_source_examples/runpod.py class UserDetail (line 36) | class UserDetail(BaseModel): FILE: examples/openai-audio/run.py class Person (line 10) | class Person(BaseModel): FILE: examples/openai/run.py class UserInfo (line 16) | class UserInfo(BaseModel): FILE: examples/parallel/run.py class Weather (line 11) | class Weather(BaseModel): class GoogleSearch (line 16) | class GoogleSearch(BaseModel): FILE: examples/partial_streaming/benchmark.py function num_tokens_from_string (line 13) | def num_tokens_from_string(string: str, model_name: str) -> int: class User (line 23) | class User(BaseModel): function benchmark_raw_stream (line 29) | def benchmark_raw_stream(model="gpt-4"): function benchmark_partial_streaming (line 57) | def benchmark_partial_streaming(model="gpt-4"): FILE: examples/partial_streaming/run.py class User (line 11) | class User(BaseModel): FILE: examples/patching/anyscale.py class UserExtract (line 20) | class UserExtract(BaseModel): FILE: examples/patching/oai.py class UserExtract (line 16) | class UserExtract(BaseModel): FILE: examples/patching/pcalls.py class Weather (line 14) | class Weather(ResponseSchema): class GoogleSearch (line 19) | class GoogleSearch(ResponseSchema): class Query (line 25) | class Query(BaseModel): FILE: examples/patching/together.py class UserExtract (line 18) | class UserExtract(BaseModel): FILE: examples/proscons/run.py class Character (line 7) | class Character(BaseModel): FILE: examples/query_planner_execution/query_planner_execution.py class QueryType (line 11) | class QueryType(str, enum.Enum): class ComputeQuery (line 21) | class ComputeQuery(BaseModel): class MergedResponses (line 30) | class MergedResponses(BaseModel): class Query (line 39) | class Query(BaseModel): method execute (line 59) | async def execute(self, dependency_func): class QueryPlan (line 85) | class QueryPlan(BaseModel): method execute (line 95) | async def execute(self): method dependencies (line 101) | def dependencies(self, idz: list[int]) -> list[Query]: function query_planner (line 112) | def query_planner(question: str, plan=False) -> QueryPlan: FILE: examples/recursive_filepaths/parse_recursive_paths.py class NodeType (line 11) | class NodeType(str, enum.Enum): class Node (line 18) | class Node(BaseModel): method print_paths (line 42) | def print_paths(self, parent_path=""): class DirectoryTree (line 57) | class DirectoryTree(BaseModel): method print_paths (line 70) | def print_paths(self): function parse_tree_to_filesystem (line 80) | def parse_tree_to_filesystem(data: str) -> DirectoryTree: FILE: examples/reranker/run.py class Label (line 9) | class Label(BaseModel): method validate_chunk_id (line 22) | def validate_chunk_id(cls, v: str, info: ValidationInfo) -> str: class RerankedResults (line 32) | class RerankedResults(BaseModel): method model_validate (line 37) | def model_validate(cls, v: list[Label]) -> list[Label]: function rerank_results (line 41) | def rerank_results(query: str, chunks: list[dict]) -> RerankedResults: function main (line 80) | def main(): FILE: examples/resolving-complex-entities/run.py class Property (line 14) | class Property(BaseModel): class Entity (line 20) | class Entity(BaseModel): class DocumentExtraction (line 39) | class DocumentExtraction(BaseModel): function ask_ai (line 46) | def ask_ai(content) -> DocumentExtraction: function generate_html_label (line 64) | def generate_html_label(entity: Entity) -> str: function generate_graph (line 77) | def generate_graph(data: DocumentExtraction): FILE: examples/retry/run.py class User (line 10) | class User(BaseModel): method name_is_uppercase (line 15) | def name_is_uppercase(cls, v: str): FILE: examples/safer_sql_example/safe_sql.py class SQLTemplateType (line 11) | class SQLTemplateType(str, enum.Enum): class Parameters (line 16) | class Parameters(BaseModel): class SQL (line 26) | class SQL(BaseModel): method to_sql (line 51) | def to_sql(self): function create_query (line 59) | def create_query(data: str) -> SQL: FILE: examples/simple-extraction/maybe_user.py class UserDetail (line 10) | class UserDetail(BaseModel): function get_user_detail (line 19) | def get_user_detail(string) -> MaybeUser: # type: ignore FILE: examples/simple-extraction/user.py class UserDetail (line 10) | class UserDetail(BaseModel): function get_user_detail (line 16) | def get_user_detail(string) -> UserDetail: FILE: examples/situate_context/run.py class SituatedContext (line 16) | class SituatedContext(BaseModel): function situate_context (line 30) | async def situate_context(doc: str, chunk: str) -> SituatedContext: function chunking_function (line 72) | def chunking_function( function process_chunk (line 90) | async def process_chunk(doc: str, chunk: str) -> dict[str, str]: function process (line 105) | async def process( function main (line 172) | async def main(): FILE: examples/sqlmodel/run.py function monitor_ai_calls (line 43) | def monitor_ai_calls(func): class Team (line 64) | class Team(SQLModel, table=True): class Hero (line 76) | class Hero(SQLModel, instructor.ResponseSchema, table=True): method validate_name_format (line 102) | def validate_name_format(cls, v): class Product (line 110) | class Product(SQLModel, instructor.ResponseSchema, table=True): function create_hero (line 128) | def create_hero(prompt: str = "Create a unique superhero") -> Hero: function create_hero_async (line 145) | async def create_hero_async(prompt: str = "Create a unique superhero") -... function create_hero_team_async (line 162) | async def create_hero_team_async(team_size: int = 5) -> list[Hero]: function create_heroes_batch (line 181) | async def create_heroes_batch(prompts: list[str]) -> list[Hero]: function create_product (line 191) | def create_product(category: str) -> Product: function setup_database (line 210) | def setup_database(): function create_sample_teams (line 216) | def create_sample_teams(): function assign_hero_to_team (line 239) | def assign_hero_to_team(hero: Hero, team_name: str): function list_heroes_with_teams (line 254) | def list_heroes_with_teams(): function demonstrate_validation_errors (line 268) | def demonstrate_validation_errors(): function main (line 295) | async def main(): FILE: examples/sqlmodel/test_basic.py class Team (line 22) | class Team(SQLModel, table=True): class Hero (line 34) | class Hero(SQLModel, table=True): method validate_name_format (line 60) | def validate_name_format(cls, v): function test_basic_functionality (line 68) | def test_basic_functionality(): FILE: examples/stream_action_items/run.py class ActionItem (line 13) | class ActionItem(BaseModel): class ActionItemResponse (line 24) | class ActionItemResponse(BaseModel): method patch (line 29) | def patch(self, action_item: ActionItem): method __repr__ (line 36) | def __repr__(self): method __str__ (line 45) | def __str__(self) -> str: function yield_action_items (line 52) | def yield_action_items(transcript: str, state: ActionItemResponse): function text_to_speech (line 104) | def text_to_speech(chunk): function process_transcript (line 113) | def process_transcript(transcript: list[str]): FILE: examples/synethic-data/run.py class SyntheticQA (line 9) | class SyntheticQA(BaseModel): function get_synthetic_data (line 34) | def get_synthetic_data() -> Iterable[SyntheticQA]: FILE: examples/task_planner/task_planner_topological_sort.py class TaskResult (line 25) | class TaskResult(BaseModel): class TaskResults (line 30) | class TaskResults(BaseModel): class Task (line 34) | class Task(BaseModel): method aexecute (line 53) | async def aexecute(self, with_results: TaskResults) -> TaskResult: class TaskPlan (line 63) | class TaskPlan(BaseModel): method _get_execution_order (line 74) | def _get_execution_order(self) -> list[int]: method execute (line 104) | async def execute(self) -> dict[int, TaskResult]: function task_planner (line 147) | def task_planner(question: str) -> TaskPlan: FILE: examples/tenacity-benchmarks/run.py class UserInfo (line 45) | class UserInfo(BaseModel): method validate_age (line 52) | def validate_age(cls, v): method validate_email (line 59) | def validate_email(cls, v): class MockError (line 76) | class MockError: method __init__ (line 77) | def __init__(self): method maybe_fail (line 81) | def maybe_fail(self): function extract_user_info_with_mock_errors (line 117) | def extract_user_info_with_mock_errors(text: str) -> UserInfo: function extract_user_info (line 137) | def extract_user_info(text: str) -> UserInfo: function robust_extraction (line 157) | def robust_extraction(text: str) -> UserInfo: function extract_with_validation (line 169) | def extract_with_validation(text: str) -> UserInfo: function should_retry (line 176) | def should_retry(result: UserInfo) -> bool: function extract_valid_user (line 187) | def extract_valid_user(text: str) -> UserInfo: function rate_limit_safe_extraction (line 212) | def rate_limit_safe_extraction(text: str) -> UserInfo: function network_resilient_extraction (line 224) | def network_resilient_extraction(text: str) -> UserInfo: function logged_extraction (line 237) | def logged_extraction(text: str) -> UserInfo: function get_client (line 245) | def get_client(): function circuit_breaker_extraction (line 251) | def circuit_breaker_extraction(text: str) -> UserInfo: function monitored_extraction (line 260) | def monitored_extraction(text: str) -> UserInfo: function benchmark_retry_methods (line 278) | def benchmark_retry_methods(): function test_batch_processing (line 392) | def test_batch_processing(): function demonstrate_error_types (line 433) | def demonstrate_error_types(): function main (line 493) | def main(): FILE: examples/timestamps/run.py class Segment (line 8) | class Segment(BaseModel): class SegmentWithTimestamp (line 16) | class SegmentWithTimestamp(BaseModel): method parse_timestamp (line 26) | def parse_timestamp(self): FILE: examples/union/run.py class Search (line 7) | class Search(BaseModel): method process (line 12) | def process(self): class Lookup (line 17) | class Lookup(BaseModel): method process (line 22) | def process(self): class Finish (line 27) | class Finish(BaseModel): method process (line 32) | def process(self): class TakeAction (line 38) | class TakeAction(BaseModel): method process (line 41) | def process(self): FILE: examples/validated-multiclass/run.py class Tag (line 11) | class Tag(BaseModel): method validate_ids (line 16) | def validate_ids(self, info: ValidationInfo): class TagWithInstructions (line 29) | class TagWithInstructions(Tag): class TagRequest (line 33) | class TagRequest(BaseModel): class TagResponse (line 38) | class TagResponse(BaseModel): function tag_single_request (line 43) | async def tag_single_request(text: str, tags: list[Tag]) -> Tag: function tag_request (line 65) | async def tag_request(request: TagRequest) -> TagResponse: FILE: examples/validators/allm_validator.py class QuestionAnswerNoEvil (line 12) | class QuestionAnswerNoEvil(BaseModel): function main (line 22) | async def main(): FILE: examples/validators/annotator.py function name_must_contain_space (line 6) | def name_must_contain_space(v: str) -> str: class UserDetail (line 12) | class UserDetail(BaseModel): FILE: examples/validators/chain_of_thought_validator.py class Validation (line 11) | class Validation(BaseModel): function validator (line 21) | def validator(values): class Response (line 44) | class Response(BaseModel): method chain_of_thought_makes_sense (line 50) | def chain_of_thought_makes_sense(cls, data): FILE: examples/validators/citations.py function citation_exists (line 9) | def citation_exists(v: str, info: ValidationInfo): class AnswerWithCitation (line 21) | class AnswerWithCitation(BaseModel): FILE: examples/validators/competitors.py function no_competitors (line 10) | def no_competitors(v: str) -> str: class Response (line 22) | class Response(BaseModel): FILE: examples/validators/field_validator.py class UserDetail (line 4) | class UserDetail(BaseModel): method name_must_contain_space (line 9) | def name_must_contain_space(cls, v): FILE: examples/validators/just_a_guy.py class AnswerWithCitation (line 4) | class AnswerWithCitation(BaseModel): method remove_stopwords (line 10) | def remove_stopwords(cls, v: str, info: ValidationInfo): FILE: examples/validators/llm_validator.py class QuestionAnswer (line 12) | class QuestionAnswer(BaseModel): class QuestionAnswerNoEvil (line 46) | class QuestionAnswerNoEvil(BaseModel): FILE: examples/validators/moderation.py class Response (line 12) | class Response(BaseModel): FILE: examples/vision/image_to_ad_copy.py class Product (line 23) | class Product(BaseModel): method generate_prompt (line 47) | def generate_prompt(self): class IdentifiedProduct (line 56) | class IdentifiedProduct(BaseModel): method __bool__ (line 76) | def __bool__(self): class AdCopy (line 80) | class AdCopy(BaseModel): function read_images (line 111) | def read_images(image_urls: list[str]) -> IdentifiedProduct: function generate_ad_copy (line 141) | def generate_ad_copy(product: Product) -> AdCopy: function run (line 162) | def run(images: list[str]) -> tuple[list[Product], list[AdCopy]]: FILE: examples/vision/run.py class Circle (line 9) | class Circle(BaseModel): function encode_image (line 15) | def encode_image(image_path): function draw_circle (line 20) | def draw_circle(image_size, num_circles, path): FILE: examples/vision/run_raw.py class SearchQuery (line 7) | class SearchQuery(BaseModel): class MultiSearchQuery (line 15) | class MultiSearchQuery(BaseModel): function extract_table (line 19) | def extract_table(url: str): FILE: examples/vision/run_table.py function to_markdown (line 18) | def to_markdown(df: pd.DataFrame) -> str: function md_to_df (line 22) | def md_to_df(data: Any) -> Any: class Table (line 53) | class Table(BaseModel): function extract_table (line 58) | def extract_table(url: str): FILE: examples/vision/slides.py class Competitor (line 23) | class Competitor(BaseModel): class Industry (line 29) | class Industry(BaseModel): class Competition (line 40) | class Competition(BaseModel): function read_images (line 58) | def read_images(image_urls: list[str]) -> Competition: function process_and_identify_competitors (line 88) | def process_and_identify_competitors(): FILE: examples/watsonx/watsonx.py class Company (line 18) | class Company(BaseModel): FILE: examples/youtube-clips/run.py function extract_video_id (line 10) | def extract_video_id(url: str) -> str | None: class TranscriptSegment (line 18) | class TranscriptSegment(BaseModel): function get_transcript_with_timing (line 24) | def get_transcript_with_timing( class YoutubeClip (line 44) | class YoutubeClip(BaseModel): class YoutubeClips (line 56) | class YoutubeClips(BaseModel): function yield_clips (line 60) | def yield_clips(segments: Iterable[TranscriptSegment]) -> Iterable[Youtu... FILE: examples/youtube-flashcards/run.py class QuestionAnswer (line 11) | class QuestionAnswer(BaseModel): function process_user_input (line 29) | def process_user_input(state: State, user_input: str) -> State: function get_youtube_transcript (line 38) | def get_youtube_transcript(state: State) -> State: function generate_question_and_answers (line 51) | def generate_question_and_answers(state: State) -> State: function build_application (line 82) | def build_application(): FILE: examples/youtube/run.py class Chapter (line 12) | class Chapter(BaseModel): function get_youtube_transcript (line 30) | def get_youtube_transcript(video_id: str) -> str: function extract_chapters (line 41) | def extract_chapters(transcript: str): FILE: instructor/auto_client.py function from_provider (line 42) | def from_provider( function from_provider (line 51) | def from_provider( function from_provider (line 60) | def from_provider( function from_provider (line 69) | def from_provider( function from_provider (line 77) | def from_provider( FILE: instructor/batch/__init__.py class BatchJob (line 70) | class BatchJob: method parse_from_file (line 74) | def parse_from_file( method parse_from_string (line 82) | def parse_from_string( method _extract_structured_data (line 115) | def _extract_structured_data(cls, data: dict[str, Any]) -> Optional[di... FILE: instructor/batch/models.py class BatchSuccess (line 18) | class BatchSuccess(BaseModel, Generic[T]): class BatchError (line 28) | class BatchError(BaseModel): class BatchStatus (line 38) | class BatchStatus(str, Enum): class BatchTimestamps (line 49) | class BatchTimestamps(BaseModel): class BatchRequestCounts (line 61) | class BatchRequestCounts(BaseModel): class BatchErrorInfo (line 78) | class BatchErrorInfo(BaseModel): class BatchFiles (line 86) | class BatchFiles(BaseModel): class BatchJobInfo (line 95) | class BatchJobInfo(BaseModel): method from_openai (line 128) | def from_openai(cls, batch_data: dict[str, Any]) -> BatchJobInfo: method from_anthropic (line 222) | def from_anthropic(cls, batch_data: dict[str, Any]) -> BatchJobInfo: FILE: instructor/batch/processor.py class BatchProcessor (line 18) | class BatchProcessor(Generic[T]): method __init__ (line 21) | def __init__(self, model: str, response_model: type[T]): method create_batch_from_messages (line 37) | def create_batch_from_messages( method submit_batch (line 94) | def submit_batch( method get_batch_status (line 114) | def get_batch_status(self, batch_id: str) -> dict[str, Any]: method retrieve_results (line 118) | def retrieve_results(self, batch_id: str) -> list[BatchResult]: method list_batches (line 123) | def list_batches(self, limit: int = 10) -> list[BatchJobInfo]: method get_results (line 134) | def get_results( method cancel_batch (line 157) | def cancel_batch(self, batch_id: str) -> dict[str, Any]: method delete_batch (line 168) | def delete_batch(self, batch_id: str) -> dict[str, Any]: method parse_results (line 179) | def parse_results(self, results_content: str) -> list[BatchResult]: method _extract_from_response (line 249) | def _extract_from_response(self, data: dict[str, Any]) -> dict[str, An... FILE: instructor/batch/providers/__init__.py function get_provider (line 17) | def get_provider(provider_name: str) -> BatchProvider: FILE: instructor/batch/providers/anthropic.py class AnthropicProvider (line 17) | class AnthropicProvider(BatchProvider): method submit_batch (line 20) | def submit_batch( method get_status (line 69) | def get_status(self, batch_id: str) -> dict[str, Any]: method retrieve_results (line 92) | def retrieve_results(self, batch_id: str) -> str: method download_results (line 139) | def download_results(self, batch_id: str, file_path: str) -> None: method cancel_batch (line 184) | def cancel_batch(self, batch_id: str) -> dict[str, Any]: method delete_batch (line 202) | def delete_batch(self, batch_id: str) -> dict[str, Any]: method list_batches (line 224) | def list_batches(self, limit: int = 10) -> list[BatchJobInfo]: FILE: instructor/batch/providers/base.py class BatchProvider (line 16) | class BatchProvider(ABC): method submit_batch (line 20) | def submit_batch( method get_status (line 30) | def get_status(self, batch_id: str) -> dict[str, Any]: method retrieve_results (line 35) | def retrieve_results(self, batch_id: str) -> str: method download_results (line 40) | def download_results(self, batch_id: str, file_path: str) -> None: method cancel_batch (line 45) | def cancel_batch(self, batch_id: str) -> dict[str, Any]: method delete_batch (line 50) | def delete_batch(self, batch_id: str) -> dict[str, Any]: method list_batches (line 55) | def list_batches(self, limit: int = 10) -> list[BatchJobInfo]: FILE: instructor/batch/providers/openai.py class OpenAIProvider (line 16) | class OpenAIProvider(BatchProvider): method submit_batch (line 19) | def submit_batch( method get_status (line 67) | def get_status(self, batch_id: str) -> dict[str, Any]: method retrieve_results (line 87) | def retrieve_results(self, batch_id: str) -> str: method download_results (line 145) | def download_results(self, batch_id: str, file_path: str) -> None: method cancel_batch (line 204) | def cancel_batch(self, batch_id: str) -> dict[str, Any]: method delete_batch (line 215) | def delete_batch(self, batch_id: str) -> dict[str, Any]: method list_batches (line 231) | def list_batches(self, limit: int = 10) -> list[BatchJobInfo]: FILE: instructor/batch/request.py class Function (line 16) | class Function(BaseModel): class Tool (line 22) | class Tool(BaseModel): class RequestBody (line 27) | class RequestBody(BaseModel): class BatchModel (line 36) | class BatchModel(BaseModel): class BatchRequest (line 43) | class BatchRequest(BaseModel, Generic[T]): method get_json_schema (line 55) | def get_json_schema(self) -> dict[str, Any]: method to_openai_format (line 59) | def to_openai_format(self) -> dict[str, Any]: method to_anthropic_format (line 110) | def to_anthropic_format(self) -> dict[str, Any]: method save_to_file (line 154) | def save_to_file( FILE: instructor/batch/utils.py function filter_successful (line 11) | def filter_successful(results: list[BatchResult]) -> list[BatchSuccess[T]]: function filter_errors (line 16) | def filter_errors(results: list[BatchResult]) -> list[BatchError]: function extract_results (line 21) | def extract_results(results: list[BatchResult]) -> list[T]: function get_results_by_custom_id (line 26) | def get_results_by_custom_id(results: list[BatchResult]) -> dict[str, Ba... FILE: instructor/cache/__init__.py class BaseCache (line 45) | class BaseCache(ABC): method get (line 52) | def get(self, key: str) -> Any | None: # noqa: ANN401 – value type ar... method set (line 56) | def set( class AutoCache (line 69) | class AutoCache(BaseCache): method __init__ (line 72) | def __init__(self, maxsize: int = 128): method get (line 82) | def get(self, key: str) -> Any | None: # noqa: ANN401 method set (line 92) | def set( function _import_diskcache (line 113) | def _import_diskcache(): # pragma: no cover – only executed when requested class DiskCache (line 125) | class DiskCache(BaseCache): method __init__ (line 128) | def __init__(self, directory: str = ".instructor_cache", **kwargs: Any): method get (line 132) | def get(self, key: str) -> Any | None: # noqa: ANN401 method set (line 135) | def set(self, key: str, value: Any, ttl: int | None = None) -> None: ... function make_cache_key (line 147) | def make_cache_key( function load_cached_response (line 191) | def load_cached_response(cache: BaseCache, key: str, response_model: typ... function store_cached_response (line 241) | def store_cached_response( FILE: instructor/cli/batch.py function generate_table (line 18) | def generate_table(batch_jobs: list[BatchJobInfo], provider: str, full_i... function get_jobs (line 125) | def get_jobs(limit: int = 10, provider: str = "openai") -> list[BatchJob... function watch (line 155) | def watch( function create_from_file (line 224) | def create_from_file( function cancel (line 286) | def cancel( function delete (line 348) | def delete( function download_file (line 395) | def download_file( function results (line 447) | def results( function create (line 509) | def create( FILE: instructor/cli/cli.py function docs (line 22) | def docs( FILE: instructor/cli/deprecated_hub.py function hub (line 7) | def hub() -> None: FILE: instructor/cli/files.py function generate_file_table (line 19) | def generate_file_table(files: list[openai.types.FileObject]) -> Table: function get_files (line 41) | def get_files() -> list[openai.types.FileObject]: function get_file_status (line 48) | def get_file_status(file_id: str) -> str: function upload (line 56) | def upload( function download (line 79) | def download( function delete (line 93) | def delete(file_id: str = typer.Argument(help="ID of the file to delete"... function status (line 106) | def status( function list (line 121) | def list() -> None: FILE: instructor/cli/jobs.py class FuneTuningParams (line 18) | class FuneTuningParams(TypedDict, total=False): function generate_table (line 24) | def generate_table(jobs: list[FineTuningJob]) -> Table: function status_color (line 68) | def status_color(status: str) -> str: function get_jobs (line 74) | def get_jobs(limit: int = 5) -> list[FineTuningJob]: function get_file_status (line 78) | def get_file_status(file_id: str) -> str: function watch (line 87) | def watch( function create_from_id (line 106) | def create_from_id( function create_from_file (line 146) | def create_from_file( function cancel (line 232) | def cancel( FILE: instructor/cli/usage.py function fetch_usage (line 23) | async def fetch_usage(date: str) -> dict[str, Any]: function get_usage_for_past_n_days (line 31) | async def get_usage_for_past_n_days(n_days: int) -> list[dict[str, Any]]: function get_model_cost (line 80) | def get_model_cost( function calculate_cost (line 103) | def calculate_cost( function group_and_sum_by_date_and_snapshot (line 119) | def group_and_sum_by_date_and_snapshot(usage_data: list[dict[str, Any]])... function list (line 168) | def list( FILE: instructor/client.py function __getattr__ (line 9) | def __getattr__(name: str): FILE: instructor/core/client.py class Response (line 33) | class Response: method __init__ (line 34) | def __init__( method create (line 40) | def create( method create_with_completion (line 68) | def create_with_completion( method create_iterable (line 90) | def create_iterable( method create_partial (line 112) | def create_partial( class AsyncResponse (line 135) | class AsyncResponse(Response): method __init__ (line 136) | def __init__(self, client: AsyncInstructor): method create (line 139) | async def create( method create_with_completion (line 167) | async def create_with_completion( method create_iterable (line 189) | async def create_iterable( class Instructor (line 212) | class Instructor: method __init__ (line 220) | def __init__( method on (line 246) | def on( method off (line 262) | def off( method clear (line 278) | def clear( method chat (line 295) | def chat(self) -> Self: method completions (line 299) | def completions(self) -> Self: method messages (line 303) | def messages(self) -> Self: method create (line 307) | def create( method create (line 320) | def create( method create (line 333) | def create( method create (line 346) | def create( method create (line 358) | def create( method create_partial (line 388) | def create_partial( method create_partial (line 401) | def create_partial( method create_partial (line 413) | def create_partial( method create_iterable (line 446) | def create_iterable( method create_iterable (line 459) | def create_iterable( method create_iterable (line 471) | def create_iterable( method create_with_completion (line 503) | def create_with_completion( method create_with_completion (line 516) | def create_with_completion( method create_with_completion (line 528) | def create_with_completion( method handle_kwargs (line 558) | def handle_kwargs(self, kwargs: dict[str, Any]) -> dict[str, Any]: method __getattr__ (line 570) | def __getattr__(self, attr: str) -> Any: class AsyncInstructor (line 577) | class AsyncInstructor(Instructor): method __init__ (line 585) | def __init__( method create (line 608) | async def create( # type: ignore[override] method create_partial (line 660) | async def create_partial( # type: ignore[override] method create_iterable (line 691) | async def create_iterable( # type: ignore[override] method create_with_completion (line 722) | async def create_with_completion( # type: ignore[override] function from_openai (line 754) | def from_openai( function from_openai (line 763) | def from_openai( function map_chat_completion_to_response (line 771) | def map_chat_completion_to_response(messages, client, *args, **kwargs) -... function async_map_chat_completion_to_response (line 779) | async def async_map_chat_completion_to_response( function from_openai (line 789) | def from_openai( function from_litellm (line 877) | def from_litellm( function from_litellm (line 885) | def from_litellm( function from_litellm (line 892) | def from_litellm( FILE: instructor/core/exceptions.py class InstructorError (line 8) | class InstructorError(Exception): method from_exception (line 47) | def from_exception( method __init__ (line 62) | def __init__( method __str__ (line 71) | def __str__(self) -> str: class FailedAttempt (line 103) | class FailedAttempt(NamedTuple): class IncompleteOutputException (line 136) | class IncompleteOutputException(InstructorError): method __init__ (line 177) | def __init__( class InstructorRetryException (line 188) | class InstructorRetryException(InstructorError): method __init__ (line 239) | def __init__( class ValidationError (line 258) | class ValidationError(InstructorError): class ProviderError (line 301) | class ProviderError(InstructorError): method __init__ (line 333) | def __init__(self, provider: str, message: str, *args: Any, **kwargs: ... class ConfigurationError (line 338) | class ConfigurationError(InstructorError): class ModeError (line 375) | class ModeError(InstructorError): method __init__ (line 408) | def __init__( class ClientError (line 423) | class ClientError(InstructorError): class AsyncValidationError (line 447) | class AsyncValidationError(ValueError, InstructorError): class ResponseParsingError (line 482) | class ResponseParsingError(ValueError, InstructorError): method __init__ (line 523) | def __init__( class MultimodalError (line 537) | class MultimodalError(ValueError, InstructorError): method __init__ (line 585) | def __init__( FILE: instructor/core/hooks.py class HookName (line 12) | class HookName(Enum): class CompletionKwargsHandler (line 21) | class CompletionKwargsHandler(Protocol): method __call__ (line 24) | def __call__(self, *args: Any, **kwargs: Any) -> None: ... class CompletionResponseHandler (line 27) | class CompletionResponseHandler(Protocol): method __call__ (line 30) | def __call__(self, response: Any) -> None: ... class CompletionErrorHandler (line 33) | class CompletionErrorHandler(Protocol): method __call__ (line 36) | def __call__(self, error: Exception) -> None: ... class ParseErrorHandler (line 39) | class ParseErrorHandler(Protocol): method __call__ (line 42) | def __call__(self, error: Exception) -> None: ... class Hooks (line 66) | class Hooks: method __init__ (line 74) | def __init__(self) -> None: method on (line 78) | def on( method get_hook_name (line 108) | def get_hook_name(self, hook_name: HookNameType) -> HookName: method emit (line 128) | def emit(self, hook_name: HookName, *args: Any, **kwargs: Any) -> None: method emit_completion_arguments (line 147) | def emit_completion_arguments(self, *args: Any, **kwargs: Any) -> None: method emit_completion_response (line 157) | def emit_completion_response(self, response: Any) -> None: method emit_completion_error (line 166) | def emit_completion_error(self, error: Exception) -> None: method emit_completion_last_attempt (line 175) | def emit_completion_last_attempt(self, error: Exception) -> None: method emit_parse_error (line 184) | def emit_parse_error(self, error: Exception) -> None: method off (line 193) | def off( method clear (line 212) | def clear( method __add__ (line 229) | def __add__(self, other: Hooks) -> Hooks: method __iadd__ (line 266) | def __iadd__(self, other: Hooks) -> Hooks: method combine (line 298) | def combine(cls, *hooks_instances: Hooks) -> Hooks: method copy (line 331) | def copy(self) -> Hooks: FILE: instructor/core/patch.py class InstructorChatCompletionCreate (line 37) | class InstructorChatCompletionCreate(Protocol): method __call__ (line 38) | def __call__( class AsyncInstructorChatCompletionCreate (line 49) | class AsyncInstructorChatCompletionCreate(Protocol): method __call__ (line 50) | async def __call__( function handle_context (line 61) | def handle_context( function patch (line 90) | def patch( function patch (line 97) | def patch( function patch (line 104) | def patch( function patch (line 111) | def patch( function patch (line 117) | def patch( # type: ignore function apatch (line 293) | def apatch(client: AsyncOpenAI, mode: Mode = Mode.TOOLS) -> AsyncOpenAI: FILE: instructor/core/retry.py function initialize_retrying (line 48) | def initialize_retrying( function initialize_usage (line 91) | def initialize_usage(mode: Mode) -> CompletionUsage | Any: function extract_messages (line 122) | def extract_messages(kwargs: dict[str, Any]) -> Any: function retry_sync (line 143) | def retry_sync( function retry_async (line 299) | async def retry_async( FILE: instructor/distil.py class OpenAIChatKwargs (line 30) | class OpenAIChatKwargs(TypedDict): class FinetuneFormat (line 35) | class FinetuneFormat(enum.Enum): function get_signature_from_fn (line 40) | def get_signature_from_fn(fn: Callable[..., Any]) -> str: function format_function (line 66) | def format_function(func: Callable[..., Any]) -> str: function is_return_type_base_model_or_instance (line 85) | def is_return_type_base_model_or_instance(func: Callable[..., Any]) -> b... class Instructions (line 99) | class Instructions: method __init__ (line 100) | def __init__( method distil (line 132) | def distil( method track (line 211) | def track( method openai_kwargs (line 259) | def openai_kwargs( FILE: instructor/dsl/citation.py class CitationMixin (line 5) | class CitationMixin(BaseModel): method validate_sources (line 61) | def validate_sources(self, info: ValidationInfo) -> "CitationMixin": method _get_span (line 78) | def _get_span( method get_spans (line 95) | def get_spans(self, context: str) -> Generator[tuple[int, int], None, ... FILE: instructor/dsl/iterable.py class IterableBase (line 21) | class IterableBase: method from_streaming_response (line 25) | def from_streaming_response( method from_streaming_response_async (line 48) | async def from_streaming_response_async( method tasks_from_mistral_chunks (line 64) | async def tasks_from_mistral_chunks( method tasks_from_chunks (line 83) | def tasks_from_chunks( method tasks_from_chunks_async (line 105) | async def tasks_from_chunks_async( method extract_cls_task_type (line 127) | def extract_cls_task_type( method extract_json (line 148) | def extract_json( method extract_json_async (line 364) | async def extract_json_async( method get_object (line 569) | def get_object(s: str, stack: int) -> tuple[Optional[str], str]: function IterableModel (line 581) | def IterableModel( FILE: instructor/dsl/json_tracker.py function is_json_complete (line 16) | def is_json_complete(json_str: str) -> bool: class JsonCompleteness (line 31) | class JsonCompleteness: method __init__ (line 54) | def __init__(self) -> None: method analyze (line 57) | def analyze(self, json_str: str) -> None: method _mark_all (line 80) | def _mark_all(self, data: Any, path: str) -> None: method _check_siblings (line 91) | def _check_siblings(self, data: Any, path: str) -> None: method is_path_complete (line 119) | def is_path_complete(self, path: str) -> bool: method get_complete_paths (line 132) | def get_complete_paths(self) -> set[str]: method is_root_complete (line 136) | def is_root_complete(self) -> bool: FILE: instructor/dsl/maybe.py class MaybeBase (line 7) | class MaybeBase(BaseModel, Generic[T]): method __bool__ (line 16) | def __bool__(self) -> bool: function Maybe (line 20) | def Maybe(model: type[T]) -> type[MaybeBase[T]]: FILE: instructor/dsl/parallel.py class ParallelBase (line 27) | class ParallelBase: method __init__ (line 28) | def __init__(self, *models: type[BaseModel]): method from_response (line 37) | def from_response( class VertexAIParallelBase (line 55) | class VertexAIParallelBase(ParallelBase): method from_response (line 56) | def from_response( function is_union_type (line 90) | def is_union_type(typehint: type[Iterable[T]]) -> bool: function is_union_type (line 95) | def is_union_type(typehint: type[Iterable[T]]) -> bool: function get_types_array (line 99) | def get_types_array(typehint: type[Iterable[T]]) -> tuple[type[T], ...]: function handle_parallel_model (line 114) | def handle_parallel_model(typehint: type[Iterable[T]]) -> list[dict[str,... function handle_anthropic_parallel_model (line 125) | def handle_anthropic_parallel_model( function ParallelModel (line 135) | def ParallelModel(typehint: type[Iterable[T]]) -> ParallelBase: function VertexAIParallelModel (line 140) | def VertexAIParallelModel(typehint: type[Iterable[T]]) -> VertexAIParall... class AnthropicParallelBase (line 145) | class AnthropicParallelBase(ParallelBase): method from_response (line 146) | def from_response( function AnthropicParallelModel (line 171) | def AnthropicParallelModel(typehint: type[Iterable[T]]) -> AnthropicPara... FILE: instructor/dsl/partial.py class MakeFieldsOptional (line 52) | class MakeFieldsOptional: class PartialLiteralMixin (line 56) | class PartialLiteralMixin: method __init_subclass__ (line 67) | def __init_subclass__(cls, **kwargs: Any) -> None: function remove_control_chars (line 78) | def remove_control_chars(s): function process_potential_object (line 82) | def process_potential_object(potential_object, partial_mode, partial_mod... function _build_partial_object (line 117) | def _build_partial_object( function _build_partial_list (line 188) | def _build_partial_list( function _process_generic_arg (line 223) | def _process_generic_arg( function _make_field_optional (line 262) | def _make_field_optional( class PartialBase (line 299) | class PartialBase(Generic[T_Model]): method get_partial_model (line 302) | def get_partial_model(cls) -> type[T_Model]: method from_streaming_response (line 338) | def from_streaming_response( method from_streaming_response_async (line 352) | async def from_streaming_response_async( method writer_model_from_chunks (line 368) | def writer_model_from_chunks( method writer_model_from_chunks_async (line 404) | async def writer_model_from_chunks_async( method model_from_chunks (line 440) | def model_from_chunks( method model_from_chunks_async (line 475) | async def model_from_chunks_async( method extract_json (line 510) | def extract_json( method extract_json_async (line 739) | async def extract_json_async( class Partial (line 963) | class Partial(Generic[T_Model]): method __new__ (line 973) | def __new__( method __init_subclass__ (line 985) | def __init_subclass__( method __class_getitem__ (line 997) | def __class_getitem__( FILE: instructor/dsl/response_list.py class ListResponse (line 14) | class ListResponse(list[T], Generic[T]): method __init__ (line 24) | def __init__(self, iterable=(), _raw_response: Any | None = None): # ... method from_list (line 29) | def from_list(cls, items: list[T], *, raw_response: Any | None) -> Lis... method get_raw_response (line 32) | def get_raw_response(self) -> Any | None: method __getitem__ (line 35) | def __getitem__(self, key): # type: ignore[no-untyped-def] FILE: instructor/dsl/simple_type.py class AdapterBase (line 17) | class AdapterBase(BaseModel): class ModelAdapter (line 21) | class ModelAdapter(typing.Generic[T]): method __class_getitem__ (line 26) | def __class_getitem__(cls, response_model: type[BaseModel]) -> type[Ba... function validateIsSubClass (line 39) | def validateIsSubClass(response_model: type): function is_simple_type (line 61) | def is_simple_type( FILE: instructor/dsl/validators.py function __getattr__ (line 7) | def __getattr__(name: str): FILE: instructor/hooks.py function __getattr__ (line 9) | def __getattr__(name: str): FILE: instructor/mode.py class Mode (line 9) | class Mode(enum.Enum): method tool_modes (line 76) | def tool_modes(cls) -> set["Mode"]: method json_modes (line 104) | def json_modes(cls) -> set["Mode"]: method warn_mode_functions_deprecation (line 126) | def warn_mode_functions_deprecation(cls): FILE: instructor/multimodal.py function __getattr__ (line 9) | def __getattr__(name: str): FILE: instructor/patch.py function __getattr__ (line 9) | def __getattr__(name: str): FILE: instructor/process_response.py function __getattr__ (line 9) | def __getattr__(name: str): FILE: instructor/processing/function_calls.py function _handle_incomplete_output (line 42) | def _handle_incomplete_output(completion: Any) -> None: function _extract_text_content (line 55) | def _extract_text_content(completion: Any) -> str: function _validate_model_from_json (line 81) | def _validate_model_from_json( class OpenAISchema (line 113) | class OpenAISchema(BaseModel): method openai_schema (line 118) | def openai_schema(cls) -> dict[str, Any]: method anthropic_schema (line 131) | def anthropic_schema(cls) -> dict[str, Any]: method gemini_schema (line 136) | def gemini_schema(cls) -> Any: method from_response (line 141) | def from_response( method parse_genai_structured_outputs (line 266) | def parse_genai_structured_outputs( method parse_genai_tools (line 277) | def parse_genai_tools( method parse_cohere_json_schema (line 308) | def parse_cohere_json_schema( method parse_anthropic_tools (line 358) | def parse_anthropic_tools( method parse_anthropic_json (line 384) | def parse_anthropic_json( method parse_bedrock_json (line 427) | def parse_bedrock_json( method parse_bedrock_tools (line 454) | def parse_bedrock_tools( method parse_gemini_json (line 490) | def parse_gemini_json( method parse_vertexai_tools (line 523) | def parse_vertexai_tools( method parse_vertexai_json (line 536) | def parse_vertexai_json( method parse_cohere_tools (line 547) | def parse_cohere_tools( method parse_writer_tools (line 636) | def parse_writer_tools( method parse_writer_json (line 658) | def parse_writer_json( method parse_functions (line 678) | def parse_functions( method parse_responses_tools (line 695) | def parse_responses_tools( method parse_tools (line 723) | def parse_tools( method parse_mistral_structured_outputs (line 751) | def parse_mistral_structured_outputs( method parse_json (line 770) | def parse_json( function openai_schema (line 793) | def openai_schema(cls: type[BaseModel]) -> OpenAISchema: FILE: instructor/processing/multimodal.py class ImageParamsBase (line 50) | class ImageParamsBase(TypedDict): class ImageParams (line 55) | class ImageParams(ImageParamsBase, total=False): class Image (line 59) | class Image(BaseModel): method autodetect (line 69) | def autodetect(cls, source: str | Path) -> Image: method autodetect_safely (line 93) | def autodetect_safely(cls, source: Union[str, Path]) -> Union[Image, s... method is_base64 (line 108) | def is_base64(cls, s: str) -> bool: method from_base64 (line 112) | def from_base64(cls, data_uri: str) -> Image: method from_gs_url (line 127) | def from_gs_url(cls, data_uri: str, timeout: int = 30) -> Image: method from_raw_base64 (line 156) | def from_raw_base64(cls, data: str) -> Image: method from_url (line 186) | def from_url(cls, url: str) -> Image: method from_path (line 208) | def from_path(cls, path: Union[str, Path]) -> Image: # noqa: UP007 method url_to_base64 (line 225) | def url_to_base64(url: str) -> str: method to_anthropic (line 232) | def to_anthropic(self) -> dict[str, Any]: method to_openai (line 249) | def to_openai(self, mode: Mode) -> dict[str, Any]: method to_genai (line 279) | def to_genai(self): class Audio (line 316) | class Audio(BaseModel): method autodetect (line 326) | def autodetect(cls, source: str | Path) -> Audio: method autodetect_safely (line 350) | def autodetect_safely(cls, source: Union[str, Path]) -> Union[Audio, s... method is_base64 (line 365) | def is_base64(cls, s: str) -> bool: method from_base64 (line 369) | def from_base64(cls, data_uri: str) -> Audio: method from_url (line 381) | def from_url(cls, url: str) -> Audio: method from_path (line 395) | def from_path(cls, path: Union[str, Path]) -> Audio: # noqa: UP007 method from_gs_url (line 418) | def from_gs_url(cls, data_uri: str, timeout: int = 30) -> Audio: method to_openai (line 446) | def to_openai(self, mode: Mode) -> dict[str, Any]: method to_anthropic (line 456) | def to_anthropic(self) -> dict[str, Any]: method to_genai (line 459) | def to_genai(self): class ImageWithCacheControl (line 476) | class ImageWithCacheControl(Image): method from_image_params (line 484) | def from_image_params(cls, image_params: ImageParams) -> Image: method to_anthropic (line 495) | def to_anthropic(self) -> dict[str, Any]: class PDF (line 503) | class PDF(BaseModel): method autodetect (line 511) | def autodetect(cls, source: str | Path) -> PDF: method autodetect_safely (line 555) | def autodetect_safely(cls, source: Union[str, Path]) -> Union[PDF, str... method is_base64 (line 570) | def is_base64(cls, s: str) -> bool: method from_base64 (line 574) | def from_base64(cls, data_uri: str) -> PDF: method from_path (line 587) | def from_path(cls, path: str | Path) -> PDF: method from_raw_base64 (line 603) | def from_raw_base64(cls, data: str) -> PDF: method from_gs_url (line 618) | def from_gs_url(cls, data_uri: str, timeout: int = 30) -> PDF: method from_url (line 648) | def from_url(cls, url: str) -> PDF: method to_mistral (line 665) | def to_mistral(self) -> dict[str, Any]: method to_openai (line 677) | def to_openai(self, mode: Mode) -> dict[str, Any]: method to_anthropic (line 734) | def to_anthropic(self) -> dict[str, Any]: method to_genai (line 762) | def to_genai(self): method to_bedrock (line 791) | def to_bedrock(self, name: str | None = None) -> dict[str, Any]: class PDFWithCacheControl (line 864) | class PDFWithCacheControl(PDF): method to_anthropic (line 867) | def to_anthropic(self) -> dict[str, Any]: class PDFWithGenaiFile (line 874) | class PDFWithGenaiFile(PDF): method from_new_genai_file (line 876) | def from_new_genai_file( method from_existing_genai_file (line 899) | def from_existing_genai_file(cls, file_name: str) -> PDFWithGenaiFile: method to_genai (line 916) | def to_genai(self): function convert_contents (line 937) | def convert_contents( function autodetect_media (line 985) | def autodetect_media( function convert_messages (line 1025) | def convert_messages( function extract_genai_multimodal_content (line 1093) | def extract_genai_multimodal_content( FILE: instructor/processing/response.py function process_response_async (line 173) | async def process_response_async( function process_response (line 279) | def process_response( function is_typed_dict (line 397) | def is_typed_dict(cls) -> bool: function handle_response_model (line 405) | def handle_response_model( function handle_reask_kwargs (line 528) | def handle_reask_kwargs( FILE: instructor/processing/schema.py function generate_openai_schema (line 27) | def generate_openai_schema(model: type[BaseModel]) -> dict[str, Any]: function generate_anthropic_schema (line 74) | def generate_anthropic_schema(model: type[BaseModel]) -> dict[str, Any]: function generate_gemini_schema (line 94) | def generate_gemini_schema(model: type[BaseModel]) -> Any: FILE: instructor/processing/validators.py class Validator (line 10) | class Validator(OpenAISchema): FILE: instructor/providers/anthropic/client.py function from_anthropic (line 10) | def from_anthropic( function from_anthropic (line 21) | def from_anthropic( function from_anthropic (line 33) | def from_anthropic( FILE: instructor/providers/anthropic/utils.py class SystemMessage (line 17) | class SystemMessage(TypedDict, total=False): function combine_system_messages (line 23) | def combine_system_messages( function extract_system_messages (line 80) | def extract_system_messages(messages: list[dict[str, Any]]) -> list[Syst... function reask_anthropic_tools (line 137) | def reask_anthropic_tools( function reask_anthropic_json (line 198) | def reask_anthropic_json( function handle_anthropic_message_conversion (line 243) | def handle_anthropic_message_conversion(new_kwargs: dict[str, Any]) -> d... function handle_anthropic_tools (line 264) | def handle_anthropic_tools( function handle_anthropic_reasoning_tools (line 314) | def handle_anthropic_reasoning_tools( function handle_anthropic_json (line 364) | def handle_anthropic_json( function handle_anthropic_parallel_tools (line 425) | def handle_anthropic_parallel_tools( FILE: instructor/providers/bedrock/client.py function from_bedrock (line 13) | def from_bedrock( function from_bedrock (line 22) | def from_bedrock( function handle_bedrock_json (line 30) | def handle_bedrock_json( function from_bedrock (line 41) | def from_bedrock( FILE: instructor/providers/bedrock/utils.py function generate_bedrock_schema (line 19) | def generate_bedrock_schema(response_model: type[Any]) -> dict[str, Any]: function reask_bedrock_json (line 46) | def reask_bedrock_json( function reask_bedrock_tools (line 73) | def reask_bedrock_tools( function _normalize_bedrock_image_format (line 135) | def _normalize_bedrock_image_format(mime_or_ext: str) -> str: function _openai_image_part_to_bedrock (line 156) | def _openai_image_part_to_bedrock(part: dict[str, Any]) -> dict[str, Any]: function _to_bedrock_content_items (line 213) | def _to_bedrock_content_items(content: Any) -> list[dict[str, Any]]: function _prepare_bedrock_converse_kwargs_internal (line 285) | def _prepare_bedrock_converse_kwargs_internal( function handle_bedrock_json (line 417) | def handle_bedrock_json( function handle_bedrock_tools (line 456) | def handle_bedrock_tools( FILE: instructor/providers/cerebras/client.py function from_cerebras (line 13) | def from_cerebras( function from_cerebras (line 21) | def from_cerebras( function from_cerebras (line 28) | def from_cerebras( FILE: instructor/providers/cerebras/utils.py function reask_cerebras_tools (line 16) | def reask_cerebras_tools( function handle_cerebras_tools (line 44) | def handle_cerebras_tools( function handle_cerebras_json (line 70) | def handle_cerebras_json( FILE: instructor/providers/cohere/client.py function from_cohere (line 18) | def from_cohere( function from_cohere (line 26) | def from_cohere( function from_cohere (line 34) | def from_cohere( function from_cohere (line 42) | def from_cohere( function from_cohere (line 49) | def from_cohere( FILE: instructor/providers/cohere/utils.py function reask_cohere_tools (line 14) | def reask_cohere_tools( function handle_cohere_modes (line 92) | def handle_cohere_modes(new_kwargs: dict[str, Any]) -> tuple[None, dict[... function handle_cohere_json_schema (line 145) | def handle_cohere_json_schema( function handle_cohere_tools (line 180) | def handle_cohere_tools( FILE: instructor/providers/fireworks/client.py function from_fireworks (line 19) | def from_fireworks( function from_fireworks (line 27) | def from_fireworks( function from_fireworks (line 34) | def from_fireworks( FILE: instructor/providers/fireworks/utils.py function reask_fireworks_tools (line 16) | def reask_fireworks_tools(kwargs: dict[str, Any], response: Any, excepti... function reask_fireworks_json (line 40) | def reask_fireworks_json( function handle_fireworks_tools (line 63) | def handle_fireworks_tools( function handle_fireworks_json (line 89) | def handle_fireworks_json( FILE: instructor/providers/gemini/client.py function from_gemini (line 11) | def from_gemini( function from_gemini (line 20) | def from_gemini( function from_gemini (line 28) | def from_gemini( FILE: instructor/providers/gemini/utils.py function _get_model_schema (line 27) | def _get_model_schema(response_model: Any) -> dict[str, Any]: function _get_model_name (line 48) | def _get_model_name(response_model: Any) -> str: function transform_to_gemini_prompt (line 64) | def transform_to_gemini_prompt( function verify_no_unions (line 131) | def verify_no_unions(obj: dict[str, Any]) -> bool: # noqa: ARG001 function map_to_gemini_function_schema (line 153) | def map_to_gemini_function_schema(obj: dict[str, Any]) -> dict[str, Any]: function map_to_genai_schema (line 243) | def map_to_genai_schema(obj: dict[str, Any]) -> genai_types.Schema: function update_genai_kwargs (line 275) | def update_genai_kwargs( function update_gemini_kwargs (line 470) | def update_gemini_kwargs(kwargs: dict[str, Any]) -> dict[str, Any]: function extract_genai_system_message (line 546) | def extract_genai_system_message( function convert_to_genai_messages (line 581) | def convert_to_genai_messages( function reask_gemini_tools (line 651) | def reask_gemini_tools( function reask_gemini_json (line 694) | def reask_gemini_json( function reask_vertexai_tools (line 717) | def reask_vertexai_tools( function reask_vertexai_json (line 739) | def reask_vertexai_json( function reask_genai_tools (line 770) | def reask_genai_tools( function reask_genai_structured_outputs (line 847) | def reask_genai_structured_outputs( function handle_genai_message_conversion (line 881) | def handle_genai_message_conversion( function handle_gemini_json (line 920) | def handle_gemini_json( function handle_gemini_tools (line 974) | def handle_gemini_tools( function handle_genai_structured_outputs (line 1009) | def handle_genai_structured_outputs( function handle_genai_tools (line 1096) | def handle_genai_tools( function handle_vertexai_parallel_tools (line 1196) | def handle_vertexai_parallel_tools( function handle_vertexai_tools (line 1226) | def handle_vertexai_tools( function handle_vertexai_json (line 1252) | def handle_vertexai_json( FILE: instructor/providers/genai/client.py function from_genai (line 12) | def from_genai( function from_genai (line 21) | def from_genai( function from_genai (line 29) | def from_genai( FILE: instructor/providers/groq/client.py function from_groq (line 10) | def from_groq( function from_groq (line 18) | def from_groq( function from_groq (line 25) | def from_groq( FILE: instructor/providers/mistral/client.py function from_mistral (line 11) | def from_mistral( function from_mistral (line 20) | def from_mistral( function from_mistral (line 28) | def from_mistral( FILE: instructor/providers/mistral/utils.py function reask_mistral_structured_outputs (line 16) | def reask_mistral_structured_outputs( function reask_mistral_tools (line 46) | def reask_mistral_tools( function handle_mistral_tools (line 74) | def handle_mistral_tools( function handle_mistral_structured_outputs (line 94) | def handle_mistral_structured_outputs( FILE: instructor/providers/openai/utils.py function _is_stream_response (line 22) | def _is_stream_response(response: Any) -> bool: function _filter_responses_tool_calls (line 31) | def _filter_responses_tool_calls(output_items: list[Any]) -> list[Any]: function _format_responses_tool_call_details (line 44) | def _format_responses_tool_call_details(tool_call: Any) -> str: function reask_tools (line 62) | def reask_tools( function reask_responses_tools (line 106) | def reask_responses_tools( function reask_md_json (line 151) | def reask_md_json( function reask_default (line 187) | def reask_default( function handle_parallel_tools (line 228) | def handle_parallel_tools( function handle_functions (line 271) | def handle_functions( function handle_tools_strict (line 295) | def handle_tools_strict( function handle_tools (line 320) | def handle_tools( function handle_responses_tools (line 348) | def handle_responses_tools( function handle_responses_tools_with_inbuilt_tools (line 402) | def handle_responses_tools_with_inbuilt_tools( function handle_json_o1 (line 452) | def handle_json_o1( function handle_json_modes (line 491) | def handle_json_modes( function handle_openrouter_structured_outputs (line 559) | def handle_openrouter_structured_outputs( FILE: instructor/providers/perplexity/client.py function from_perplexity (line 9) | def from_perplexity( function from_perplexity (line 17) | def from_perplexity( function from_perplexity (line 24) | def from_perplexity( FILE: instructor/providers/perplexity/utils.py function reask_perplexity_json (line 15) | def reask_perplexity_json( function handle_perplexity_json (line 38) | def handle_perplexity_json( FILE: instructor/providers/vertexai/client.py function _create_gemini_json_schema (line 13) | def _create_gemini_json_schema(model: type[BaseModel]) -> dict[str, Any]: function _create_vertexai_tool (line 30) | def _create_vertexai_tool( function vertexai_message_parser (line 54) | def vertexai_message_parser( function _vertexai_message_list_parser (line 79) | def _vertexai_message_list_parser( function vertexai_function_response_parser (line 89) | def vertexai_function_response_parser( function vertexai_process_response (line 104) | def vertexai_process_response( function vertexai_process_json_response (line 121) | def vertexai_process_json_response(_kwargs: dict[str, Any], model: type[... function from_vertexai (line 138) | def from_vertexai( FILE: instructor/providers/writer/client.py function from_writer (line 11) | def from_writer( function from_writer (line 19) | def from_writer( function from_writer (line 26) | def from_writer( FILE: instructor/providers/writer/utils.py function reask_writer_tools (line 16) | def reask_writer_tools( function reask_writer_json (line 45) | def reask_writer_json( function handle_writer_tools (line 69) | def handle_writer_tools( function handle_writer_json (line 89) | def handle_writer_json( FILE: instructor/providers/xai/client.py function _raise_xai_sdk_missing (line 17) | def _raise_xai_sdk_missing() -> None: function _get_model_schema (line 27) | def _get_model_schema(response_model: Any) -> dict[str, Any]: function _get_model_name (line 48) | def _get_model_name(response_model: Any) -> str: function _finalize_parsed_response (line 61) | def _finalize_parsed_response(parsed: Any, raw_response: Any) -> Any: function from_xai (line 87) | def from_xai( function from_xai (line 95) | def from_xai( function from_xai (line 102) | def from_xai( FILE: instructor/providers/xai/utils.py function _convert_messages (line 22) | def _convert_messages(messages: list[dict[str, Any]]): function reask_xai_json (line 54) | def reask_xai_json( function reask_xai_tools (line 74) | def reask_xai_tools( function handle_xai_json (line 103) | def handle_xai_json( function handle_xai_tools (line 134) | def handle_xai_tools( FILE: instructor/templating.py function apply_template (line 9) | def apply_template(text: str, context: dict[str, Any]) -> str: function process_message (line 14) | def process_message( function handle_templating (line 84) | def handle_templating( FILE: instructor/utils/__init__.py function __getattr__ (line 60) | def __getattr__(name): FILE: instructor/utils/core.py function extract_json_from_codeblock (line 43) | def extract_json_from_codeblock(content: str) -> str: function extract_json_from_stream (line 68) | def extract_json_from_stream( function extract_json_from_stream_async (line 197) | async def extract_json_from_stream_async( function update_total_usage (line 326) | def update_total_usage( function dump_message (line 383) | def dump_message(message: ChatCompletionMessage) -> ChatCompletionMessag... function is_async (line 416) | def is_async(func: Callable[..., Any]) -> bool: function merge_consecutive_messages (line 425) | def merge_consecutive_messages(messages: list[dict[str, Any]]) -> list[d... class classproperty (line 485) | class classproperty(Generic[R_co]): method __init__ (line 499) | def __init__(self, method: Callable[[Any], R_co]) -> None: method __get__ (line 502) | def __get__(self, instance: object, cls: type[Any]) -> R_co: function get_message_content (line 506) | def get_message_content(message: ChatCompletionMessageParam) -> list[Any]: function disable_pydantic_error_url (line 533) | def disable_pydantic_error_url(): function is_typed_dict (line 564) | def is_typed_dict(cls) -> bool: function is_simple_type (line 572) | def is_simple_type(typehint: type[T]) -> bool: function prepare_response_model (line 579) | def prepare_response_model(response_model: type[T] | None) -> type[T] | ... FILE: instructor/utils/providers.py class Provider (line 9) | class Provider(Enum): function get_provider (line 32) | def get_provider(base_url: str) -> Provider: FILE: instructor/validation/async_validators.py class AsyncValidationContext (line 11) | class AsyncValidationContext: method __init__ (line 14) | def __init__(self, context: dict[str, Any]): function async_field_validator (line 18) | def async_field_validator(field: str, *fields: str) -> Callable[[T], T]: function async_model_validator (line 43) | def async_model_validator() -> Callable[[T], T]: FILE: instructor/validation/llm_validators.py function llm_validator (line 9) | def llm_validator( function openai_moderation (line 79) | def openai_moderation(client: OpenAI) -> Callable[[str], str]: FILE: instructor/validators.py function __getattr__ (line 9) | def __getattr__(name: str): FILE: scripts/audit_patterns.py function find_markdown_files (line 18) | def find_markdown_files(docs_dir: Path) -> List[Path]: function audit_api_calls (line 23) | def audit_api_calls(content: str, file_path: Path) -> Dict[str, List[int]]: function audit_old_init_patterns (line 42) | def audit_old_init_patterns(content: str, file_path: Path) -> Dict[str, ... function audit_unused_imports (line 62) | def audit_unused_imports(content: str, file_path: Path) -> Dict[str, Lis... function process_file (line 94) | def process_file(file_path: Path) -> Dict[str, Dict[str, List[int]]]: function main (line 109) | def main(): FILE: scripts/check_blog_excerpts.py function check_blog_excerpts (line 16) | def check_blog_excerpts(blog_posts_dir: str = "docs/blog/posts") -> bool: function main (line 78) | def main(): FILE: scripts/check_links.py function find_markdown_files (line 16) | def find_markdown_files(docs_dir: Path) -> list[Path]: function extract_links (line 21) | def extract_links(content: str, file_path: Path) -> list[tuple[str, int]... function resolve_link (line 45) | def resolve_link(link_url: str, source_file: Path, docs_dir: Path) -> tu... function check_file (line 69) | def check_file(file_path: Path, docs_dir: Path) -> dict[str, list[tuple[... function find_orphaned_pages (line 91) | def find_orphaned_pages(files: list[Path], docs_dir: Path) -> set[Path]: function main (line 124) | def main(): FILE: scripts/fix_api_calls.py function find_markdown_files (line 17) | def find_markdown_files(docs_dir: Path) -> list[Path]: function replace_api_calls (line 22) | def replace_api_calls(content: str, dry_run: bool = False) -> tuple[str,... function process_file (line 52) | def process_file(file_path: Path, dry_run: bool = False) -> int: function main (line 71) | def main(): FILE: scripts/fix_doc_tests.py function run_update (line 17) | def run_update(test_file: str) -> bool: FILE: scripts/fix_old_patterns.py function find_markdown_files (line 48) | def find_markdown_files(docs_dir: Path) -> List[Path]: function extract_model_name (line 53) | def extract_model_name(content: str, match_start: int, match_end: int) -... function replace_from_pattern (line 74) | def replace_from_pattern( function replace_patch_pattern (line 110) | def replace_patch_pattern(content: str, dry_run: bool = False) -> Tuple[... function replace_old_patterns (line 179) | def replace_old_patterns(content: str, dry_run: bool = False) -> Tuple[s... function process_file (line 203) | def process_file(file_path: Path, dry_run: bool = False) -> int: function main (line 222) | def main(): FILE: scripts/make_clean.py function clean_markdown_content (line 17) | def clean_markdown_content(content: str) -> str: function process_markdown_files (line 48) | def process_markdown_files(docs_dir: str = "docs", dry_run: bool = False... function main (line 125) | def main(): FILE: scripts/make_desc.py function generate_ai_frontmatter (line 17) | async def generate_ai_frontmatter( function get_all_categories (line 75) | def get_all_categories(root_dir: str) -> set[str]: function preview_categories (line 96) | def preview_categories(root_dir: str) -> None: function process_file (line 115) | async def process_file( function process_files (line 144) | async def process_files( function main (line 186) | def main( FILE: scripts/make_sitemap.py function traverse_docs (line 18) | def traverse_docs( function extract_markdown_links (line 43) | def extract_markdown_links(content: str) -> list[str]: function normalize_path (line 72) | def normalize_path(path: str, current_path: str) -> str: function analyze_content (line 107) | async def analyze_content( function generate_sitemap (line 187) | async def generate_sitemap( function main (line 301) | def main( FILE: scripts/validate_headings.py function find_markdown_files (line 17) | def find_markdown_files(docs_dir: Path) -> list[Path]: function extract_headings (line 22) | def extract_headings(content: str) -> list[tuple[int, str, int]]: function validate_headings (line 43) | def validate_headings(headings: list[tuple[int, str, int]]) -> dict[str,... function process_file (line 76) | def process_file(file_path: Path) -> dict[str, list[str]]: function main (line 86) | def main(): FILE: scripts/validate_meta_tags.py function find_markdown_files (line 19) | def find_markdown_files(docs_dir: Path) -> List[Path]: function extract_frontmatter (line 24) | def extract_frontmatter(content: str) -> Dict[str, str]: function validate_file (line 53) | def validate_file(file_path: Path) -> Dict[str, List[str]]: function main (line 101) | def main(): FILE: tests/docs/_concept_groups.py function concept_paths (line 60) | def concept_paths(names: Iterable[str]) -> list[str]: function all_concept_files (line 64) | def all_concept_files() -> list[str]: function core_concept_files (line 68) | def core_concept_files() -> list[str]: function collect_examples (line 75) | def collect_examples(files: Iterable[str]): FILE: tests/docs/_example_groups.py function example_paths (line 43) | def example_paths(names: Iterable[str]) -> list[str]: function all_example_files (line 47) | def all_example_files() -> list[str]: function core_example_files (line 51) | def core_example_files() -> list[str]: function collect_examples (line 58) | def collect_examples(files: Iterable[str]): FILE: tests/docs/conftest.py function pytest_addoption (line 9) | def pytest_addoption(parser: pytest.Parser) -> None: function eval_example (line 19) | def eval_example( FILE: tests/docs/test_concepts.py function test_format_concepts_core (line 10) | def test_format_concepts_core(example: CodeExample, eval_example: EvalEx... FILE: tests/docs/test_concepts_advanced.py function test_format_concepts_advanced (line 10) | def test_format_concepts_advanced(example: CodeExample, eval_example: Ev... FILE: tests/docs/test_concepts_operations.py function test_format_concepts_operations (line 10) | def test_format_concepts_operations(example: CodeExample, eval_example: ... FILE: tests/docs/test_concepts_providers.py function test_format_concepts_providers (line 10) | def test_format_concepts_providers(example: CodeExample, eval_example: E... FILE: tests/docs/test_docs.py function test_readme (line 6) | def test_readme(example: CodeExample, eval_example: EvalExample): function test_index (line 14) | def test_index(example: CodeExample, eval_example: EvalExample): FILE: tests/docs/test_examples.py function test_index (line 9) | def test_index(example: CodeExample, eval_example: EvalExample): FILE: tests/docs/test_examples_batch.py function test_examples_batch (line 10) | def test_examples_batch(example: CodeExample, eval_example: EvalExample): FILE: tests/docs/test_examples_integrations.py function test_examples_integrations (line 10) | def test_examples_integrations(example: CodeExample, eval_example: EvalE... FILE: tests/docs/test_examples_multimodal.py function test_examples_multimodal (line 10) | def test_examples_multimodal(example: CodeExample, eval_example: EvalExa... FILE: tests/docs/test_examples_providers.py function test_examples_providers (line 10) | def test_examples_providers(example: CodeExample, eval_example: EvalExam... FILE: tests/docs/test_hub.py function test_format_blog (line 6) | def test_format_blog(example: CodeExample, eval_example: EvalExample) ->... FILE: tests/docs/test_mkdocs.py function test_files_good (line 12) | def test_files_good(fpath): FILE: tests/docs/test_posts.py function test_index (line 6) | def test_index(example: CodeExample, eval_example: EvalExample): FILE: tests/docs/test_prompt_tips.py function test_format_concepts (line 7) | def test_format_concepts(example: CodeExample, eval_example: EvalExample): FILE: tests/dsl/test_gemini_tools_async_streaming.py function test_sync_extract_json_from_stream_handles_codeblock (line 18) | def test_sync_extract_json_from_stream_handles_codeblock(): function test_async_extract_json_from_stream_handles_codeblock (line 25) | async def test_async_extract_json_from_stream_handles_codeblock(): function test_sync_gemini_tools_mode_triggers_json_extraction (line 36) | def test_sync_gemini_tools_mode_triggers_json_extraction(): function test_async_gemini_tools_mode_triggers_json_extraction (line 43) | def test_async_gemini_tools_mode_triggers_json_extraction(): FILE: tests/dsl/test_partial.py class SampleNestedPartial (line 21) | class SampleNestedPartial(BaseModel): class SamplePartial (line 25) | class SamplePartial(BaseModel): class NestedA (line 30) | class NestedA(BaseModel): class NestedB (line 35) | class NestedB(BaseModel): class UnionWithNested (line 42) | class UnionWithNested(BaseModel): function test_partial (line 48) | def test_partial(): function test_partial_with_whitespace (line 119) | def test_partial_with_whitespace(): function test_async_partial_with_whitespace (line 129) | async def test_async_partial_with_whitespace(): function test_summary_extraction (line 146) | def test_summary_extraction(): function test_summary_extraction_async (line 177) | async def test_summary_extraction_async(): function test_union_with_nested (line 206) | def test_union_with_nested(): function test_partial_with_default_factory (line 213) | def test_partial_with_default_factory(): class TestMakeFieldOptionalWorksWithPydanticV2 (line 244) | class TestMakeFieldOptionalWorksWithPydanticV2: method test_deepcopy_approach_makes_field_optional (line 253) | def test_deepcopy_approach_makes_field_optional(self): method test_make_field_optional_function_works (line 270) | def test_make_field_optional_function_works(self): method test_partial_model_validates_empty_dict (line 286) | def test_partial_model_validates_empty_dict(self): method test_partial_validates_incremental_streaming_data (line 304) | def test_partial_validates_incremental_streaming_data(self): method test_partial_with_all_field_types (line 328) | def test_partial_with_all_field_types(self): class TestLiteralTypeStreaming (line 353) | class TestLiteralTypeStreaming: method test_literal_without_mixin_fails_on_incomplete_string (line 363) | def test_literal_without_mixin_fails_on_incomplete_string(self): method test_literal_with_mixin_incomplete_string_becomes_none (line 380) | def test_literal_with_mixin_incomplete_string_becomes_none(self): method test_literal_accepts_valid_complete_value (line 397) | def test_literal_accepts_valid_complete_value(self): method test_literal_with_missing_field_is_none (line 412) | def test_literal_with_missing_field_is_none(self): method test_literal_rejects_complete_invalid_value (line 426) | def test_literal_rejects_complete_invalid_value(self): class TestPartialStreamingWithComplexTypes (line 440) | class TestPartialStreamingWithComplexTypes: method test_enum_incomplete_string_becomes_none (line 446) | def test_enum_incomplete_string_becomes_none(self): method test_enum_accepts_valid_complete_value (line 464) | def test_enum_accepts_valid_complete_value(self): method test_optional_literal_incomplete_string_becomes_none (line 480) | def test_optional_literal_incomplete_string_becomes_none(self): method test_optional_literal_accepts_valid_value (line 493) | def test_optional_literal_accepts_valid_value(self): method test_union_literal_incomplete_string_becomes_none (line 505) | def test_union_literal_incomplete_string_becomes_none(self): method test_union_literal_accepts_valid_values (line 519) | def test_union_literal_accepts_valid_values(self): method test_union_of_literals_matches_all_branches (line 534) | def test_union_of_literals_matches_all_branches(self): method test_list_literal_incomplete_item_dropped (line 549) | def test_list_literal_incomplete_item_dropped(self): method test_list_literal_accepts_valid_items (line 563) | def test_list_literal_accepts_valid_items(self): class TestDiscriminatedUnionPartial (line 576) | class TestDiscriminatedUnionPartial: method test_discriminated_union_not_compatible_with_partial (line 586) | def test_discriminated_union_not_compatible_with_partial(self): method test_union_without_discriminator_works (line 607) | def test_union_without_discriminator_works(self): method test_single_value_literal_incomplete_string (line 629) | def test_single_value_literal_incomplete_string(self): class TestModelValidatorsDuringStreaming (line 648) | class TestModelValidatorsDuringStreaming: method test_model_validator_skipped_during_streaming (line 656) | def test_model_validator_skipped_during_streaming(self): method test_model_validator_runs_when_complete (line 681) | def test_model_validator_runs_when_complete(self): method test_multiple_model_validators (line 707) | def test_multiple_model_validators(self): method test_validators_run_without_streaming_context (line 743) | def test_validators_run_without_streaming_context(self): class TestFinalValidationAfterStreaming (line 771) | class TestFinalValidationAfterStreaming: method test_final_validation_catches_missing_required_fields (line 778) | def test_final_validation_catches_missing_required_fields(self): method test_final_validation_passes_with_all_required_fields (line 797) | def test_final_validation_passes_with_all_required_fields(self): method test_final_validation_runs_model_validators (line 815) | def test_final_validation_runs_model_validators(self): method test_streaming_yields_partial_objects_before_final_validation (line 839) | def test_streaming_yields_partial_objects_before_final_validation(self): method test_original_model_reference_is_stored (line 865) | def test_original_model_reference_is_stored(self): method test_async_final_validation_catches_missing_required_fields (line 877) | async def test_async_final_validation_catches_missing_required_fields(... class TestRecursiveModels (line 896) | class TestRecursiveModels: method test_basic_recursive_model (line 899) | def test_basic_recursive_model(self): method test_nested_recursive_model (line 917) | def test_nested_recursive_model(self): method test_mutually_recursive_models (line 943) | def test_mutually_recursive_models(self): method test_direct_self_reference (line 969) | def test_direct_self_reference(self): method test_complex_recursive_with_validators (line 989) | def test_complex_recursive_with_validators(self): method test_recursive_with_union_types (line 1092) | def test_recursive_with_union_types(self): FILE: tests/dsl/test_simple_type.py class SimpleTypeTests (line 8) | class SimpleTypeTests(unittest.TestCase): method test_is_simple_type_with_base_model (line 9) | def test_is_simple_type_with_base_model(self): method test_is_simple_type_with_str (line 15) | def test_is_simple_type_with_str(self): method test_is_simple_type_with_int (line 18) | def test_is_simple_type_with_int(self): method test_is_simple_type_with_float (line 21) | def test_is_simple_type_with_float(self): method test_is_simple_type_with_bool (line 24) | def test_is_simple_type_with_bool(self): method test_is_simple_type_with_enum (line 27) | def test_is_simple_type_with_enum(self): method test_is_simple_type_with_annotated (line 33) | def test_is_simple_type_with_annotated(self): method test_is_simple_type_with_literal (line 37) | def test_is_simple_type_with_literal(self): method test_is_simple_type_with_union (line 41) | def test_is_simple_type_with_union(self): method test_is_simple_type_with_iterable (line 45) | def test_is_simple_type_with_iterable(self): FILE: tests/dsl/test_simple_type_fix.py class TestSimpleTypeFix (line 8) | class TestSimpleTypeFix(unittest.TestCase): method test_list_with_union_type (line 9) | def test_list_with_union_type(self): method test_list_with_union_type_alternative_syntax (line 20) | def test_list_with_union_type_alternative_syntax(self): FILE: tests/genai/test_safety_settings.py function test_update_genai_kwargs_safety_settings_with_image_content_uses_image_categories (line 4) | def test_update_genai_kwargs_safety_settings_with_image_content_uses_ima... function test_update_genai_kwargs_maps_text_thresholds_to_image_categories (line 41) | def test_update_genai_kwargs_maps_text_thresholds_to_image_categories(): function test_handle_genai_tools_autodetect_images_uses_image_categories (line 81) | def test_handle_genai_tools_autodetect_images_uses_image_categories(): FILE: tests/llm/shared_config.py function get_available_providers (line 82) | def get_available_providers() -> list[tuple[str, instructor.Mode]]: function pytest_generate_tests (line 114) | def pytest_generate_tests(metafunc): function pytest_configure (line 130) | def pytest_configure(config): function skip_if_provider_unavailable (line 155) | def skip_if_provider_unavailable(provider_name: str): FILE: tests/llm/test_anthropic/test_multimodal.py class ImageDescription (line 11) | class ImageDescription(BaseModel): function test_multimodal_image_description (line 29) | def test_multimodal_image_description(model, mode): function test_multimodal_image_description_autodetect (line 58) | def test_multimodal_image_description_autodetect(model, mode): function test_multimodal_image_description_autodetect_image_params (line 90) | def test_multimodal_image_description_autodetect_image_params(model, mode): function test_multimodal_image_description_autodetect_image_params_cache (line 125) | def test_multimodal_image_description_autodetect_image_params_cache(mode... class LineItem (line 164) | class LineItem(BaseModel): class Receipt (line 170) | class Receipt(BaseModel): function test_multimodal_pdf_file (line 177) | def test_multimodal_pdf_file(model, mode, pdf_source): function test_multimodal_pdf_file_with_cache_control (line 213) | def test_multimodal_pdf_file_with_cache_control(model, mode, pdf_source): FILE: tests/llm/test_anthropic/test_reasoning.py class Answer (line 5) | class Answer(BaseModel): function test_reasoning (line 9) | def test_reasoning(): FILE: tests/llm/test_anthropic/test_system.py class User (line 9) | class User(BaseModel): function test_creation (line 15) | def test_creation(model, mode): function test_creation_with_system_cache (line 42) | def test_creation_with_system_cache(model, mode): function test_creation_with_system_cache_anthropic_style (line 83) | def test_creation_with_system_cache_anthropic_style(model, mode): function test_creation_no_response_model (line 121) | def test_creation_no_response_model(model, mode): FILE: tests/llm/test_bedrock/conftest.py function tiny_png_bytes (line 7) | def tiny_png_bytes() -> bytes: function tiny_png_data_url (line 15) | def tiny_png_data_url(tiny_png_bytes: bytes) -> str: function image_url (line 20) | def image_url() -> str: function tiny_pdf_bytes (line 26) | def tiny_pdf_bytes() -> bytes: FILE: tests/llm/test_bedrock/test_bedrock_native_passthrough.py function test_bedrock_native_text_passthrough (line 5) | def test_bedrock_native_text_passthrough(): function test_bedrock_native_image_passthrough (line 11) | def test_bedrock_native_image_passthrough(tiny_png_bytes: bytes): function test_bedrock_native_document_passthrough (line 17) | def test_bedrock_native_document_passthrough(tiny_pdf_bytes: bytes): FILE: tests/llm/test_bedrock/test_normalize.py function test_normalize_bedrock_image_format (line 25) | def test_normalize_bedrock_image_format(inp, expected): FILE: tests/llm/test_bedrock/test_openai_image_conversion.py function test_openai_image_part_to_bedrock_data_url (line 10) | def test_openai_image_part_to_bedrock_data_url(tiny_png_data_url: str): function test_openai_image_part_to_bedrock_https (line 20) | def test_openai_image_part_to_bedrock_https(image_url: str): function test_to_bedrock_content_items_openai_combo (line 38) | def test_to_bedrock_content_items_openai_combo( FILE: tests/llm/test_bedrock/test_prepare_kwargs.py function test_prepare_bedrock_kwargs_openai_text_plus_image (line 5) | def test_prepare_bedrock_kwargs_openai_text_plus_image(image_url: str): FILE: tests/llm/test_core_providers/capabilities.py function get_provider_name (line 127) | def get_provider_name(model_string: str) -> str: function provider_supports (line 132) | def provider_supports( function skip_if_unsupported (line 151) | def skip_if_unsupported( FILE: tests/llm/test_core_providers/test_basic_extraction.py class User (line 12) | class User(BaseModel): class UserList (line 17) | class UserList(BaseModel): class Address (line 21) | class Address(BaseModel): class UserWithAddress (line 27) | class UserWithAddress(BaseModel): function test_simple_extraction (line 34) | async def test_simple_extraction(provider_config): function test_list_extraction (line 50) | async def test_list_extraction(provider_config): function test_nested_model_extraction (line 72) | async def test_nested_model_extraction(provider_config): function test_extraction_with_field_descriptions (line 97) | async def test_extraction_with_field_descriptions(provider_config): FILE: tests/llm/test_core_providers/test_response_modes.py class Task (line 14) | class Task(BaseModel): function test_create_method (line 21) | async def test_create_method(provider_config): function test_chat_completions_create_method (line 42) | async def test_chat_completions_create_method(provider_config): function test_messages_create_method (line 62) | async def test_messages_create_method(provider_config): function test_create_with_completion (line 82) | async def test_create_with_completion(provider_config): function test_response_model_none (line 105) | async def test_response_model_none(provider_config): FILE: tests/llm/test_core_providers/test_retries.py class ValidatedUser (line 10) | class ValidatedUser(BaseModel): method name_must_have_content (line 16) | def name_must_have_content(cls, v: str) -> str: function test_max_retries_parameter (line 23) | async def test_max_retries_parameter(provider_config): function test_validation_with_retries (line 40) | async def test_validation_with_retries(provider_config): FILE: tests/llm/test_core_providers/test_simple_types.py function test_int (line 18) | async def test_int(provider_config): function test_bool (line 36) | async def test_bool(provider_config): function test_str (line 54) | async def test_str(provider_config): function test_literal (line 72) | async def test_literal(provider_config): function test_union (line 90) | async def test_union(provider_config): function test_enum (line 109) | async def test_enum(provider_config): function test_annotated_int (line 134) | async def test_annotated_int(provider_config): FILE: tests/llm/test_core_providers/test_streaming.py class User (line 16) | class User(BaseModel): class Weather (line 21) | class Weather(BaseModel): class SearchQuery (line 27) | class SearchQuery(BaseModel): function test_partial_streaming (line 33) | async def test_partial_streaming(provider_config): function test_iterable_streaming (line 57) | async def test_iterable_streaming(provider_config): function test_iterable_streaming_with_stream_flag (line 80) | async def test_iterable_streaming_with_stream_flag(provider_config): function test_iterable_union_streaming (line 99) | async def test_iterable_union_streaming(provider_config): function test_create_iterable_method (line 123) | async def test_create_iterable_method(provider_config): FILE: tests/llm/test_core_providers/test_validation.py class UserWithValidation (line 12) | class UserWithValidation(BaseModel): method name_must_not_be_empty (line 18) | def name_must_not_be_empty(cls, v: str) -> str: class Email (line 24) | class Email(BaseModel): method email_must_be_valid (line 29) | def email_must_be_valid(cls, v: str) -> str: class TemperatureReading (line 35) | class TemperatureReading(BaseModel): function test_basic_validation (line 41) | async def test_basic_validation(provider_config): function test_list_with_validation (line 58) | async def test_list_with_validation(provider_config): function test_custom_validator (line 81) | async def test_custom_validator(provider_config): function test_field_constraints (line 97) | async def test_field_constraints(provider_config): function test_max_retries (line 118) | async def test_max_retries(provider_config): FILE: tests/llm/test_gemini/evals/test_extract_users.py class UserDetails (line 8) | class UserDetails(BaseModel): function test_extract (line 22) | def test_extract(model, data, mode): FILE: tests/llm/test_gemini/test_list_content.py class User (line 7) | class User(BaseModel): class UserList (line 12) | class UserList(BaseModel): function test_list_of_strings (line 20) | async def test_list_of_strings(): FILE: tests/llm/test_gemini/test_multimodal_content.py class Description (line 6) | class Description(BaseModel): function test_audio_compatability_list (line 16) | def test_audio_compatability_list(): function test_audio_compatability_multiple_messages (line 37) | def test_audio_compatability_multiple_messages(): FILE: tests/llm/test_genai/conftest.py function client (line 26) | def client(): function aclient (line 31) | def aclient(): function genai_client (line 36) | def genai_client(): FILE: tests/llm/test_genai/test_decimal.py class Receipt (line 8) | class Receipt(BaseModel): method parse_decimals (line 16) | def parse_decimals(cls, v): class Invoice (line 22) | class Invoice(BaseModel): method parse_grand_total (line 28) | def parse_grand_total(cls, v): function test_decimal_extraction (line 36) | def test_decimal_extraction(client, model, mode): function test_decimal_extraction_async (line 76) | async def test_decimal_extraction_async(aclient, model, mode): class SimpleProduct (line 99) | class SimpleProduct(BaseModel): method parse_price (line 105) | def parse_price(cls, v): function test_simple_decimal_extraction (line 113) | def test_simple_decimal_extraction(client, model, mode): FILE: tests/llm/test_genai/test_format.py class User (line 10) | class User(BaseModel): class Users (line 15) | class Users(BaseModel): function test_simple_string_message (line 21) | def test_simple_string_message(client, model, mode): function test_system_prompt (line 36) | def test_system_prompt(client, model, mode): function test_system_kwarg (line 60) | def test_system_kwarg(client, model, mode): function test_system_kwarg_genai (line 81) | def test_system_kwarg_genai(client, model, mode): function test_system_prompt_list (line 106) | def test_system_prompt_list(client, model, mode): function test_format_genai_typed (line 133) | def test_format_genai_typed(client, model, mode): function test_format_string (line 154) | def test_format_string(client, model: str, mode: instructor.Mode, is_lis... FILE: tests/llm/test_genai/test_invalid_schema.py function test_nested (line 15) | def test_nested(mode, model): function test_union (line 43) | def test_union(mode, model): function test_optional_types_allowed (line 64) | def test_optional_types_allowed(): function test_union_types_allowed_schema (line 81) | def test_union_types_allowed_schema(): function test_genai_api_call_with_different_types (line 102) | def test_genai_api_call_with_different_types(mode): function test_genai_api_call_with_nested_models (line 132) | def test_genai_api_call_with_nested_models(mode): function test_genai_api_call_with_different_types_async (line 170) | async def test_genai_api_call_with_different_types_async(mode): function test_genai_api_call_with_nested_models_async (line 201) | async def test_genai_api_call_with_nested_models_async(mode): FILE: tests/llm/test_genai/test_reask.py function test_genai_tools_validation_retry_preserves_model_content (line 8) | def test_genai_tools_validation_retry_preserves_model_content(mode): FILE: tests/llm/test_genai/test_schema_conversion.py class Priority (line 13) | class Priority(Enum): class SimpleModel (line 19) | class SimpleModel(BaseModel): class OptionalModel (line 25) | class OptionalModel(BaseModel): class EnumModel (line 31) | class EnumModel(BaseModel): class NestedModel (line 36) | class NestedModel(BaseModel): function test_simple_schema_conversion (line 42) | def test_simple_schema_conversion(): function test_optional_schema_conversion (line 65) | def test_optional_schema_conversion(): function test_enum_schema_conversion (line 94) | def test_enum_schema_conversion(): function test_nested_schema_conversion (line 121) | def test_nested_schema_conversion(): function test_verify_no_unions_valid (line 147) | def test_verify_no_unions_valid(): function test_verify_no_unions_invalid (line 158) | def test_verify_no_unions_invalid(): function test_schema_without_refs (line 168) | def test_schema_without_refs(): function test_schema_with_description (line 187) | def test_schema_with_description(): function test_union_type_raises_error (line 206) | def test_union_type_raises_error(): function test_verify_no_unions_allows_optional (line 221) | def test_verify_no_unions_allows_optional(): function test_verify_no_unions_allows_decimal (line 235) | def test_verify_no_unions_allows_decimal(): function test_verify_no_unions_rejects_other_unions (line 251) | def test_verify_no_unions_rejects_other_unions(): function test_verify_no_unions_rejects_complex_unions (line 262) | def test_verify_no_unions_rejects_complex_unions(): function test_verify_no_unions_nested_schemas (line 277) | def test_verify_no_unions_nested_schemas(): function test_decimal_schema_conversion_succeeds (line 320) | def test_decimal_schema_conversion_succeeds(): FILE: tests/llm/test_genai/test_utils.py function test_update_genai_kwargs_basic (line 4) | def test_update_genai_kwargs_basic(): function test_update_genai_kwargs_safety_settings (line 33) | def test_update_genai_kwargs_safety_settings(): function test_update_genai_kwargs_with_custom_safety_settings (line 69) | def test_update_genai_kwargs_with_custom_safety_settings(): function test_update_genai_kwargs_safety_settings_with_image_content_uses_image_categories (line 111) | def test_update_genai_kwargs_safety_settings_with_image_content_uses_ima... function test_update_genai_kwargs_maps_text_thresholds_to_image_categories (line 148) | def test_update_genai_kwargs_maps_text_thresholds_to_image_categories(): function test_update_genai_kwargs_none_values (line 188) | def test_update_genai_kwargs_none_values(): function test_update_genai_kwargs_empty (line 207) | def test_update_genai_kwargs_empty(): function test_update_genai_kwargs_preserves_original (line 218) | def test_update_genai_kwargs_preserves_original(): function test_update_genai_kwargs_thinking_config (line 239) | def test_update_genai_kwargs_thinking_config(): function test_update_genai_kwargs_thinking_config_none (line 253) | def test_update_genai_kwargs_thinking_config_none(): function test_update_genai_kwargs_no_thinking_config (line 264) | def test_update_genai_kwargs_no_thinking_config(): function test_handle_genai_structured_outputs_thinking_config_in_config (line 283) | def test_handle_genai_structured_outputs_thinking_config_in_config(): function test_handle_genai_structured_outputs_thinking_config_kwarg_priority (line 316) | def test_handle_genai_structured_outputs_thinking_config_kwarg_priority(): function test_handle_genai_tools_thinking_config_in_config (line 347) | def test_handle_genai_tools_thinking_config_in_config(): FILE: tests/llm/test_litellm.py function test_litellm_create (line 17) | def test_litellm_create(): function test_async_litellm_create (line 23) | def test_async_litellm_create(): FILE: tests/llm/test_new_client.py class User (line 24) | class User(BaseModel): function test_client_create (line 29) | def test_client_create(): function test_client_messages_create (line 41) | def test_client_messages_create(): function test_client_chat_completions_create_with_response (line 53) | def test_client_chat_completions_create_with_response(): function test_client_chat_completions_create (line 69) | def test_client_chat_completions_create(): function test_client_chat_completions_create_partial (line 81) | def test_client_chat_completions_create_partial(): function test_client_chat_completions_create_iterable (line 92) | def test_client_chat_completions_create_iterable(): function test_async_client_chat_completions_create (line 107) | async def test_async_client_chat_completions_create(): function test_async_client_chat_completions_create_partial (line 121) | async def test_async_client_chat_completions_create_partial(): function test_async_client_chat_completions_create_iterable (line 134) | async def test_async_client_chat_completions_create_iterable(): function test_async_client_chat_completions_create_with_response (line 147) | async def test_async_client_chat_completions_create_with_response(): function test_client_from_anthropic_with_response (line 163) | def test_client_from_anthropic_with_response(): function test_client_anthropic_response (line 180) | def test_client_anthropic_response(): function test_client_anthropic_bedrock_response (line 198) | def test_client_anthropic_bedrock_response(): function test_async_client_anthropic_response (line 222) | async def test_async_client_anthropic_response(): function test_async_client_anthropic_bedrock_response (line 241) | async def test_async_client_anthropic_bedrock_response(): function test_client_cohere_response (line 265) | def test_client_cohere_response(): function test_client_cohere_response_with_nested_classes (line 283) | def test_client_cohere_response_with_nested_classes(): function test_client_cohere_async (line 320) | async def test_client_cohere_async(): function test_client_from_mistral_with_response (line 356) | def test_client_from_mistral_with_response(): function test_client_mistral_response (line 375) | def test_client_mistral_response(): FILE: tests/llm/test_openai/conftest.py function client (line 18) | def client(): function aclient (line 23) | def aclient(): FILE: tests/llm/test_openai/slow/test_response.py class UserProfile (line 11) | class UserProfile(BaseModel): function test_basic_response_methods (line 24) | def test_basic_response_methods(client: OpenAI, mode, model): function test_create_iterable_from_create (line 39) | def test_create_iterable_from_create(client: OpenAI, mode, model): function test_create_with_completion (line 58) | def test_create_with_completion(client: OpenAI, mode, model): function test_create_iterable (line 76) | def test_create_iterable(client: OpenAI, mode, model): function test_create_partial (line 95) | def test_create_partial(client: OpenAI, mode, model): function test_basic_response_methods_async (line 121) | async def test_basic_response_methods_async(client: AsyncOpenAI, mode, m... function test_create_iterable_from_create_async (line 137) | async def test_create_iterable_from_create_async(aclient: AsyncOpenAI, m... function test_create_with_completion_async (line 159) | async def test_create_with_completion_async(aclient: AsyncOpenAI, mode, ... function test_create_iterable_async (line 178) | async def test_create_iterable_async(aclient: AsyncOpenAI, mode, model): function test_create_partial_async (line 198) | async def test_create_partial_async(aclient: AsyncOpenAI, mode, model): FILE: tests/llm/test_openai/test_attr.py function test_has_embedding (line 6) | def test_has_embedding(): function test_has_embedding_async (line 17) | async def test_has_embedding_async(): FILE: tests/llm/test_openai/test_hooks.py function client (line 8) | def client(): function log_kwargs (line 12) | def log_kwargs(*args, **kwargs): function log_kwargs_1 (line 16) | def log_kwargs_1(*args, **kwargs): function log_kwargs_2 (line 20) | def log_kwargs_2(*args, **kwargs): function test_on_method_str (line 32) | def test_on_method_str( function test_on_method_enum (line 52) | def test_on_method_enum( function test_off_method_str (line 72) | def test_off_method_str( function test_off_method_enum (line 99) | def test_off_method_enum( function test_clear_method_str (line 124) | def test_clear_method_str( function test_clear_method (line 145) | def test_clear_method( function test_clear_no_args (line 164) | def test_clear_no_args( FILE: tests/llm/test_openai/test_multimodal.py class LineItem (line 26) | class LineItem(BaseModel): class Receipt (line 32) | class Receipt(BaseModel): function gettysburg_audio (line 37) | def gettysburg_audio(): function test_multimodal_audio_description (line 51) | def test_multimodal_audio_description(audio_file, mode, client): class ImageDescription (line 80) | class ImageDescription(BaseModel): function test_multimodal_image_description (line 87) | def test_multimodal_image_description(model, mode, client): function test_multimodal_image_description_autodetect (line 117) | def test_multimodal_image_description_autodetect(model, mode, client): function test_multimodal_image_description_autodetect_no_response_model (line 148) | def test_multimodal_image_description_autodetect_no_response_model(model... function test_multimodal_pdf_file (line 180) | def test_multimodal_pdf_file(model, mode, client, pdf_source): FILE: tests/llm/test_openai/test_multitask.py class User (line 10) | class User(BaseModel): function test_multi_user (line 19) | def test_multi_user(model, mode, client): function async_map_chat_completion_to_response (line 55) | async def async_map_chat_completion_to_response( function test_multi_user_tools_mode_async (line 67) | async def test_multi_user_tools_mode_async(model, mode, aclient): function test_multi_user_stream (line 109) | def test_multi_user_stream(model, mode, client): function test_multi_user_tools_mode_async_stream (line 144) | async def test_multi_user_tools_mode_async_stream(model, mode, aclient): FILE: tests/llm/test_openai/test_patch.py class UserExtract (line 12) | class UserExtract(BaseModel): class UserExtractTypedDict (line 17) | class UserExtractTypedDict(TypedDict): function test_typed_dict (line 23) | def test_typed_dict(model, mode, client): function test_runmodel (line 48) | def test_runmodel(model, mode, client): function test_runmodel_async (line 76) | async def test_runmodel_async(model, mode, aclient): class UserExtractValidated (line 102) | class UserExtractValidated(BaseModel): method validate_name (line 108) | def validate_name(cls, v): function test_runmodel_validator (line 117) | def test_runmodel_validator(model, mode, client): function test_runmodel_async_validator (line 143) | async def test_runmodel_async_validator(model, mode, aclient): FILE: tests/llm/test_openai/test_validation_context.py class Message (line 9) | class Message(BaseModel): method no_banned_words (line 14) | def no_banned_words(cls, v: str, info: ValidationInfo): function test_banned_words_validation (line 29) | def test_banned_words_validation(model: str, mode: instructor.Mode, clie... function test_banned_words_validation_old (line 49) | def test_banned_words_validation_old(model: str, mode: instructor.Mode, ... function test_no_banned_words_validation (line 69) | def test_no_banned_words_validation(model: str, mode: instructor.Mode, c... function test_forced_words_validation (line 90) | def test_forced_words_validation(model: str, mode: instructor.Mode, clie... FILE: tests/llm/test_openai/test_validators.py function test_patch_completes_successfully (line 13) | def test_patch_completes_successfully(client): function test_runmodel_validator_error (line 24) | def test_runmodel_validator_error(model, mode, client): function test_runmodel_validator_default_openai_client (line 50) | def test_runmodel_validator_default_openai_client(model, client): FILE: tests/llm/test_vertexai/test_deprecated_async.py class User (line 8) | class User(BaseModel): function test_deprecated_async_warning (line 14) | def test_deprecated_async_warning(_): function test_both_async_params_error (line 27) | def test_both_async_params_error(_): FILE: tests/llm/test_vertexai/test_format.py class User (line 9) | class User(BaseModel): function test_format_string (line 15) | def test_format_string(model, mode, is_list): FILE: tests/llm/test_vertexai/test_message_parser.py function test_vertexai_message_parser_string_content (line 6) | def test_vertexai_message_parser_string_content(): function test_vertexai_message_parser_list_content (line 17) | def test_vertexai_message_parser_list_content(): function test_vertexai_message_parser_invalid_content (line 39) | def test_vertexai_message_parser_invalid_content(): function test_vertexai_message_parser_invalid_list_item (line 46) | def test_vertexai_message_parser_invalid_list_item(): FILE: tests/llm/test_vertexai/test_modes.py class Item (line 15) | class Item(BaseModel): class Order (line 20) | class Order(BaseModel): function test_mixed_content_types (line 26) | def test_mixed_content_types(model, mode): FILE: tests/llm/test_writer/conftest.py function configure_writer (line 14) | def configure_writer(): FILE: tests/llm/test_writer/evals/test_classification_enums.py class Labels (line 14) | class Labels(str, enum.Enum): class SinglePrediction (line 19) | class SinglePrediction(BaseModel): function test_writer_classification (line 40) | def test_writer_classification( class MultiLabels (line 61) | class MultiLabels(str, enum.Enum): class MultiClassPrediction (line 67) | class MultiClassPrediction(BaseModel): function test_writer_multi_classify (line 88) | def test_writer_multi_classify( FILE: tests/llm/test_writer/evals/test_classification_literals.py class SinglePrediction (line 13) | class SinglePrediction(BaseModel): function test_classification (line 29) | async def test_classification( class MultiClassPrediction (line 50) | class MultiClassPrediction(BaseModel): function test_writer_multi_classify (line 72) | async def test_writer_multi_classify( FILE: tests/llm/test_writer/evals/test_entities.py class Property (line 13) | class Property(BaseModel): class Entity (line 19) | class Entity(BaseModel): class DocumentExtraction (line 38) | class DocumentExtraction(BaseModel): function ask_ai (line 45) | def ask_ai(content: str, model: str, client: Instructor) -> DocumentExtr... function test_writer_extract (line 91) | def test_writer_extract(model: str, mode: instructor.Mode): FILE: tests/llm/test_writer/evals/test_extract_users.py class UserDetails (line 9) | class UserDetails(BaseModel): function test_writer_extract (line 22) | def test_writer_extract( FILE: tests/llm/test_writer/evals/test_sentiment_analysis.py class Sentiment (line 11) | class Sentiment(str, enum.Enum): class SentimentAnalysis (line 17) | class SentimentAnalysis(BaseModel): function test_writer_sentiment_analysis (line 38) | def test_writer_sentiment_analysis( FILE: tests/llm/test_writer/test_format_common_models.py class User (line 7) | class User(BaseModel): class UserList (line 12) | class UserList(BaseModel): function test_writer_format_literal (line 26) | def test_writer_format_literal(model: str, mode: instructor.Mode): function test_writer_format_enum (line 46) | def test_writer_format_enum(model: str, mode: instructor.Mode): function test_writer_format_bool (line 71) | def test_writer_format_bool(model: str, mode: instructor.Mode): function test_writer_format_sync (line 91) | def test_writer_format_sync(model: str, mode: instructor.Mode): function test_writer_format_async (line 116) | async def test_writer_format_async(mode: instructor.Mode, model: str): function test_writer_format_list_of_strings (line 142) | def test_writer_format_list_of_strings(mode: instructor.Mode, model: str): FILE: tests/llm/test_writer/test_format_difficult_models.py class Item (line 10) | class Item(BaseModel): class Order (line 15) | class Order(BaseModel): function test_writer_format_nested_model (line 21) | def test_writer_format_nested_model(mode: instructor.Mode, model: str): class Book (line 54) | class Book(BaseModel): class LibraryRecord (line 61) | class LibraryRecord(BaseModel): function test_writer_format_complex_nested_model (line 68) | def test_writer_format_complex_nested_model(mode: instructor.Mode, model... FILE: tests/processing/test_anthropic_json.py class _AnthropicTestModel (line 18) | class _AnthropicTestModel(instructor.OpenAISchema): # type: ignore[misc] function _build_message (line 22) | def _build_message(data_content: str) -> Message: function test_parse_anthropic_json_strict_control_characters (line 35) | def test_parse_anthropic_json_strict_control_characters() -> None: function test_parse_anthropic_json_non_strict_preserves_control_characters (line 42) | def test_parse_anthropic_json_non_strict_preserves_control_characters() ... FILE: tests/test_auto_client.py class User (line 9) | class User(BaseModel): function should_skip_provider (line 37) | def should_skip_provider(provider_string: str) -> bool: function test_user_extraction_sync (line 50) | def test_user_extraction_sync(provider_string): function test_user_extraction_async (line 72) | async def test_user_extraction_async(provider_string): function test_invalid_provider_format (line 92) | def test_invalid_provider_format(): function test_unsupported_provider (line 101) | def test_unsupported_provider(): function test_additional_kwargs_passed (line 110) | def test_additional_kwargs_passed(): function test_api_key_parameter_extraction (line 140) | def test_api_key_parameter_extraction(): function test_api_key_parameter_with_environment_fallback (line 163) | def test_api_key_parameter_with_environment_fallback(): function test_api_key_parameter_with_async_client (line 189) | def test_api_key_parameter_with_async_client(): function test_api_key_parameter_not_passed_when_none (line 212) | def test_api_key_parameter_not_passed_when_none(): function test_api_key_logging (line 235) | def test_api_key_logging(): function test_openai_provider_respects_base_url (line 273) | def test_openai_provider_respects_base_url(): function test_openai_provider_async_client_with_base_url (line 298) | def test_openai_provider_async_client_with_base_url(): function test_openai_provider_without_base_url (line 325) | def test_openai_provider_without_base_url(): function test_databricks_provider_uses_environment_configuration (line 346) | def test_databricks_provider_uses_environment_configuration(): function test_databricks_provider_respects_custom_base_url (line 380) | def test_databricks_provider_respects_custom_base_url(): function test_databricks_provider_async_client (line 414) | def test_databricks_provider_async_client(): function test_databricks_provider_requires_token (line 448) | def test_databricks_provider_requires_token(): function test_databricks_provider_requires_host (line 469) | def test_databricks_provider_requires_host(): function test_genai_mode_parameter_passed_to_provider (line 490) | def test_genai_mode_parameter_passed_to_provider(): function test_genai_mode_defaults_when_not_provided (line 514) | def test_genai_mode_defaults_when_not_provided(): function test_google_provider_runtime_import_error_propagates (line 535) | def test_google_provider_runtime_import_error_propagates(): function test_vertexai_provider_runtime_import_error_propagates (line 579) | def test_vertexai_provider_runtime_import_error_propagates(): function test_generative_ai_provider_runtime_import_error_propagates (line 621) | def test_generative_ai_provider_runtime_import_error_propagates(): FILE: tests/test_batch_in_memory.py class User (line 15) | class User(BaseModel): class TestBatchRequestInMemory (line 21) | class TestBatchRequestInMemory: method test_save_to_bytesio_openai (line 24) | def test_save_to_bytesio_openai(self): method test_save_to_bytesio_anthropic (line 52) | def test_save_to_bytesio_anthropic(self): method test_save_to_file_still_works (line 78) | def test_save_to_file_still_works(self): method test_multiple_requests_in_buffer (line 111) | def test_multiple_requests_in_buffer(self): method test_invalid_buffer_type_raises_error (line 137) | def test_invalid_buffer_type_raises_error(self): class TestProviderInMemorySupport (line 152) | class TestProviderInMemorySupport: method test_openai_provider_accepts_bytesio (line 155) | def test_openai_provider_accepts_bytesio(self): method test_anthropic_provider_accepts_bytesio (line 184) | def test_anthropic_provider_accepts_bytesio(self): method test_provider_invalid_type_raises_error (line 211) | def test_provider_invalid_type_raises_error(self): FILE: tests/test_cache_integration.py function test_auto_cache_prevents_duplicate_provider_calls (line 8) | def test_auto_cache_prevents_duplicate_provider_calls(monkeypatch): FILE: tests/test_cache_key.py class UserV1 (line 11) | class UserV1(BaseModel): class UserV1DiffDesc (line 15) | class UserV1DiffDesc(BaseModel): class UserV1DiffField (line 19) | class UserV1DiffField(BaseModel): class UserDoc1 (line 24) | class UserDoc1(BaseModel): class UserDoc2 (line 30) | class UserDoc2(BaseModel): function test_cache_key_changes_on_description_change (line 36) | def test_cache_key_changes_on_description_change(): function test_cache_key_changes_on_field_change (line 44) | def test_cache_key_changes_on_field_change(): function test_cache_key_same_for_identical_schema (line 52) | def test_cache_key_same_for_identical_schema(): function test_cache_key_changes_on_docstring_change (line 58) | def test_cache_key_changes_on_docstring_change(): FILE: tests/test_dict_operations.py class TestDictionaryOperations (line 42) | class TestDictionaryOperations: method test_extract_messages_benchmark (line 45) | def test_extract_messages_benchmark(self): method test_combine_system_messages_benchmark (line 82) | def test_combine_system_messages_benchmark(self): method test_extract_system_messages_benchmark (line 134) | def test_extract_system_messages_benchmark(self): method test_update_gemini_kwargs_benchmark (line 166) | def test_update_gemini_kwargs_benchmark(self): FILE: tests/test_dict_operations_validation.py class TestDictOperationsValidation (line 12) | class TestDictOperationsValidation: method test_extract_messages_validation (line 15) | def test_extract_messages_validation(self): method test_combine_system_messages_validation (line 49) | def test_combine_system_messages_validation(self): method test_extract_system_messages_validation (line 87) | def test_extract_system_messages_validation(self): method test_update_gemini_kwargs_validation (line 130) | def test_update_gemini_kwargs_validation(self): FILE: tests/test_dynamic_model_creation.py function test_dynamic_model_creation_with_field_description (line 5) | def test_dynamic_model_creation_with_field_description(): FILE: tests/test_exception_backwards_compat.py function test_response_parsing_error_is_value_error (line 12) | def test_response_parsing_error_is_value_error(): function test_multimodal_error_is_value_error (line 26) | def test_multimodal_error_is_value_error(): function test_async_validation_error_is_value_error (line 40) | def test_async_validation_error_is_value_error(): function test_exception_inheritance_chain (line 50) | def test_exception_inheritance_chain(): function test_mixed_exception_catching (line 68) | def test_mixed_exception_catching(): function test_exception_attributes_preserved (line 94) | def test_exception_attributes_preserved(): FILE: tests/test_exceptions.py function test_all_exceptions_can_be_imported (line 18) | def test_all_exceptions_can_be_imported(): function test_exception_hierarchy (line 31) | def test_exception_hierarchy(): function test_base_instructor_error_can_be_caught (line 42) | def test_base_instructor_error_can_be_caught(): function test_incomplete_output_exception (line 66) | def test_incomplete_output_exception(): function test_instructor_retry_exception (line 77) | def test_instructor_retry_exception(): function test_validation_error (line 102) | def test_validation_error(): function test_provider_error (line 112) | def test_provider_error(): function test_configuration_error (line 125) | def test_configuration_error(): function test_mode_error (line 135) | def test_mode_error(): function test_client_error (line 152) | def test_client_error(): function test_specific_exception_catching (line 162) | def test_specific_exception_catching(): function test_multiple_exception_handling (line 183) | def test_multiple_exception_handling(): function test_exception_import_from_instructor (line 213) | def test_exception_import_from_instructor(): function test_instructor_error_from_exception (line 227) | def test_instructor_error_from_exception(): function test_instructor_error_str_with_no_failed_attempts (line 255) | def test_instructor_error_str_with_no_failed_attempts(): function test_instructor_error_str_with_failed_attempts (line 264) | def test_instructor_error_str_with_failed_attempts(): function test_instructor_error_str_xml_structure (line 300) | def test_instructor_error_str_xml_structure(): function test_failed_attempt_namedtuple (line 324) | def test_failed_attempt_namedtuple(): function test_instructor_error_failed_attempts_attribute (line 344) | def test_instructor_error_failed_attempts_attribute(): function test_instructor_retry_exception_with_failed_attempts (line 360) | def test_instructor_retry_exception_with_failed_attempts(): function test_multiple_exception_types_with_failed_attempts (line 383) | def test_multiple_exception_types_with_failed_attempts(): function test_failed_attempts_propagation_through_retry_cycles (line 402) | def test_failed_attempts_propagation_through_retry_cycles(): function test_failed_attempts_propagation_in_exception_hierarchy (line 445) | def test_failed_attempts_propagation_in_exception_hierarchy(): function test_failed_attempts_accumulation_simulation (line 478) | def test_failed_attempts_accumulation_simulation(): function test_failed_attempts_with_empty_and_none_completions (line 534) | def test_failed_attempts_with_empty_and_none_completions(): function test_failed_attempts_exception_chaining (line 570) | def test_failed_attempts_exception_chaining(): FILE: tests/test_fizzbuzz_fix.py class TestFizzbuzzFix (line 7) | class TestFizzbuzzFix(unittest.TestCase): method test_fizzbuzz_response_model (line 8) | def test_fizzbuzz_response_model(self): FILE: tests/test_formatting.py function test_handle_insecure_template (line 7) | def test_handle_insecure_template(): function test_handle_templating_with_context (line 21) | def test_handle_templating_with_context(): function test_handle_templating_without_context (line 30) | def test_handle_templating_without_context(): function test_handle_templating_with_anthropic_format (line 38) | def test_handle_templating_with_anthropic_format(): function test_handle_templating_with_mixed_content (line 55) | def test_handle_templating_with_mixed_content(): function test_handle_templating_with_secret_context (line 80) | def test_handle_templating_with_secret_context(): function test_handle_templating_with_cohere_format (line 116) | def test_handle_templating_with_cohere_format(): function test_handle_templating_with_gemini_format (line 131) | def test_handle_templating_with_gemini_format(): FILE: tests/test_function_calls.py function test_model (line 22) | def test_model() -> type[OpenAISchema]: function mock_completion (line 31) | def mock_completion(request: Any) -> ChatCompletion: function mock_anthropic_message (line 66) | def mock_anthropic_message(request: Any) -> Message: function test_openai_schema (line 86) | def test_openai_schema() -> None: function test_openai_schema_raises_error (line 106) | def test_openai_schema_raises_error() -> None: function test_no_docstring (line 114) | def test_no_docstring() -> None: function test_incomplete_output_exception (line 129) | def test_incomplete_output_exception( function test_complete_output_no_exception (line 136) | def test_complete_output_no_exception( function test_incomplete_output_exception_raise (line 152) | def test_incomplete_output_exception_raise( function test_anthropic_no_exception (line 159) | def test_anthropic_no_exception( function test_control_characters_not_allowed_in_anthropic_json_strict_mode (line 177) | def test_control_characters_not_allowed_in_anthropic_json_strict_mode( function test_control_characters_allowed_in_anthropic_json_non_strict_mode (line 199) | def test_control_characters_allowed_in_anthropic_json_non_strict_mode( function test_pylance_url_config (line 213) | def test_pylance_url_config() -> None: function test_refusal_attribute (line 234) | def test_refusal_attribute(test_model: type[OpenAISchema]): function test_no_refusal_attribute (line 261) | def test_no_refusal_attribute(test_model: type[OpenAISchema]): function test_missing_refusal_attribute (line 296) | def test_missing_refusal_attribute(test_model: type[OpenAISchema]): FILE: tests/test_genai_config_merging.py function test_update_genai_kwargs_thinking_config_from_config_object (line 24) | def test_update_genai_kwargs_thinking_config_from_config_object(): function test_update_genai_kwargs_thinking_config_kwarg_priority (line 57) | def test_update_genai_kwargs_thinking_config_kwarg_priority(): function test_update_genai_kwargs_config_object_automatic_function_calling (line 90) | def test_update_genai_kwargs_config_object_automatic_function_calling(): function test_update_genai_kwargs_config_object_does_not_override_base (line 119) | def test_update_genai_kwargs_config_object_does_not_override_base(): function test_update_genai_kwargs_no_config_object (line 139) | def test_update_genai_kwargs_no_config_object(): function test_update_genai_kwargs_config_object_with_no_thinking_config (line 156) | def test_update_genai_kwargs_config_object_with_no_thinking_config(): function test_verify_no_unions_always_returns_true (line 179) | def test_verify_no_unions_always_returns_true(): function test_map_to_gemini_function_schema_accepts_union_types (line 217) | def test_map_to_gemini_function_schema_accepts_union_types(): function test_update_genai_kwargs_config_object_cached_content (line 240) | def test_update_genai_kwargs_config_object_cached_content(): function test_update_genai_kwargs_cached_content_does_not_override_base (line 265) | def test_update_genai_kwargs_cached_content_does_not_override_base(): function test_handle_genai_structured_outputs_skips_system_instruction_with_cached_content (line 285) | def test_handle_genai_structured_outputs_skips_system_instruction_with_c... function test_handle_genai_structured_outputs_sets_system_instruction_without_cached_content (line 318) | def test_handle_genai_structured_outputs_sets_system_instruction_without... function test_handle_genai_tools_skips_tools_and_system_instruction_with_cached_content (line 341) | def test_handle_genai_tools_skips_tools_and_system_instruction_with_cach... function test_handle_genai_tools_sets_tools_without_cached_content (line 377) | def test_handle_genai_tools_sets_tools_without_cached_content(): function test_update_genai_kwargs_config_dict_labels (line 402) | def test_update_genai_kwargs_config_dict_labels(): function test_update_genai_kwargs_config_dict_cached_content (line 412) | def test_update_genai_kwargs_config_dict_cached_content(): function test_update_genai_kwargs_config_dict_thinking_config (line 422) | def test_update_genai_kwargs_config_dict_thinking_config(): function test_handle_genai_structured_outputs_preserves_labels_from_config_dict (line 433) | def test_handle_genai_structured_outputs_preserves_labels_from_config_di... function test_handle_genai_tools_preserves_labels_from_config_dict (line 453) | def test_handle_genai_tools_preserves_labels_from_config_dict(): function test_handle_genai_structured_outputs_skips_system_instruction_with_cached_content_dict (line 473) | def test_handle_genai_structured_outputs_skips_system_instruction_with_c... function test_handle_genai_tools_skips_tools_and_system_instruction_with_cached_content_dict (line 497) | def test_handle_genai_tools_skips_tools_and_system_instruction_with_cach... FILE: tests/test_genai_reask.py function _response_with_content (line 12) | def _response_with_content(content: types.Content) -> types.GenerateCont... function test_reask_genai_tools_preserves_thought_signature (line 16) | def test_reask_genai_tools_preserves_thought_signature(): function test_reask_genai_tools_finds_function_call_part_when_not_first (line 39) | def test_reask_genai_tools_finds_function_call_part_when_not_first(): function test_reask_genai_tools_handles_none_response (line 61) | def test_reask_genai_tools_handles_none_response(): function test_reask_genai_tools_falls_back_when_no_function_call (line 71) | def test_reask_genai_tools_falls_back_when_no_function_call(): FILE: tests/test_json_extraction.py class Person (line 18) | class Person(BaseModel): class TestJSONExtraction (line 24) | class TestJSONExtraction: method test_extract_from_codeblock (line 27) | def test_extract_from_codeblock(self): method test_extract_from_codeblock_no_language (line 50) | def test_extract_from_codeblock_no_language(self): method test_extract_plain_json (line 73) | def test_extract_plain_json(self): method test_nested_json (line 93) | def test_nested_json(self): method test_json_with_arrays (line 118) | def test_json_with_arrays(self): method test_invalid_json (line 140) | def test_invalid_json(self): method test_extract_from_stream (line 156) | def test_extract_from_stream(self): class TestTextExtraction (line 177) | class TestTextExtraction: method test_extract_text_openai_format (line 180) | def test_extract_text_openai_format(self): method test_extract_text_simple_format (line 197) | def test_extract_text_simple_format(self): method test_extract_text_anthropic_format (line 208) | def test_extract_text_anthropic_format(self): method test_extract_text_bedrock_format (line 227) | def test_extract_text_bedrock_format(self): method test_extract_text_unknown_format (line 236) | def test_extract_text_unknown_format(self): class TestModelValidation (line 249) | class TestModelValidation: method test_validate_model_strict (line 252) | def test_validate_model_strict(self): method test_validate_model_non_strict (line 261) | def test_validate_model_non_strict(self): method test_validate_model_json_error (line 271) | def test_validate_model_json_error(self): method test_validate_model_json_error_non_strict (line 282) | def test_validate_model_json_error_non_strict(self): class PersonSchema (line 290) | class PersonSchema(OpenAISchema): class TestBedrockJSONParsing (line 298) | class TestBedrockJSONParsing: method test_parse_bedrock_json_simple (line 301) | def test_parse_bedrock_json_simple(self): method test_parse_bedrock_json_with_reasoning_content (line 316) | def test_parse_bedrock_json_with_reasoning_content(self): method test_parse_bedrock_json_with_codeblock (line 338) | def test_parse_bedrock_json_with_codeblock(self): method test_parse_bedrock_json_no_text_content (line 357) | def test_parse_bedrock_json_no_text_content(self): method test_parse_bedrock_json_multiple_text_contents (line 375) | def test_parse_bedrock_json_multiple_text_contents(self): FILE: tests/test_json_extraction_edge_cases.py class TestJSONExtractionEdgeCases (line 17) | class TestJSONExtractionEdgeCases: method test_empty_input (line 20) | def test_empty_input(self): method test_no_json_content (line 25) | def test_no_json_content(self): method test_multiple_json_objects (line 32) | def test_multiple_json_objects(self): method test_escaped_quotes (line 51) | def test_escaped_quotes(self): method test_unicode_characters (line 64) | def test_unicode_characters(self): method test_json_with_backslashes (line 77) | def test_json_with_backslashes(self): method test_nested_codeblocks (line 90) | def test_nested_codeblocks(self): method test_json_with_codeblock_in_a_value (line 107) | def test_json_with_codeblock_in_a_value(self): method test_malformed_codeblock (line 118) | def test_malformed_codeblock(self): method test_complex_nested_structure (line 132) | def test_complex_nested_structure(self): method test_json_with_comments (line 158) | def test_json_with_comments(self): method test_stream_with_nested_braces (line 178) | def test_stream_with_nested_braces(self): method test_stream_with_string_containing_braces (line 195) | def test_stream_with_string_containing_braces(self): method test_async_stream_extraction (line 213) | async def test_async_stream_extraction(self): method test_async_stream_with_escaped_quotes (line 238) | async def test_async_stream_with_escaped_quotes(self): FILE: tests/test_list_response.py class User (line 15) | class User(BaseModel): function test_listresponse_preserves_raw_response_on_slice (line 19) | def test_listresponse_preserves_raw_response_on_slice() -> None: function test_process_response_wraps_iterablebase_tasks_with_raw_response (line 32) | def test_process_response_wraps_iterablebase_tasks_with_raw_response() -... function test_prepare_response_model_supports_list_and_iterable (line 57) | def test_prepare_response_model_supports_list_and_iterable() -> None: FILE: tests/test_list_response_wrapper.py class DummyIterableModel (line 15) | class DummyIterableModel(BaseModel, IterableBase): method from_response (line 19) | def from_response(cls, completion, **kwargs): # noqa: ANN001,ARG003 method from_streaming_response (line 23) | def from_streaming_response( # noqa: ANN001 method from_streaming_response_async (line 31) | def from_streaming_response_async( # noqa: ANN001 class DummyCompletion (line 43) | class DummyCompletion(BaseModel): function test_process_response_returns_list_response_for_iterable_model (line 47) | def test_process_response_returns_list_response_for_iterable_model(): function test_process_response_streaming_returns_list_response_for_iterable_model (line 62) | def test_process_response_streaming_returns_list_response_for_iterable_m... function test_process_response_async_streaming_returns_list_response_for_iterable_model (line 77) | async def test_process_response_async_streaming_returns_list_response_fo... function test_prepare_response_model_treats_list_as_iterable_model (line 97) | def test_prepare_response_model_treats_list_as_iterable_model(): FILE: tests/test_logging.py function test_from_provider_logging (line 5) | def test_from_provider_logging(caplog): FILE: tests/test_message_processing.py class TestMergeConsecutiveMessages (line 16) | class TestMergeConsecutiveMessages: method test_empty_messages (line 19) | def test_empty_messages(self): method test_single_message (line 24) | def test_single_message(self): method test_consecutive_same_role (line 30) | def test_consecutive_same_role(self): method test_alternating_roles (line 42) | def test_alternating_roles(self): method test_mixed_content_types (line 55) | def test_mixed_content_types(self): method test_multiple_consecutive (line 67) | def test_multiple_consecutive(self): class TestGetMessageContent (line 88) | class TestGetMessageContent: method test_string_content (line 91) | def test_string_content(self): method test_list_content (line 97) | def test_list_content(self): method test_empty_content (line 103) | def test_empty_content(self): method test_none_content (line 109) | def test_none_content(self): method test_missing_content (line 115) | def test_missing_content(self): method test_empty_message (line 121) | def test_empty_message(self): class TestTransformToGeminiPrompt (line 128) | class TestTransformToGeminiPrompt: method test_empty_messages (line 131) | def test_empty_messages(self): method test_user_message (line 136) | def test_user_message(self): method test_assistant_message (line 144) | def test_assistant_message(self): method test_system_message (line 152) | def test_system_message(self): method test_full_conversation (line 160) | def test_full_conversation(self): method test_multiple_system_messages (line 178) | def test_multiple_system_messages(self): class TestUpdateGeminiKwargs (line 193) | class TestUpdateGeminiKwargs: method test_transform_messages (line 196) | def test_transform_messages(self): method test_generation_config (line 205) | def test_generation_config(self): method test_safety_settings (line 226) | def test_safety_settings(self): method test_existing_safety_settings (line 235) | def test_existing_safety_settings(self): class TestSystemMessages (line 252) | class TestSystemMessages: method test_combine_system_messages_strings (line 255) | def test_combine_system_messages_strings(self): method test_combine_system_messages_lists (line 262) | def test_combine_system_messages_lists(self): method test_combine_system_messages_mixed (line 271) | def test_combine_system_messages_mixed(self): method test_combine_system_messages_none (line 280) | def test_combine_system_messages_none(self): method test_extract_system_messages_empty (line 287) | def test_extract_system_messages_empty(self): method test_extract_system_messages_no_system (line 293) | def test_extract_system_messages_no_system(self): method test_extract_system_messages_string (line 302) | def test_extract_system_messages_string(self): method test_extract_system_messages_list (line 313) | def test_extract_system_messages_list(self): method test_extract_system_messages_multiple (line 327) | def test_extract_system_messages_multiple(self): FILE: tests/test_multimodal.py function base64_jpeg (line 17) | def base64_jpeg(): function base64_png (line 23) | def base64_png(): function test_image_from_url (line 28) | def test_image_from_url(): function test_image_from_path (line 36) | def test_image_from_path(tmp_path: Path): function test_image_to_anthropic (line 47) | def test_image_to_anthropic(): function test_image_to_openai (line 57) | def test_image_to_openai(): function test_convert_contents (line 66) | def test_convert_contents(): function test_convert_messages (line 75) | def test_convert_messages(): function test_convert_messages_anthropic (line 93) | def test_convert_messages_anthropic(): function test_convert_messages_gemini (line 123) | def test_convert_messages_gemini(): function test_image_from_path_unsupported_format (line 137) | def test_image_from_path_unsupported_format(tmp_path: Path): function test_image_from_path_empty_file (line 145) | def test_image_from_path_empty_file(tmp_path: Path): function test_image_to_openai_base64 (line 153) | def test_image_to_openai_base64(): function test_convert_contents_single_string (line 162) | def test_convert_contents_single_string(): function test_convert_contents_single_image (line 168) | def test_convert_contents_single_image(): function test_convert_messages_mixed_content (line 177) | def test_convert_messages_mixed_content(): function test_convert_contents_invalid_type (line 190) | def test_convert_contents_invalid_type(): function test_convert_contents_anthropic_mode (line 195) | def test_convert_contents_anthropic_mode(): function test_convert_contents_custom_dict (line 206) | def test_convert_contents_custom_dict(): function test_image_from_base64_url (line 216) | def test_image_from_base64_url(base64_png): function test_image_from_url_with_query_params (line 224) | def test_image_from_url_with_query_params(): function test_image_from_url_with_unusual_extension (line 232) | def test_image_from_url_with_unusual_extension(): function test_image_to_openai_with_base64_source (line 240) | def test_image_to_openai_with_base64_source(base64_png): function test_image_to_anthropic_with_base64_source (line 252) | def test_image_to_anthropic_with_base64_source(base64_png): function test_image_from_various_urls (line 276) | def test_image_from_various_urls(url, request): function test_convert_contents_with_base64_image (line 287) | def test_convert_contents_with_base64_image(base64_png): function test_image_autodetect (line 326) | def test_image_autodetect(input_data, expected_type, expected_media_type... function test_image_autodetect_invalid_input (line 357) | def test_image_autodetect_invalid_input(): function test_image_autodetect_empty_file (line 365) | def test_image_autodetect_empty_file(tmp_path): function test_raw_base64_autodetect_jpeg (line 372) | def test_raw_base64_autodetect_jpeg(base64_jpeg): function test_raw_base64_autodetect_png (line 379) | def test_raw_base64_autodetect_png(base64_png): function test_autodetect_media_data_uris (line 386) | def test_autodetect_media_data_uris(): function test_convert_messages_autodetect_media (line 408) | def test_convert_messages_autodetect_media(): function test_pdf_from_url (line 440) | def test_pdf_from_url(): function test_pdf_from_gs_url (line 456) | def test_pdf_from_gs_url(): function test_audio_from_url (line 477) | def test_audio_from_url(): function test_audio_from_gs_url (line 497) | def test_audio_from_gs_url(): function test_audio_from_base64 (line 517) | def test_audio_from_base64(): function test_pdf_to_bedrock_with_s3_uri (line 532) | def test_pdf_to_bedrock_with_s3_uri(): function test_pdf_to_bedrock_with_s3_uri_custom_name (line 550) | def test_pdf_to_bedrock_with_s3_uri_custom_name(): function test_pdf_to_bedrock_with_invalid_s3_uri (line 566) | def test_pdf_to_bedrock_with_invalid_s3_uri(): function test_pdf_to_bedrock_with_base64_data (line 577) | def test_pdf_to_bedrock_with_base64_data(): function test_pdf_to_bedrock_with_path_source (line 596) | def test_pdf_to_bedrock_with_path_source(tmp_path): function test_pdf_to_bedrock_with_url_source (line 610) | def test_pdf_to_bedrock_with_url_source(): function test_pdf_to_bedrock_name_sanitization (line 632) | def test_pdf_to_bedrock_name_sanitization(): function test_pdf_to_bedrock_name_from_path_source (line 659) | def test_pdf_to_bedrock_name_from_path_source(tmp_path): function test_pdf_to_bedrock_name_from_url (line 670) | def test_pdf_to_bedrock_name_from_url(): function test_pdf_to_bedrock_name_from_gs_url (line 690) | def test_pdf_to_bedrock_name_from_gs_url(): function test_pdf_to_bedrock_default_name (line 707) | def test_pdf_to_bedrock_default_name(): function test_pdf_to_bedrock_missing_data_no_source (line 724) | def test_pdf_to_bedrock_missing_data_no_source(): FILE: tests/test_multitask.py function test_multi_task (line 6) | def test_multi_task(): FILE: tests/test_patch.py function test_patch_completes_successfully (line 9) | def test_patch_completes_successfully(): function test_apatch_completes_successfully (line 13) | def test_apatch_completes_successfully(): function test_is_async_returns_true_if_function_is_async (line 17) | def test_is_async_returns_true_if_function_is_async(): function test_is_async_returns_false_if_function_is_not_async (line 24) | def test_is_async_returns_false_if_function_is_not_async(): function test_is_async_returns_true_if_wrapped_function_is_async (line 31) | def test_is_async_returns_true_if_wrapped_function_is_async(): function test_is_async_returns_true_if_double_wrapped_function_is_async (line 42) | def test_is_async_returns_true_if_double_wrapped_function_is_async(): function test_is_async_returns_true_if_triple_wrapped_function_is_async (line 57) | def test_is_async_returns_true_if_triple_wrapped_function_is_async(): FILE: tests/test_process_response.py function test_typed_dict_conversion (line 7) | def test_typed_dict_conversion() -> None: function test_openai_to_bedrock_conversion (line 22) | def test_openai_to_bedrock_conversion() -> None: function test_bedrock_native_preserved (line 45) | def test_bedrock_native_preserved() -> None: function test_mixed_openai_and_bedrock (line 64) | def test_mixed_openai_and_bedrock() -> None: function test_bedrock_round_trip (line 93) | def test_bedrock_round_trip() -> None: function test_empty_and_missing_content (line 109) | def test_empty_and_missing_content() -> None: function test_bedrock_invalid_content_format (line 123) | def test_bedrock_invalid_content_format() -> None: FILE: tests/test_response_model_conversion.py function get_system_prompt (line 15) | def get_system_prompt(user_tool_definition, mode): function test_json_preserves_description_of_non_english_characters_in_json_mode (line 30) | def test_json_preserves_description_of_non_english_characters_in_json_mode( FILE: tests/test_retry_json_mode.py class User (line 19) | class User(BaseModel): function test_json_decode_error_caught_by_retry (line 24) | def test_json_decode_error_caught_by_retry(): function test_validation_error_caught_by_retry (line 68) | def test_validation_error_caught_by_retry(): FILE: tests/test_schema.py function test_annotation_schema (line 17) | def test_annotation_schema(): class User (line 27) | class User(BaseModel): class AdminUser (line 32) | class AdminUser(BaseModel): function test_new_union_types (line 38) | def test_new_union_types(): function test_old_union_type (line 49) | def test_old_union_type(): function test_tuple_with_multiple_args (line 59) | def test_tuple_with_multiple_args(): function test_dict_with_multiple_value_types (line 69) | def test_dict_with_multiple_value_types(): function test_nested_complex_types (line 79) | def test_nested_complex_types(): function test_openai_schema_tuple_mapping (line 90) | def test_openai_schema_tuple_mapping(): function test_openai_schema_dict_mapping (line 97) | def test_openai_schema_dict_mapping(): function test_openai_schema_ordered_dict_mapping (line 104) | def test_openai_schema_ordered_dict_mapping(): function test_openai_schema_supports_optional_none_310 (line 112) | def test_openai_schema_supports_optional_none_310(): function test_openai_schema_supports_optional_none (line 127) | def test_openai_schema_supports_optional_none() -> None: function test_default_values_and_validators (line 143) | def test_default_values_and_validators(): function test_inheritance (line 154) | def test_inheritance(): function test_alias_and_field_customization (line 167) | def test_alias_and_field_customization(): function test_standard_python_types (line 177) | def test_standard_python_types(): function test_any_type (line 191) | def test_any_type(): function test_literal_type (line 201) | def test_literal_type(): function test_str_any_dict (line 211) | def test_str_any_dict(): FILE: tests/test_schema_utils.py class TestModel (line 15) | class TestModel(BaseModel): class TestModelWithDocstring (line 23) | class TestModelWithDocstring(BaseModel): class TestModelOldStyle (line 37) | class TestModelOldStyle(TestModel, OpenAISchema): function test_generate_openai_schema_matches_class_method (line 43) | def test_generate_openai_schema_matches_class_method(): function test_generate_anthropic_schema_matches_class_method (line 59) | def test_generate_anthropic_schema_matches_class_method(): function test_generate_gemini_schema_matches_class_method (line 75) | def test_generate_gemini_schema_matches_class_method(): function test_docstring_parameter_enrichment (line 90) | def test_docstring_parameter_enrichment(): function test_schema_caching (line 103) | def test_schema_caching(): function test_required_fields_generation (line 113) | def test_required_fields_generation(): function test_field_descriptions (line 124) | def test_field_descriptions(): function test_schema_name_and_title (line 134) | def test_schema_name_and_title(): function test_no_inheritance_required (line 141) | def test_no_inheritance_required(): function test_anthropic_schema_uses_openai_base (line 155) | def test_anthropic_schema_uses_openai_base(): FILE: tests/test_simple_types.py function test_enum_simple (line 5) | def test_enum_simple(): function test_standard_types (line 16) | def test_standard_types(): function test_partial_not_simple (line 21) | def test_partial_not_simple(): function test_annotated_simple (line 28) | def test_annotated_simple(): function test_literal_simple (line 37) | def test_literal_simple(): function test_union_simple (line 45) | def test_union_simple(): function test_iterable_not_simple (line 53) | def test_iterable_not_simple(): FILE: tests/test_streaming_reask_bug.py class MockStream (line 19) | class MockStream: method __iter__ (line 22) | def __iter__(self): method __next__ (line 25) | def __next__(self): class MockResponsesToolCall (line 29) | class MockResponsesToolCall: method __init__ (line 32) | def __init__( class MockResponsesReasoningItem (line 45) | class MockResponsesReasoningItem: class MockResponsesResponse (line 51) | class MockResponsesResponse: method __init__ (line 54) | def __init__(self, output: list[Any]) -> None: function create_mock_validation_error (line 58) | def create_mock_validation_error(): class TestStreamingReaskBug (line 77) | class TestStreamingReaskBug: method test_reask_tools_with_stream_object_does_not_crash (line 80) | def test_reask_tools_with_stream_object_does_not_crash(self): method test_reask_anthropic_tools_with_stream_object (line 105) | def test_reask_anthropic_tools_with_stream_object(self): method test_reask_with_none_response (line 122) | def test_reask_with_none_response(self): method test_reask_responses_tools_skips_reasoning_items_and_includes_details (line 138) | def test_reask_responses_tools_skips_reasoning_items_and_includes_deta... method test_reask_md_json_with_stream_object (line 168) | def test_reask_md_json_with_stream_object(self): class TestStreamingReaskIntegration (line 190) | class TestStreamingReaskIntegration: method client (line 194) | def client(self): method test_streaming_with_retries_and_failing_validator (line 206) | def test_streaming_with_retries_and_failing_validator(self, client): FILE: tests/test_utils.py function test_extract_json_from_codeblock (line 14) | def test_extract_json_from_codeblock(): function test_extract_json_from_codeblock_no_end (line 28) | def test_extract_json_from_codeblock_no_end(): function test_extract_json_from_codeblock_no_start (line 45) | def test_extract_json_from_codeblock_no_start(): function test_stream_json (line 61) | def test_stream_json(): function test_stream_json_async (line 93) | async def test_stream_json_async(): function test_merge_consecutive_messages (line 134) | def test_merge_consecutive_messages(): function test_merge_consecutive_messages_empty (line 154) | def test_merge_consecutive_messages_empty(): function test_merge_consecutive_messages_single (line 160) | def test_merge_consecutive_messages_single(): function test_classproperty (line 172) | def test_classproperty(): function test_combine_system_messages_string_string (line 192) | def test_combine_system_messages_string_string(): function test_combine_system_messages_list_list (line 199) | def test_combine_system_messages_list_list(): function test_combine_system_messages_string_list (line 209) | def test_combine_system_messages_string_list(): function test_combine_system_messages_list_string (line 219) | def test_combine_system_messages_list_string(): function test_combine_system_messages_none_string (line 229) | def test_combine_system_messages_none_string(): function test_combine_system_messages_none_list (line 236) | def test_combine_system_messages_none_list(): function test_combine_system_messages_invalid_type (line 243) | def test_combine_system_messages_invalid_type(): function test_extract_system_messages (line 248) | def test_extract_system_messages(): function test_extract_system_messages_no_system (line 262) | def test_extract_system_messages_no_system(): function test_combine_system_messages_with_cache_control (line 271) | def test_combine_system_messages_with_cache_control(): function test_combine_system_messages_string_to_cache_control (line 300) | def test_combine_system_messages_string_to_cache_control(): function test_extract_system_messages_with_cache_control (line 323) | def test_extract_system_messages_with_cache_control(): function test_combine_system_messages_preserve_cache_control (line 352) | def test_combine_system_messages_preserve_cache_control(): FILE: tests/test_xai_optional_dependency.py function test_from_provider_xai_requires_optional_extra (line 4) | def test_from_provider_xai_requires_optional_extra(): function test_direct_from_xai_has_clear_error_when_sdk_missing (line 16) | def test_direct_from_xai_has_clear_error_when_sdk_missing(): FILE: tests/v2/test_provider_modes.py class Answer (line 36) | class Answer(BaseModel): class Weather (line 42) | class Weather(BaseModel): class GoogleSearch (line 49) | class GoogleSearch(BaseModel): function test_mode_is_registered (line 88) | def test_mode_is_registered(provider: Provider, mode: Mode): function test_mode_basic_extraction (line 108) | def test_mode_basic_extraction(provider: Provider, mode: Mode): function test_mode_async_extraction (line 144) | async def test_mode_async_extraction(provider: Provider, mode: Mode): function test_anthropic_parallel_tools_extraction (line 171) | def test_anthropic_parallel_tools_extraction(): function test_anthropic_tools_with_thinking (line 205) | def test_anthropic_tools_with_thinking(mode: Mode): function test_anthropic_reasoning_tools_deprecation (line 230) | def test_anthropic_reasoning_tools_deprecation(): function test_all_modes_covered (line 280) | def test_all_modes_covered(provider: Provider):