Skip to content

Commit

Permalink
chore: apply coderabbit docstring suggestion - first
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
kaancayli and coderabbitai[bot] authored Nov 11, 2024
1 parent a863e9e commit 29d9252
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/llm/langchain/iris_langchain_chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@ def bind_tools(
tools: Sequence[Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]],
**kwargs: Any,
) -> Runnable[LanguageModelInput, BaseMessage]:
"""Bind a sequence of tools to the request handler for function calling support.
Args:
tools: Sequence of tools that can be one of:
- Dict describing the tool
- Pydantic BaseModel
- Callable function
- BaseTool instance
**kwargs: Additional arguments passed to the request handler
Returns:
self: Returns this instance as a Runnable
Raises:
ValueError: If tools sequence is empty or contains invalid tool types
"""
if not tools:
raise ValueError("At least one tool must be provided")

self.request_handler.bind_tools(tools)
return self

Expand Down

0 comments on commit 29d9252

Please sign in to comment.