diff --git a/instructor/client_vertexai.py b/instructor/client_vertexai.py index 33e131fb1..700f974d1 100644 --- a/instructor/client_vertexai.py +++ b/instructor/client_vertexai.py @@ -31,22 +31,22 @@ def _create_vertexai_tool(models: Union[BaseModel, list[BaseModel], type]) -> gm """Creates a tool with function declarations for single model or list of models""" # Handle Iterable case first if get_origin(models) is not None: - model_list = list(get_types_array(models)) + model_list = list(get_types_array(models)) # type: ignore else: # Handle both single model and list of models model_list = models if isinstance(models, list) else [models] - + declarations = [] - for model in model_list: - parameters = _create_gemini_json_schema(model) + for model in model_list: # type: ignore + parameters = _create_gemini_json_schema(model) # type: ignore declaration = gm.FunctionDeclaration( - name=model.__name__, - description=model.__doc__, - parameters=parameters + name=model.__name__, # type: ignore + description=model.__doc__, # type: ignore + parameters=parameters, ) - declarations.append(declaration) + declarations.append(declaration) # type: ignore - return gm.Tool(function_declarations=declarations) + return gm.Tool(function_declarations=declarations) # type: ignore def vertexai_message_parser( @@ -99,7 +99,9 @@ def vertexai_function_response_parser( ) -def vertexai_process_response(_kwargs: dict[str, Any], model: Union[BaseModel, list[BaseModel], type]): # noqa: UP007 +def vertexai_process_response( + _kwargs: dict[str, Any], model: Union[BaseModel, list[BaseModel], type] +): # noqa: UP007 messages: list[dict[str, str]] = _kwargs.pop("messages") contents = _vertexai_message_list_parser(messages) # type: ignore diff --git a/instructor/patch.py b/instructor/patch.py index b64ad32d5..cc5802672 100644 --- a/instructor/patch.py +++ b/instructor/patch.py @@ -155,7 +155,7 @@ async def new_create_async( response_model, new_kwargs = handle_response_model( response_model=response_model, mode=mode, **kwargs - ) + ) # type: ignore new_kwargs = handle_templating(new_kwargs, context) response = await retry_async( @@ -186,7 +186,7 @@ def new_create_sync( response_model, new_kwargs = handle_response_model( response_model=response_model, mode=mode, **kwargs - ) + ) # type: ignore new_kwargs = handle_templating(new_kwargs, context)