From 9abf1847f43c4f188bfecbed4501a71812303948 Mon Sep 17 00:00:00 2001 From: Hyoseung Kim <101391296+hseung578@users.noreply.github.com> Date: Thu, 6 Jul 2023 03:04:38 +0900 Subject: [PATCH] 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 --- langchain/tools/steamship_image_generation/tool.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/langchain/tools/steamship_image_generation/tool.py b/langchain/tools/steamship_image_generation/tool.py index 520b7bf9ee..0ab7950a69 100644 --- a/langchain/tools/steamship_image_generation/tool.py +++ b/langchain/tools/steamship_image_generation/tool.py @@ -27,7 +27,7 @@ from langchain.tools.steamship_image_generation.utils import make_image_public from langchain.utils import get_from_dict_or_env if TYPE_CHECKING: - pass + from steamship import Steamship class ModelName(str, Enum): @@ -44,12 +44,9 @@ SUPPORTED_IMAGE_SIZES = { class SteamshipImageGenerationTool(BaseTool): - try: - from steamship import Steamship - except ImportError: - pass """Tool used to generate images from a text-prompt.""" + model_name: ModelName size: Optional[str] = "512x512" steamship: Steamship