mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-14 23:26:34 +00:00
add reasoning guard; make mime type not required alongside base64
This commit is contained in:
parent
7bc4512ab7
commit
5b7df921df
@ -949,6 +949,11 @@ def is_text_block(block: ContentBlock) -> TypeGuard[TextContentBlock]:
|
||||
return block.get("type") == "text"
|
||||
|
||||
|
||||
def is_reasoning_block(block: ContentBlock) -> TypeGuard[ReasoningContentBlock]:
|
||||
"""Type guard to check if a content block is a reasoning block."""
|
||||
return block.get("type") == "reasoning"
|
||||
|
||||
|
||||
def is_invalid_tool_call_block(
|
||||
block: ContentBlock,
|
||||
) -> TypeGuard[InvalidToolCall]:
|
||||
@ -1097,10 +1102,6 @@ def create_image_block(
|
||||
msg = "Must provide one of: url, base64, or file_id"
|
||||
raise ValueError(msg)
|
||||
|
||||
if base64 and not mime_type:
|
||||
msg = "mime_type is required when using base64 data"
|
||||
raise ValueError(msg)
|
||||
|
||||
block = ImageContentBlock(type="image", id=_ensure_id(id))
|
||||
|
||||
if url is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user