Skip to content

Commit 580750d

Browse files
committed
Add clarifying comment for type annotation in bind_tools
Explains that the 'type' annotation matches LangChain's BaseChatModel API and that runtime validation occurs in convert_to_openai_tool().
1 parent d7be806 commit 580750d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

libs/oci/langchain_oci/chat_models/oci_data_science.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ def _process_response(self, response_json: dict) -> ChatResult:
771771
def bind_tools(
772772
self,
773773
tools: Sequence[Union[Dict[str, Any], type, Callable, BaseTool]],
774+
# Type annotation matches LangChain's BaseChatModel API.
775+
# Runtime validation occurs in convert_to_openai_tool().
774776
*,
775777
tool_choice: Optional[str] = None,
776778
**kwargs: Any,

libs/oci/langchain_oci/chat_models/oci_generative_ai.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,8 @@ def _prepare_request(
12371237
def bind_tools(
12381238
self,
12391239
tools: Sequence[Union[Dict[str, Any], type, Callable, BaseTool]],
1240+
# Type annotation matches LangChain's BaseChatModel API.
1241+
# Runtime validation occurs in convert_to_openai_tool().
12401242
*,
12411243
tool_choice: Optional[
12421244
Union[dict, str, Literal["auto", "none", "required", "any"], bool]

0 commit comments

Comments
 (0)