mirascope.llm.override
Alias override
Overrides the provider-specific call with the specified provider.
This function creates a new function that wraps the original function and temporarily sets a context with the specified overrides when called. It supports both setting overrides (provider, model, client, call_params) and structural overrides (stream, tools, response_model, output_parser).
Parameters
Name | Type | Description |
---|---|---|
provider_agnostic_call | () => Awaitable[_R] | () => _R | The provider-agnostic call to override. |
provider= None | Provider | LocalProvider | None | The provider to override with. |
model= None | str | None | The model to override with. |
stream= None | bool | StreamConfig | None | Whether to stream the response. |
tools= None | list[type[BaseTool] | Callable] | None | The tools to use for the LLM API call. |
response_model= None | type[_ResponseModelT] | None | The response model to structure the response into. |
output_parser= None | (Any) => _ParsedOutputT | None | A function to parse the response. |
json_mode= None | bool | None | Whether to use JSON mode. |
client= None | Any | The client to override with. |
call_params= None | CommonCallParams | AnthropicCallParams | AzureCallParams | BedrockCallParams | CohereCallParams | GeminiCallParams | GoogleCallParams | GroqCallParams | MistralCallParams | OpenAICallParams | VertexCallParams | XAICallParams | None | The call params to override with. |
Returns
Type | Description |
---|---|
() => Awaitable[_R] | Awaitable[CallResponse] | Awaitable[Stream] | Awaitable[_ResponseModelT] | Awaitable[_ParsedOutputT] | Awaitable[AsyncIterable[_ResponseModelT]] | Awaitable[_ResponseModelT | CallResponse] | Awaitable[_ParsedOutputT | CallResponse] | _R | CallResponse | Stream | _ResponseModelT | _ParsedOutputT | Iterable[_ResponseModelT] | _ResponseModelT | CallResponse | _ParsedOutputT | CallResponse | The overridden function with appropriate return type. |
Alias to: mirascope.llm._override.override