Browse Source

Fix exception causes all over the codebase (#1014)

tags/v0.2.3
Ram Rachum GitHub 2 years ago
parent
commit
70cc1f439d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      autogen/agentchat/contrib/math_user_proxy_agent.py
  2. +1
    -1
      samples/apps/autogen-studio/autogenstudio/utils/utils.py

+ 2
- 2
autogen/agentchat/contrib/math_user_proxy_agent.py View File

@@ -397,8 +397,8 @@ class WolframAlphaAPIWrapper(BaseModel):
try:
import wolframalpha

except ImportError:
raise ImportError("wolframalpha is not installed. " "Please install it with `pip install wolframalpha`")
except ImportError as e:
raise ImportError("wolframalpha is not installed. Please install it with `pip install wolframalpha`") from e
client = wolframalpha.Client(wolfram_alpha_appid)
values["wolfram_client"] = client



+ 1
- 1
samples/apps/autogen-studio/autogenstudio/utils/utils.py View File

@@ -128,7 +128,7 @@ def serialize_file(file_path: str) -> Tuple[str, str]:
file_content = file.read()
base64_encoded_content = base64.b64encode(file_content).decode("utf-8")
except Exception as e:
raise IOError(f"An error occurred while reading the file: {e}")
raise IOError(f"An error occurred while reading the file: {e}") from e

return base64_encoded_content, file_type



Loading…
Cancel
Save