Skip to content

Commit 46cef90

Browse files
authored
core: expose tool message recognized block types (#31787)
1 parent 428c276 commit 46cef90

File tree

1 file changed

+2
-1
lines changed
  • libs/core/langchain_core/tools

1 file changed

+2
-1
lines changed

libs/core/langchain_core/tools/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
from collections.abc import Sequence
7575

7676
FILTERED_ARGS = ("run_manager", "callbacks")
77+
TOOL_MESSAGE_BLOCK_TYPES = ("text", "image_url", "image", "json")
7778

7879

7980
class SchemaAnnotationError(TypeError):
@@ -1189,7 +1190,7 @@ def _is_message_content_block(obj: Any) -> bool:
11891190
if isinstance(obj, str):
11901191
return True
11911192
if isinstance(obj, dict):
1192-
return obj.get("type", None) in ("text", "image_url", "image", "json")
1193+
return obj.get("type", None) in TOOL_MESSAGE_BLOCK_TYPES
11931194
return False
11941195

11951196

0 commit comments

Comments
 (0)