Skip to content

Commit 966a0f1

Browse files
Fix more lint in libs/oci
1 parent f94678b commit 966a0f1

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

libs/oci/langchain_oci/chat_models/oci_data_science.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@
3131
agenerate_from_stream,
3232
generate_from_stream,
3333
)
34-
from langchain_core.messages import (
35-
AIMessage,
36-
AIMessageChunk,
37-
BaseMessage,
38-
BaseMessageChunk,
39-
)
34+
from langchain_core.messages import AIMessageChunk, BaseMessage, BaseMessageChunk
4035
from langchain_core.output_parsers import (
4136
JsonOutputParser,
4237
PydanticOutputParser,
@@ -772,7 +767,7 @@ def bind_tools(
772767
self,
773768
tools: Sequence[Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]],
774769
**kwargs: Any,
775-
) -> Runnable[LanguageModelInput, AIMessage]:
770+
) -> Runnable[LanguageModelInput, BaseMessage]:
776771
formatted_tools = [convert_to_openai_tool(tool) for tool in tools]
777772
return super().bind(tools=formatted_tools, **kwargs)
778773

libs/oci/langchain_oci/chat_models/oci_generative_ai.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,8 @@ def convert_to_oci_tool(
924924
"required": parameters.get("required", []),
925925
},
926926
)
927-
elif isinstance(tool, BaseTool):
928-
return self.oci_function_definition(
927+
elif isinstance(tool, BaseTool): # type: ignore[unreachable]
928+
return self.oci_function_definition( # type: ignore[unreachable]
929929
name=tool.name,
930930
description=OCIUtils.remove_signature_from_tool_description(
931931
tool.name, tool.description
@@ -1205,7 +1205,7 @@ def bind_tools(
12051205
Union[dict, str, Literal["auto", "none", "required", "any"], bool]
12061206
] = None,
12071207
**kwargs: Any,
1208-
) -> Runnable[LanguageModelInput, AIMessage]:
1208+
) -> Runnable[LanguageModelInput, BaseMessage]:
12091209
"""Bind tool-like objects to this chat model.
12101210
12111211
Assumes model is compatible with Meta's tool-calling API.

libs/oci/tests/unit_tests/chat_models/test_oci_data_science.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def test_stream_vllm(*args: Any) -> None:
155155
if output is None:
156156
output = chunk
157157
else:
158-
output += chunk
158+
output += chunk # type: ignore[assignment]
159159
count += 1
160160
assert count == 5
161161
assert output is not None

0 commit comments

Comments
 (0)