diff --git a/integrations-service/integrations/utils/integrations/dalle_image_generator.py b/integrations-service/integrations/utils/integrations/dalle_image_generator.py index 1a0ac567c..e0a6496b8 100644 --- a/integrations-service/integrations/utils/integrations/dalle_image_generator.py +++ b/integrations-service/integrations/utils/integrations/dalle_image_generator.py @@ -3,10 +3,16 @@ from ...models import DalleImageGeneratorArguments, DalleImageGeneratorSetup -async def dalle_image_generator(setup: DalleImageGeneratorSetup, arguments: DalleImageGeneratorArguments) -> str: +async def dalle_image_generator( + setup: DalleImageGeneratorSetup, arguments: DalleImageGeneratorArguments +) -> str: """ Generates an image using DALL-E based on a provided prompt. """ + + assert isinstance(setup, DalleImageGeneratorSetup), "Invalid setup" + assert isinstance(arguments, DalleImageGeneratorArguments), "Invalid arguments" + # FIXME: Fix OpenAI API Key error dalle = DallEAPIWrapper(api_key=setup.api_key) diff --git a/integrations-service/integrations/utils/integrations/duckduckgo_search.py b/integrations-service/integrations/utils/integrations/duckduckgo_search.py index 93de30494..44561c535 100644 --- a/integrations-service/integrations/utils/integrations/duckduckgo_search.py +++ b/integrations-service/integrations/utils/integrations/duckduckgo_search.py @@ -7,6 +7,11 @@ async def duckduckgo_search(arguments: DuckDuckGoSearchExecutionArguments) -> st """ Performs a web search using DuckDuckGo and returns the results. """ + + assert isinstance( + arguments, DuckDuckGoSearchExecutionArguments + ), "Invalid arguments" + search = DuckDuckGoSearchRun() query = arguments.query if not query: diff --git a/integrations-service/integrations/utils/integrations/hacker_news.py b/integrations-service/integrations/utils/integrations/hacker_news.py index fd74f2513..522b64e58 100644 --- a/integrations-service/integrations/utils/integrations/hacker_news.py +++ b/integrations-service/integrations/utils/integrations/hacker_news.py @@ -7,6 +7,9 @@ async def hacker_news(arguments: HackerNewsExecutionArguments) -> str: """ Fetches and formats content from a Hacker News thread using the provided URL. """ + + assert isinstance(arguments, HackerNewsExecutionArguments), "Invalid arguments" + url = arguments.url if not url: raise ValueError("URL parameter is required for Hacker News search") diff --git a/integrations-service/integrations/utils/integrations/weather.py b/integrations-service/integrations/utils/integrations/weather.py index 770cf2afd..2bf00d295 100644 --- a/integrations-service/integrations/utils/integrations/weather.py +++ b/integrations-service/integrations/utils/integrations/weather.py @@ -1,4 +1,5 @@ from langchain_community.utilities import OpenWeatherMapAPIWrapper + from ...models import WeatherExecutionArguments, WeatherExecutionSetup @@ -8,6 +9,10 @@ async def weather( """ Fetches weather data for a specified location using OpenWeatherMap API. """ + + assert isinstance(setup, WeatherExecutionSetup), "Invalid setup" + assert isinstance(arguments, WeatherExecutionArguments), "Invalid arguments" + location = arguments.location openweathermap_api_key = setup.openweathermap_api_key diff --git a/integrations-service/integrations/utils/integrations/wikipedia.py b/integrations-service/integrations/utils/integrations/wikipedia.py index 3d2dd64ff..a47fdecb5 100644 --- a/integrations-service/integrations/utils/integrations/wikipedia.py +++ b/integrations-service/integrations/utils/integrations/wikipedia.py @@ -7,6 +7,9 @@ async def wikipedia(arguments: WikipediaExecutionArguments) -> str: """ Searches Wikipedia for a given query and returns formatted results. """ + + assert isinstance(arguments, WikipediaExecutionArguments), "Invalid arguments" + query = arguments.query if not query: raise ValueError("Query parameter is required for Wikipedia search")