diff --git a/integrations-service/integrations/models/execution.py b/integrations-service/integrations/models/execution.py index 315b1c3fa..40ba3fdba 100644 --- a/integrations-service/integrations/models/execution.py +++ b/integrations-service/integrations/models/execution.py @@ -53,6 +53,7 @@ class ExecutionError(BaseModel): The error message of the integration execution """ + ExecutionSetup = Union[ EmailSetup, SpiderSetup, diff --git a/integrations-service/integrations/utils/integrations/brave.py b/integrations-service/integrations/utils/integrations/brave.py index 53281c6db..02a69f75b 100644 --- a/integrations-service/integrations/utils/integrations/brave.py +++ b/integrations-service/integrations/utils/integrations/brave.py @@ -1,12 +1,12 @@ import json from beartype import beartype -from ...models.execution import ExecutionError from langchain_community.tools import BraveSearch from tenacity import retry, stop_after_attempt, wait_exponential from ...autogen.Tools import BraveSearchArguments, BraveSearchSetup from ...models import BraveSearchOutput, SearchResult +from ...models.execution import ExecutionError @beartype @@ -27,7 +27,8 @@ async def search( assert isinstance(arguments, BraveSearchArguments), "Invalid arguments" tool = BraveSearch.from_api_key( - api_key=setup.api_key, search_kwargs={"count": 3}) + api_key=setup.api_key, search_kwargs={"count": 3} + ) result = tool.run(arguments.query) diff --git a/integrations-service/integrations/utils/integrations/browserbase.py b/integrations-service/integrations/utils/integrations/browserbase.py index fcbe559c0..8142dd638 100644 --- a/integrations-service/integrations/utils/integrations/browserbase.py +++ b/integrations-service/integrations/utils/integrations/browserbase.py @@ -10,7 +10,6 @@ DebugConnectionURLs, Session, ) -from ...models.execution import ExecutionError from tenacity import retry, stop_after_attempt, wait_exponential from ...autogen.Tools import ( @@ -32,6 +31,7 @@ BrowserbaseListSessionsOutput, ) from ...models.browserbase import BrowserbaseExtensionOutput +from ...models.execution import ExecutionError def get_browserbase_client(setup: BrowserbaseSetup) -> Browserbase | ExecutionError: diff --git a/integrations-service/integrations/utils/integrations/email.py b/integrations-service/integrations/utils/integrations/email.py index 9af028e17..19d2f6ab5 100644 --- a/integrations-service/integrations/utils/integrations/email.py +++ b/integrations-service/integrations/utils/integrations/email.py @@ -2,11 +2,11 @@ from smtplib import SMTP from beartype import beartype -from ...models.execution import ExecutionError from tenacity import retry, stop_after_attempt, wait_exponential from ...autogen.Tools import EmailArguments, EmailSetup from ...models import EmailOutput +from ...models.execution import ExecutionError @beartype @@ -15,7 +15,9 @@ reraise=True, stop=stop_after_attempt(4), ) -async def send(setup: EmailSetup, arguments: EmailArguments) -> EmailOutput | ExecutionError: +async def send( + setup: EmailSetup, arguments: EmailArguments +) -> EmailOutput | ExecutionError: """ Sends an email with the provided details. """ diff --git a/integrations-service/integrations/utils/integrations/llama_parse.py b/integrations-service/integrations/utils/integrations/llama_parse.py index 720884a70..a25fe96b8 100644 --- a/integrations-service/integrations/utils/integrations/llama_parse.py +++ b/integrations-service/integrations/utils/integrations/llama_parse.py @@ -2,12 +2,12 @@ import uuid from beartype import beartype -from ...models.execution import ExecutionError from llama_parse import LlamaParse from tenacity import retry, stop_after_attempt, wait_exponential from ...autogen.Tools import LlamaParseFetchArguments, LlamaParseSetup from ...models import LlamaParseFetchOutput +from ...models.execution import ExecutionError @beartype @@ -37,7 +37,7 @@ async def parse( file_content = base64.b64decode(arguments.file) extra_info = { "file_name": arguments.filename if arguments.filename else str(uuid.uuid4()) - } + } # Parse the document documents = await parser.aload_data(file_content, extra_info=extra_info) diff --git a/integrations-service/integrations/utils/integrations/remote_browser.py b/integrations-service/integrations/utils/integrations/remote_browser.py index 67872c33a..032bf27a7 100644 --- a/integrations-service/integrations/utils/integrations/remote_browser.py +++ b/integrations-service/integrations/utils/integrations/remote_browser.py @@ -21,6 +21,7 @@ from ...autogen.Tools import RemoteBrowserArguments, RemoteBrowserSetup from ...models import RemoteBrowserOutput from ...models.execution import ExecutionError + CURSOR_PATH = Path(__file__).parent / "assets" / "cursor-small.png" diff --git a/integrations-service/integrations/utils/integrations/weather.py b/integrations-service/integrations/utils/integrations/weather.py index 04d532893..33759dab0 100644 --- a/integrations-service/integrations/utils/integrations/weather.py +++ b/integrations-service/integrations/utils/integrations/weather.py @@ -13,7 +13,9 @@ reraise=True, stop=stop_after_attempt(4), ) -async def get(setup: WeatherSetup, arguments: WeatherGetArguments) -> WeatherGetOutput | ExecutionError: +async def get( + setup: WeatherSetup, arguments: WeatherGetArguments +) -> WeatherGetOutput | ExecutionError: """ Fetches weather data for a specified location using OpenWeatherMap API. """ @@ -28,7 +30,9 @@ async def get(setup: WeatherSetup, arguments: WeatherGetArguments) -> WeatherGet if not location: raise ValueError("Location parameter is required for weather data") - weather = OpenWeatherMapAPIWrapper(openweathermap_api_key=openweathermap_api_key) + weather = OpenWeatherMapAPIWrapper( + openweathermap_api_key=openweathermap_api_key + ) result = weather.run(location) return WeatherGetOutput(result=result) except Exception as e: diff --git a/integrations-service/integrations/utils/integrations/wikipedia.py b/integrations-service/integrations/utils/integrations/wikipedia.py index 35a2bd29b..f539df1d7 100644 --- a/integrations-service/integrations/utils/integrations/wikipedia.py +++ b/integrations-service/integrations/utils/integrations/wikipedia.py @@ -13,7 +13,9 @@ reraise=True, stop=stop_after_attempt(4), ) -async def search(arguments: WikipediaSearchArguments) -> WikipediaSearchOutput | ExecutionError: +async def search( + arguments: WikipediaSearchArguments, +) -> WikipediaSearchOutput | ExecutionError: """ Searches Wikipedia for a given query and returns formatted results. """