Skip to content

Commit 90085e4

Browse files
committed
Bug fix
1 parent 1227dbb commit 90085e4

File tree

1 file changed

+4
-3
lines changed
  • libs/community/langchain_community/document_loaders/parsers

1 file changed

+4
-3
lines changed

libs/community/langchain_community/document_loaders/parsers/images.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import io
44
import logging
55
from abc import abstractmethod
6-
from typing import TYPE_CHECKING, Iterable, Iterator, Literal
6+
from typing import TYPE_CHECKING, Iterable, Iterator, Literal, Union
77

88
import numpy
99
import numpy as np
@@ -33,19 +33,20 @@ class BaseImageBlobParser(BaseBlobParser):
3333
def __init__(
3434
self,
3535
*,
36-
format: Literal["text", "markdown-link", "html-img"] = "text",
36+
format: Union[Literal["text", "markdown-link", "html-img"], str] = "text",
3737
):
3838
"""
3939
Initializes the BaseImageBlobParser.
4040
4141
Args:
42-
format (Literal["text", "markdown-link", "html-img"]):
42+
format (Literal["text", "markdown-link", "html-img"]|str):
4343
The format for the parsed output.
4444
- "text" = return the content as is
4545
- "markdown-link" = wrap the content into an image markdown link, w/ link
4646
pointing to (`![body)(#)`]
4747
- "html-img" = wrap the content as the `alt` text of an tag and link to
4848
(`<img alt="{body}" src="#"/>`)
49+
- or other formats if the parser supports it
4950
"""
5051
self.format = format
5152

0 commit comments

Comments
 (0)