mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
Fix steamship import error (#7133)
Description: Fix steamship import error When running multi_modal_output_agent: field "steamship" not yet prepared so type is still a ForwardRef, you might need to call SteamshipImageGenerationTool.update_forward_refs(). Tag maintainer: @hinthornw --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
parent
7d92e9407b
commit
9abf1847f4
@ -27,7 +27,7 @@ from langchain.tools.steamship_image_generation.utils import make_image_public
|
|||||||
from langchain.utils import get_from_dict_or_env
|
from langchain.utils import get_from_dict_or_env
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
pass
|
from steamship import Steamship
|
||||||
|
|
||||||
|
|
||||||
class ModelName(str, Enum):
|
class ModelName(str, Enum):
|
||||||
@ -44,12 +44,9 @@ SUPPORTED_IMAGE_SIZES = {
|
|||||||
|
|
||||||
|
|
||||||
class SteamshipImageGenerationTool(BaseTool):
|
class SteamshipImageGenerationTool(BaseTool):
|
||||||
try:
|
|
||||||
from steamship import Steamship
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
"""Tool used to generate images from a text-prompt."""
|
"""Tool used to generate images from a text-prompt."""
|
||||||
|
|
||||||
model_name: ModelName
|
model_name: ModelName
|
||||||
size: Optional[str] = "512x512"
|
size: Optional[str] = "512x512"
|
||||||
steamship: Steamship
|
steamship: Steamship
|
||||||
|
Loading…
Reference in New Issue
Block a user