Skip to content

Commit 589614e

Browse files
committed
Address review feedback from @paxiaatucsdedu
- Fix mypy settings: revert warn_unused_ignores to true (match langchain-google standards) - Remove unnecessary type: ignore comments (4 total across oci_generative_ai.py and oci_data_science.py) - Remove duplicate test file test_openai_model.py (consolidated into test_openai_models.py) - Update PR description to clarify Python 3.9 backwards compatibility via conditional dependencies
1 parent 915c40a commit 589614e

File tree

4 files changed

+5
-83
lines changed

4 files changed

+5
-83
lines changed

libs/oci/langchain_oci/chat_models/oci_data_science.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def bind_tools(
780780
formatted_tools = [convert_to_openai_tool(tool) for tool in tools]
781781
if tool_choice is not None:
782782
kwargs["tool_choice"] = tool_choice
783-
return super().bind(tools=formatted_tools, **kwargs) # type: ignore[return-value]
783+
return super().bind(tools=formatted_tools, **kwargs)
784784

785785

786786
class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):

libs/oci/langchain_oci/chat_models/oci_generative_ai.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ def bind_tools(
12871287
)
12881288
kwargs["is_parallel_tool_calls"] = True
12891289

1290-
return super().bind(tools=formatted_tools, **kwargs) # type: ignore[return-value]
1290+
return super().bind(tools=formatted_tools, **kwargs)
12911291

12921292
def with_structured_output(
12931293
self,
@@ -1360,7 +1360,7 @@ def with_structured_output(
13601360
key_name=tool_name, first_tool_only=True
13611361
)
13621362
elif method == "json_mode":
1363-
llm = self.bind(response_format={"type": "JSON_OBJECT"}) # type: ignore[assignment]
1363+
llm = self.bind(response_format={"type": "JSON_OBJECT"})
13641364
output_parser = (
13651365
PydanticOutputParser(pydantic_object=schema)
13661366
if is_pydantic_schema
@@ -1384,7 +1384,7 @@ def with_structured_output(
13841384
json_schema=response_json_schema
13851385
)
13861386

1387-
llm = self.bind(response_format=response_format_obj) # type: ignore[assignment]
1387+
llm = self.bind(response_format=response_format_obj)
13881388
if is_pydantic_schema:
13891389
output_parser = PydanticOutputParser(pydantic_object=schema)
13901390
else:

libs/oci/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ show_error_context = true
9898
warn_redundant_casts = true
9999
warn_unreachable = true
100100
warn_unused_configs = true
101-
warn_unused_ignores = false
101+
warn_unused_ignores = true
102102

103103
# Ignore missing imports only for specific untyped packages
104104
[[tool.mypy.overrides]]

libs/oci/tests/integration_tests/chat_models/test_openai_model.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)