sdkagent

instructor API reference

183 public APIs from instructor (instructor-ai/instructor) — 74 classes, 39 functions, 70 methods. Signatures extracted by static analysis of the actual source.

Repository: instructor-ai/instructor

KindCount
Classes74
Functions39
Methods70

API list

classinstructor.batch.BatchJob
Legacy BatchJob class for backward compatibility
classinstructor.batch.models.BatchError
Error information for failed batch requests
classinstructor.batch.models.BatchErrorInfo
Batch-level error information
classinstructor.batch.models.BatchFiles
File references for batch job
classinstructor.batch.models.BatchRequestCounts
Unified request counts across providers
classinstructor.batch.models.BatchStatus
Normalized batch status across providers
classinstructor.batch.models.BatchSuccess
Successful batch result with custom_id
classinstructor.batch.models.BatchTimestamps
Comprehensive timestamp tracking
classinstructor.batch.processor.BatchProcessor
Unified batch processor that works across all providers
methodinstructor.batch.processor.BatchProcessor.get_batch_status(batch_id:str) -> dict[str, Any]
Get batch job status from the provider
methodinstructor.batch.processor.BatchProcessor.retrieve_results(batch_id:str) -> list[BatchResult]
Retrieve and parse batch results from the provider
classinstructor.batch.providers.anthropic.AnthropicProvider
Anthropic batch processing provider
methodinstructor.batch.providers.anthropic.AnthropicProvider.cancel_batch(batch_id:str) -> dict[str, Any]
Cancel Anthropic batch job
methodinstructor.batch.providers.anthropic.AnthropicProvider.delete_batch(batch_id:str) -> dict[str, Any]
Delete Anthropic batch job
methodinstructor.batch.providers.anthropic.AnthropicProvider.download_results(batch_id:str, file_path:str) -> None
Download Anthropic batch results to a file
methodinstructor.batch.providers.anthropic.AnthropicProvider.get_status(batch_id:str) -> dict[str, Any]
Get Anthropic batch status
methodinstructor.batch.providers.anthropic.AnthropicProvider.list_batches(limit:int=10) -> list[BatchJobInfo]
List Anthropic batch jobs
methodinstructor.batch.providers.anthropic.AnthropicProvider.retrieve_results(batch_id:str) -> str
Retrieve Anthropic batch results
methodinstructor.batch.providers.anthropic.AnthropicProvider.submit_batch(file_path_or_buffer:Union[str, io.BytesIO], metadata:Optional[dict[str, Any]]=None, **kwargs) -> str
Submit Anthropic batch job
classinstructor.batch.providers.base.BatchProvider
Abstract base class for batch processing providers
methodinstructor.batch.providers.base.BatchProvider.cancel_batch(batch_id:str) -> dict[str, Any]
Cancel a batch job
methodinstructor.batch.providers.base.BatchProvider.delete_batch(batch_id:str) -> dict[str, Any]
Delete a batch job
methodinstructor.batch.providers.base.BatchProvider.download_results(batch_id:str, file_path:str) -> None
Download batch results to a file
methodinstructor.batch.providers.base.BatchProvider.get_status(batch_id:str) -> dict[str, Any]
Get the status of a batch job
methodinstructor.batch.providers.base.BatchProvider.list_batches(limit:int=10) -> list[BatchJobInfo]
List batch jobs
methodinstructor.batch.providers.base.BatchProvider.retrieve_results(batch_id:str) -> str
Retrieve batch results as a string
methodinstructor.batch.providers.base.BatchProvider.submit_batch(file_path_or_buffer:Union[str, io.BytesIO], metadata:Optional[dict[str, Any]]=None, **kwargs) -> str
Submit a batch job and return the job ID
funcinstructor.batch.providers.get_provider(provider_name:str) -> BatchProvider
Factory function to get the appropriate provider instance
classinstructor.batch.providers.openai.OpenAIProvider
OpenAI batch processing provider
methodinstructor.batch.providers.openai.OpenAIProvider.cancel_batch(batch_id:str) -> dict[str, Any]
Cancel OpenAI batch job
methodinstructor.batch.providers.openai.OpenAIProvider.delete_batch(batch_id:str) -> dict[str, Any]
Delete OpenAI batch job
methodinstructor.batch.providers.openai.OpenAIProvider.download_results(batch_id:str, file_path:str) -> None
Download OpenAI batch results to a file
methodinstructor.batch.providers.openai.OpenAIProvider.get_status(batch_id:str) -> dict[str, Any]
Get OpenAI batch status
methodinstructor.batch.providers.openai.OpenAIProvider.list_batches(limit:int=10) -> list[BatchJobInfo]
List OpenAI batch jobs
methodinstructor.batch.providers.openai.OpenAIProvider.retrieve_results(batch_id:str) -> str
Retrieve OpenAI batch results
methodinstructor.batch.providers.openai.OpenAIProvider.submit_batch(file_path_or_buffer:Union[str, io.BytesIO], metadata:Optional[dict[str, Any]]=None, **kwargs) -> str
Submit OpenAI batch job
methodinstructor.batch.request.BatchRequest.get_json_schema() -> dict[str, Any]
Generate JSON schema from response_model
funcinstructor.batch.utils.extract_results(results:list[BatchResult]) -> list[T]
Extract just the result objects from successful results
funcinstructor.batch.utils.filter_errors(results:list[BatchResult]) -> list[BatchError]
Filter to only error results
funcinstructor.batch.utils.filter_successful(results:list[BatchResult]) -> list[BatchSuccess[T]]
Filter to only successful results
funcinstructor.batch.utils.get_results_by_custom_id(results:list[BatchResult]) -> dict[str, BatchResult]
Create a dictionary mapping custom_id to results
classinstructor.cache.BaseCache
Abstract cache contract.
methodinstructor.cache.BaseCache.get(key:str) -> Any | None
Return *None* to indicate a cache miss.
methodinstructor.cache.BaseCache.set(key:str, value:Any, ttl:int | None=None) -> None
Store *value* under *key*.
classinstructor.cache.DiskCache
Wrapper around `diskcache.Cache`.
funcinstructor.cache.make_cache_key(*messages:Any, *model:str | None, *response_model:type[BaseModel] | None, *mode:str | None=None) -> str
Compute a *deterministic* cache key.
funcinstructor.cli.cli.docs(query:Optional[str]=typer.Argument(None, help='Search the documentation')) -> None
Open the instructor documentation website.
funcinstructor.cli.deprecated_hub.hub() -> None
This command has been deprecated.
funcinstructor.cli.usage.get_model_cost(model:ModelNames) -> Union[dict[str, float], float]
Get the cost details for a given model.
funcinstructor.distil.format_function(func:Callable[..., Any]) -> str
Format a function as a string with docstring and body.
funcinstructor.distil.get_signature_from_fn(fn:Callable[..., Any]) -> str
Get the function signature as a string.
classinstructor.v2.core.client.Instructor
Sync client wrapper that adds structured output support.
methodinstructor.v2.core.client.Instructor.handle_kwargs(kwargs:dict[str, Any]) -> dict[str, Any]
Handle and process keyword arguments for the API call.
classinstructor.v2.core.client.Response
Helper for responses API using a patched client.
funcinstructor.v2.core.decorators.decorator(handler_class:type) -> type
Register the handler class.
classinstructor.v2.core.errors.AsyncValidationError
Exception raised during async validation.
classinstructor.v2.core.errors.ConfigurationError
Exception raised for configuration-related errors.
classinstructor.v2.core.errors.FailedAttempt
Represents a single failed retry attempt.
classinstructor.v2.core.errors.InstructorError
Base exception for all Instructor-specific errors.
classinstructor.v2.core.errors.MultimodalError
Exception raised for multimodal content processing errors.
classinstructor.v2.core.errors.ProviderError
Exception raised for provider-specific errors.
classinstructor.v2.core.errors.ResponseParsingError
Exception raised when unable to parse the LLM response.
classinstructor.v2.core.errors.ValidationError
Exception raised when LLM response validation fails.
classinstructor.v2.core.exceptions.RegistryValidationMixin
Mixin providing registry validation helper methods.
funcinstructor.v2.core.function_calls.response_schema(cls:type[Model]) -> type[Model]
Wrap a Pydantic model class to add ResponseSchema behavior.
classinstructor.v2.core.handler.ModeHandler
Base class for mode handlers.
classinstructor.v2.core.hooks.CompletionKwargsHandler
Protocol for completion kwargs handlers.
classinstructor.v2.core.hooks.CompletionResponseHandler
Protocol for completion response handlers.
classinstructor.v2.core.hooks.Hooks
Hooks class for handling and emitting events related to completion processes.
methodinstructor.v2.core.hooks.Hooks.clear(hook_name:HookNameType | None=None) -> None
Clear handlers for a specific event or all events.
methodinstructor.v2.core.hooks.Hooks.combine(*hooks_instances:Hooks) -> Hooks
Combine multiple Hooks instances into a new one.
methodinstructor.v2.core.hooks.Hooks.copy() -> Hooks
Create a deep copy of this Hooks instance.
methodinstructor.v2.core.hooks.Hooks.emit(hook_name:HookName, *args:Any, **kwargs:Any) -> None
Generic method to emit events for any hook type.
methodinstructor.v2.core.hooks.Hooks.emit_completion_arguments(*args:Any, **kwargs:Any) -> None
Emit a completion arguments event.
methodinstructor.v2.core.hooks.Hooks.emit_completion_error(error:Exception, **kwargs:Any) -> None
Emit a completion error event.
methodinstructor.v2.core.hooks.Hooks.emit_completion_last_attempt(error:Exception, **kwargs:Any) -> None
Emit a completion last attempt event.
methodinstructor.v2.core.hooks.Hooks.emit_completion_response(response:Any) -> None
Emit a completion response event.
methodinstructor.v2.core.hooks.Hooks.emit_parse_error(error:Exception, **kwargs:Any) -> None
Emit a parse error event.
methodinstructor.v2.core.hooks.Hooks.get_hook_name(hook_name:HookNameType) -> HookName
Convert a string hook name to its corresponding enum value.
methodinstructor.v2.core.hooks.Hooks.off(hook_name:HookNameType, handler:HandlerType) -> None
Remove a specific handler from an event.
methodinstructor.v2.core.hooks.Hooks.on(hook_name:HookNameType, handler:HandlerType) -> None
Register an event handler for a specific event.
classinstructor.v2.core.hooks.ParseErrorHandler
Protocol for parse error handlers.
classinstructor.v2.core.mode.Mode
Mode enumeration for patching LLM API clients.
methodinstructor.v2.core.mode.Mode.json_modes() -> set['Mode']
Returns a set of all JSON-based modes.
methodinstructor.v2.core.mode.Mode.tool_modes() -> set['Mode']
Returns a set of all tool-based modes.
methodinstructor.v2.core.mode.Mode.warn_deprecated_mode(mode:'Mode') -> None
Warn about provider-specific mode deprecation.
funcinstructor.v2.core.mode.reset_deprecated_mode_warnings() -> None
Reset deprecation warning tracking.
methodinstructor.v2.core.multimodal.Audio.autodetect(source:str | Path) -> Audio
Attempt to autodetect an audio from a source string or Path.
methodinstructor.v2.core.multimodal.Audio.from_gs_url(data_uri:str, timeout:int=30) -> Audio
Create an Audio instance from a Google Cloud Storage URL.
methodinstructor.v2.core.multimodal.Audio.from_path(path:Union[str, Path]) -> Audio
Create an Audio instance from a file path.
methodinstructor.v2.core.multimodal.Audio.from_url(url:str) -> Audio
Create an Audio instance from a URL.
methodinstructor.v2.core.multimodal.Image.from_gs_url(data_uri:str, timeout:int=30) -> Image
Create an Image instance from a Google Cloud Storage URL.
classinstructor.v2.core.multimodal.ImageWithCacheControl
Image with Anthropic prompt caching support.
methodinstructor.v2.core.multimodal.PDF.autodetect(source:str | Path) -> PDF
Attempt to autodetect a PDF from a source string or Path.
methodinstructor.v2.core.multimodal.PDF.from_gs_url(data_uri:str, timeout:int=30) -> PDF
Create a PDF instance from a Google Cloud Storage URL.
methodinstructor.v2.core.multimodal.PDF.to_bedrock(name:str | None=None) -> dict[str, Any]
Convert to Bedrock's document format.
classinstructor.v2.core.multimodal.PDFWithCacheControl
PDF with Anthropic prompt caching support.
funcinstructor.v2.core.patch.apatch(client:AsyncOpenAI, mode:Mode=Mode.TOOLS, provider:Provider=Provider.OPENAI) -> AsyncOpenAI
Deprecated alias for :func:`patch`.
classinstructor.v2.core.protocols.RequestHandler
Prepares request kwargs for a specific mode.
classinstructor.v2.core.protocols.ResponseParser
Parses API response into validated Pydantic model.
classinstructor.v2.core.protocols.StreamExtractor
Extract JSON chunks from a streaming response.
classinstructor.v2.core.providers.Provider
Supported provider identifiers.
funcinstructor.v2.core.providers.get_provider(base_url:str) -> Provider
Detect the provider based on the base URL.
funcinstructor.v2.core.providers.provider_from_mode(mode:Mode, default:Provider=Provider.OPENAI) -> Provider
Infer provider from a provider-specific Mode.
classinstructor.v2.core.registry.ModeHandlers
Collection of handlers for a specific mode.
classinstructor.v2.core.registry.ModeRegistry
Central registry for mode handlers.
methodinstructor.v2.core.registry.ModeRegistry.get_handler_class(provider:Provider, mode:Mode) -> type | None
Get the handler class for a mode.
methodinstructor.v2.core.registry.ModeRegistry.get_handlers(provider:Provider, mode:Mode) -> ModeHandlers
Get all handlers for a mode.
methodinstructor.v2.core.registry.ModeRegistry.get_modes_for_provider(provider:Provider) -> list[Mode]
Get all registered modes for a provider.
methodinstructor.v2.core.registry.ModeRegistry.get_providers_for_mode(mode:Mode) -> list[Provider]
Get all providers that support a mode.
methodinstructor.v2.core.registry.ModeRegistry.is_registered(provider:Provider, mode:Mode) -> bool
Check if a mode is registered.
methodinstructor.v2.core.registry.ModeRegistry.list_modes() -> list[tuple[Provider, Mode]]
List all registered modes.
methodinstructor.v2.core.registry.ModeRegistry.register_lazy(provider:Provider, mode:Mode, loader:Callable[[], ModeHandlers]) -> None
Register a lazy loader for a mode.
funcinstructor.v2.core.templating.apply_template(text:str, context:dict[str, Any]) -> str
Apply Jinja2 template to the given text.
classinstructor.v2.core.utils.classproperty
Descriptor for class-level properties.
funcinstructor.v2.core.utils.disable_pydantic_error_url() -> None
Disable URLs in Pydantic ValidationError messages.
funcinstructor.v2.core.utils.is_async(func:Callable[..., Any]) -> bool
Return whether a callable is async, following wrapped callables.
methodinstructor.v2.dsl.json_tracker.JsonCompleteness.get_complete_paths() -> set[str]
Return all paths that are complete.
methodinstructor.v2.dsl.json_tracker.JsonCompleteness.is_path_complete(path:str) -> bool
Check if the sub-structure at the given path is complete.
methodinstructor.v2.dsl.json_tracker.JsonCompleteness.is_root_complete() -> bool
Check if the root JSON structure is complete.
funcinstructor.v2.dsl.json_tracker.is_json_complete(json_str:str) -> bool
Check if a JSON string represents a complete structure.
funcinstructor.v2.dsl.maybe.Maybe(model:type[T]) -> type[MaybeBase[T]]
Create a Maybe model for a given Pydantic model.
classinstructor.v2.dsl.partial.PartialLiteralMixin
DEPRECATED: This mixin is no longer necessary.
classinstructor.v2.providers.anthropic.handlers.AnthropicHandlerBase
Common utilities for Anthropic handlers.
classinstructor.v2.providers.anthropic.handlers.AnthropicJSONHandler
Handler for Anthropic JSON mode.
classinstructor.v2.providers.anthropic.handlers.AnthropicParallelToolsHandler
Handler for Anthropic parallel tool calling.
classinstructor.v2.providers.anthropic.handlers.AnthropicToolsHandler
Handler for Anthropic TOOLS mode.
funcinstructor.v2.providers.anthropic.handlers.extract_system_messages(messages:list[dict[str, Any]]) -> list[SystemMessage]
Extract system messages from a list of messages.
funcinstructor.v2.providers.anthropic.usage.initialize_usage() -> Any
Create an empty Anthropic usage accumulator.
classinstructor.v2.providers.bedrock.handlers.BedrockMDJSONHandler
Handler for Bedrock MD_JSON mode.
classinstructor.v2.providers.bedrock.handlers.BedrockToolsHandler
Handler for Bedrock TOOLS mode.
funcinstructor.v2.providers.bedrock.handlers.generate_bedrock_schema(response_model:type[Any]) -> dict[str, Any]
Generate Bedrock tool schema from a Pydantic model.
funcinstructor.v2.providers.bedrock.handlers.handle_bedrock_json(response_model:type[Any], new_kwargs:dict[str, Any]) -> tuple[type[Any], dict[str, Any]]
Handle Bedrock JSON mode.
funcinstructor.v2.providers.bedrock.handlers.handle_bedrock_tools(response_model:type[Any] | None, new_kwargs:dict[str, Any]) -> tuple[type[Any] | None, dict[str, Any]]
Handle Bedrock tools mode.
classinstructor.v2.providers.cohere.handlers.CohereJSONSchemaHandler
Handler for Cohere JSON_SCHEMA mode.
classinstructor.v2.providers.cohere.handlers.CohereMDJSONHandler
Handler for Cohere MD_JSON mode.
classinstructor.v2.providers.cohere.handlers.CohereToolsHandler
Handler for Cohere TOOLS mode.
classinstructor.v2.providers.gemini.handlers.GeminiHandlerBase
Base handler for Gemini modes.
classinstructor.v2.providers.gemini.handlers.GeminiJSONHandler
Handler for Gemini JSON mode.
classinstructor.v2.providers.gemini.handlers.GeminiToolsHandler
Handler for Gemini TOOLS mode.
funcinstructor.v2.providers.gemini.handlers.parse_gemini_json(response_model:type[BaseModel], completion:Any, validation_context:dict[str, Any] | None=None, strict:bool | None=None) -> BaseModel
Parse Gemini text JSON responses.
funcinstructor.v2.providers.gemini.handlers.parse_gemini_tools(response_model:type[BaseModel], completion:Any, validation_context:dict[str, Any] | None=None, strict:bool | None=None) -> BaseModel
Parse Gemini tool-call responses.
funcinstructor.v2.providers.gemini.utils.reask_genai_tools(*args:Any, **kwargs:Any) -> dict[str, Any]
Compatibility shim for the GenAI-owned reask helper.
classinstructor.v2.providers.genai.handlers.GenAIHandlerBase
Common utilities shared across GenAI mode handlers.
classinstructor.v2.providers.genai.handlers.GenAIToolsHandler
Mode handler for GenAI tools/function calling.
funcinstructor.v2.providers.genai.templating.process_message(message:Any, context:dict[str, Any], apply_template:Callable[[str, dict[str, Any]], str]) -> Any
Apply templates to GenAI Content parts.
funcinstructor.v2.providers.mistral.client.async_wrapper(*args:Any, **wrapper_kwargs:Any) -> Any
Async wrapper that handles streaming.
funcinstructor.v2.providers.mistral.client.sync_wrapper(*args:Any, **wrapper_kwargs:Any) -> Any
Sync wrapper that handles streaming.
classinstructor.v2.providers.mistral.handlers.MistralToolsHandler
Handler for Mistral TOOLS mode.
methodinstructor.v2.providers.mistral.handlers.MistralToolsHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for tools mode.
classinstructor.v2.providers.openai.handlers.OpenAIParallelToolsHandler
Handler for OpenAI parallel tool calling.
classinstructor.v2.providers.openai.handlers.OpenAIResponsesToolsHandler
Handler for OpenAI Responses API with tools.
methodinstructor.v2.providers.openai.handlers.OpenAIResponsesToolsHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for Responses API.
classinstructor.v2.providers.openai.handlers.OpenAIToolsHandler
Handler for OpenAI TOOLS mode.
methodinstructor.v2.providers.openai.handlers.OpenAIToolsHandler.handle_reask(kwargs:dict[str, Any], response:ChatCompletion, exception:Exception) -> dict[str, Any]
Handle reask for tools mode.
methodinstructor.v2.providers.openai.handlers.OpenAIToolsHandler.prepare_request(response_model:Any, kwargs:dict[str, Any]) -> tuple[Any, dict[str, Any]]
Prepare request with tool definitions.
classinstructor.v2.providers.openrouter.handlers.OpenRouterJSONSchemaHandler
Handler for OpenRouter structured outputs.
classinstructor.v2.providers.perplexity.handlers.PerplexityMDJSONHandler
Handler for Perplexity JSON mode.
funcinstructor.v2.providers.perplexity.handlers.handle_perplexity_json(response_model:type[Any], new_kwargs:dict[str, Any]) -> tuple[type[Any], dict[str, Any]]
Handle Perplexity JSON mode.
classinstructor.v2.providers.vertexai.handlers.VertexAIHandlerBase
Base handler for VertexAI modes.
classinstructor.v2.providers.vertexai.handlers.VertexAIJSONHandler
Handler for VertexAI JSON mode.
classinstructor.v2.providers.vertexai.handlers.VertexAIParallelToolsHandler
Handler for VertexAI parallel tools mode.
classinstructor.v2.providers.vertexai.handlers.VertexAIToolsHandler
Handler for VertexAI TOOLS mode.
classinstructor.v2.providers.writer.handlers.WriterJSONSchemaHandler
Handler for Writer native JSON schema mode.
classinstructor.v2.providers.writer.handlers.WriterMDJSONHandler
Handler for Writer MD_JSON mode.
methodinstructor.v2.providers.writer.handlers.WriterMDJSONHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for Writer MD_JSON mode.
classinstructor.v2.providers.writer.handlers.WriterToolsHandler
Handler for Writer TOOLS mode.
methodinstructor.v2.providers.writer.handlers.WriterToolsHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for Writer tools mode.
funcinstructor.v2.providers.writer.handlers.handle_writer_json(response_model:type[Any], new_kwargs:dict[str, Any]) -> tuple[type[Any], dict[str, Any]]
Handle Writer JSON mode.
funcinstructor.v2.providers.writer.handlers.handle_writer_tools(response_model:type[Any], new_kwargs:dict[str, Any]) -> tuple[type[Any], dict[str, Any]]
Handle Writer tools mode.
classinstructor.v2.providers.xai.handlers.XAIHandlerBase
Base class for xAI handlers with shared utilities.
classinstructor.v2.providers.xai.handlers.XAIJSONSchemaHandler
Handler for xAI JSON_SCHEMA mode.
methodinstructor.v2.providers.xai.handlers.XAIJSONSchemaHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for JSON schema mode.
classinstructor.v2.providers.xai.handlers.XAIMDJSONHandler
Handler for xAI MD_JSON mode.
methodinstructor.v2.providers.xai.handlers.XAIMDJSONHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for MD_JSON mode.
classinstructor.v2.providers.xai.handlers.XAIParallelToolsHandler
Handler for xAI parallel tool calling.
methodinstructor.v2.providers.xai.handlers.XAIParallelToolsHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for parallel tools mode.
classinstructor.v2.providers.xai.handlers.XAIToolsHandler
Handler for xAI TOOLS mode.
methodinstructor.v2.providers.xai.handlers.XAIToolsHandler.handle_reask(kwargs:dict[str, Any], response:Any, exception:Exception) -> dict[str, Any]
Handle reask for tools mode.
funcinstructor.v2.providers.xai.handlers.handle_xai_json(response_model:type[Any] | None, new_kwargs:dict[str, Any]) -> tuple[type[Any] | None, dict[str, Any]]
Handle xAI JSON mode.
funcinstructor.v2.providers.xai.handlers.handle_xai_tools(response_model:type[Any] | None, new_kwargs:dict[str, Any]) -> tuple[type[Any] | None, dict[str, Any]]
Handle xAI tools mode.
classinstructor.v2.validation.async_validators.AsyncValidationContext
Carry context through async validation hooks.
funcinstructor.v2.validation.async_validators.async_field_validator(field:str, *fields:str) -> Callable[[T], T]
Mark a callable as an async field validator.

About this data

These signatures were extracted from the public source of instructor-ai/instructor using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries