From 5b95a52edc086905cb0ba586f407597604872967 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Mon, 28 Oct 2024 20:41:28 +0530 Subject: [PATCH 1/2] chore: small cleanups --- python/composio/client/__init__.py | 10 +- python/composio/client/endpoints.py | 10 +- python/composio/tools/toolset.py | 4 - python/composio/utils/pydantic.py | 7 +- .../langchain/composio_langchain/toolset.py | 8 +- python/setup.py | 2 +- python/swe/setup.py | 2 +- python/tests/package.json | 17 -- python/tests/playwright.config.ts | 52 ----- python/tests/pnpm-lock.yaml | 98 --------- python/tests/session.json | 202 ------------------ tools.py | 22 -- 12 files changed, 11 insertions(+), 423 deletions(-) delete mode 100644 python/tests/package.json delete mode 100644 python/tests/playwright.config.ts delete mode 100644 python/tests/pnpm-lock.yaml delete mode 100644 python/tests/session.json delete mode 100644 tools.py diff --git a/python/composio/client/__init__.py b/python/composio/client/__init__.py index d365d62cc91..9542b6c4a4d 100644 --- a/python/composio/client/__init__.py +++ b/python/composio/client/__init__.py @@ -1,5 +1,3 @@ -# fmt: off - """ Composio SDK client. """ @@ -63,7 +61,7 @@ def __init__( self, api_key: t.Optional[str] = None, base_url: t.Optional[str] = None, - runtime: t.Optional[str] = None + runtime: t.Optional[str] = None, ) -> None: """ Initialize Composio SDK client @@ -98,12 +96,10 @@ def api_key(self) -> str: cache_dir = Path.home() / LOCAL_CACHE_DIRECTORY_NAME user_data_path = cache_dir / USER_DATA_FILE_NAME user_data = ( - UserData.load(path=user_data_path) - if user_data_path.exists() else None + UserData.load(path=user_data_path) if user_data_path.exists() else None ) env_api_key = ( - (user_data.api_key if user_data else None) - or os.environ.get(ENV_COMPOSIO_API_KEY) + user_data.api_key if user_data else os.environ.get(ENV_COMPOSIO_API_KEY) ) if env_api_key: self._api_key = env_api_key diff --git a/python/composio/client/endpoints.py b/python/composio/client/endpoints.py index e4cd3a975e3..5900b59b3d8 100644 --- a/python/composio/client/endpoints.py +++ b/python/composio/client/endpoints.py @@ -56,13 +56,9 @@ def __call__(self, queries: t.Dict[str, str]) -> "Endpoint": if len(queries) == 0: return self - endpoint = self.endpoint - endpoint += "?" - for key, value in queries.items(): - endpoint += ( - f"{urllib.parse.quote_plus(key)}={urllib.parse.quote_plus(value)}&" - ) - return Endpoint(endpoint=endpoint[:-1]) + return Endpoint( + urllib.parse.urljoin(self.endpoint, "?" + urllib.parse.urlencode(queries)) + ) class _V1(Endpoint): diff --git a/python/composio/tools/toolset.py b/python/composio/tools/toolset.py index 16a55be847e..0bd0c2723b5 100644 --- a/python/composio/tools/toolset.py +++ b/python/composio/tools/toolset.py @@ -18,7 +18,6 @@ import typing_extensions as te from pydantic import BaseModel -from pydantic.v1.main import BaseModel as V1BaseModel from composio import Action, ActionType, App, AppType, TagType from composio.client import Composio, Entity @@ -579,9 +578,6 @@ def _serialize_execute_params(self, param: ParamType) -> ParamType: if isinstance(param, BaseModel): return param.model_dump_json(exclude_none=True) # type: ignore - if isinstance(param, V1BaseModel): - return param.dict(exclude_none=True) # type: ignore - if isinstance(param, list): return [self._serialize_execute_params(p) for p in param] # type: ignore diff --git a/python/composio/utils/pydantic.py b/python/composio/utils/pydantic.py index a51552775c3..71034e74a5e 100644 --- a/python/composio/utils/pydantic.py +++ b/python/composio/utils/pydantic.py @@ -1,12 +1,7 @@ -import typing as t - import pydantic -import pydantic.v1.error_wrappers -def parse_pydantic_error( - e: t.Union[pydantic.ValidationError, pydantic.v1.error_wrappers.ValidationError] -) -> str: +def parse_pydantic_error(e: pydantic.ValidationError) -> str: """Parse pydantic validation error.""" message = "Invalid request data provided" missing = [] diff --git a/python/plugins/langchain/composio_langchain/toolset.py b/python/plugins/langchain/composio_langchain/toolset.py index 5d11e88b9ce..5731a079207 100644 --- a/python/plugins/langchain/composio_langchain/toolset.py +++ b/python/plugins/langchain/composio_langchain/toolset.py @@ -4,7 +4,6 @@ import pydantic import pydantic.error_wrappers -import pydantic.v1.error_wrappers import typing_extensions as te from langchain_core.tools import StructuredTool as BaseStructuredTool @@ -22,10 +21,7 @@ class StructuredTool(BaseStructuredTool): def run(self, *args, **kwargs): try: return super().run(*args, **kwargs) - except ( - pydantic.ValidationError, - pydantic.v1.error_wrappers.ValidationError, - ) as e: + except pydantic.ValidationError as e: return {"successful": False, "error": parse_pydantic_error(e), "data": None} @@ -64,7 +60,7 @@ class ComposioToolSet( tools = composio_toolset.get_tools(apps=[App.GITHUB]) # Define task - task = "Star a repo SamparkAI/docs on GitHub" + task = "Star a repo composiohq/docs on GitHub" # Define agent agent = create_openai_functions_agent(openai_client, tools, prompt) diff --git a/python/setup.py b/python/setup.py index 6d30e1ecf26..734d5f4adeb 100644 --- a/python/setup.py +++ b/python/setup.py @@ -96,7 +96,7 @@ def scan_for_package_data( description="Core package to act as a bridge between composio platform and other services.", long_description=(Path(__file__).parent / "README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown", - url="https://github.com/SamparkAI/composio_sdk", + url="https://github.com/composiohq/composio", classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: Apache Software License", diff --git a/python/swe/setup.py b/python/swe/setup.py index 6a704d0ee32..875eab86899 100644 --- a/python/swe/setup.py +++ b/python/swe/setup.py @@ -41,7 +41,7 @@ def scan_for_package_data( description="Tools for running a SWE agent using Composio platform", long_description=(Path(__file__).parent / "README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown", - url="https://github.com/SamparkAI/composio_sdk", + url="https://github.com/composiohq/composio", classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: Apache Software License", diff --git a/python/tests/package.json b/python/tests/package.json deleted file mode 100644 index f70841a6995..00000000000 --- a/python/tests/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "composio_sdk", - "version": "1.0.0", - "description": "1. Core - To access base APIs 2. Autogen - Use Composio tools with Autogen 3. CrewAI - Use Composio tools with CrewAI 4. Langchain - Use Composio tools with Langchain", - "main": "index.js", - "scripts": { - "test": "playwright test" - }, - "author": "", - "license": "ISC", - "dependencies": { - "@playwright/test": "^1.43.0", - "chalk": "^5.3.0", - "playwright": "^1.43.0", - "zx": "^8.0.1" - } -} diff --git a/python/tests/playwright.config.ts b/python/tests/playwright.config.ts deleted file mode 100644 index 93a5b6902ba..00000000000 --- a/python/tests/playwright.config.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; - -export default defineConfig({ - // Look for test files in the "tests" directory, relative to this configuration file. - testDir: 'tests', - - // Run all tests in parallel. - fullyParallel: true, - - // Fail the build on CI if you accidentally left test.only in the source code. - forbidOnly: !!process.env.CI, - - // Retry on CI only. - retries: process.env.CI ? 2 : 0, - - // Opt out of parallel tests on CI. - workers: process.env.CI ? 1 : undefined, - use: { - baseURL: 'https://hermes-development.up.railway.app/', - launchOptions: { - args: ['--disable-web-security'] - }, - headless: process.env.CI ? true : false, - actionTimeout: 5 * 60 * 1000, - extraHTTPHeaders: { - // We set this header per GitHub guidelines. - 'Accept': 'application/vnd.github.v3+json', - } - }, - - projects: [ - { - name: 'user session management', - testMatch: /global\.setup\.ts/, - teardown: 'logout user session', - }, - { - name: 'logout user session', - testMatch: /global\.teardown\.ts/, - }, - { - name: 'initial', - dependencies: ['user session management'], - testMatch: /initial\.spec\.ts/, - }, - { - name: 'core', - dependencies: ['initial'], - testMatch: /core\.spec\.ts/, - } - ] -}); \ No newline at end of file diff --git a/python/tests/pnpm-lock.yaml b/python/tests/pnpm-lock.yaml deleted file mode 100644 index d297a3045ae..00000000000 --- a/python/tests/pnpm-lock.yaml +++ /dev/null @@ -1,98 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - '@playwright/test': - specifier: ^1.43.0 - version: 1.43.0 - chalk: - specifier: ^5.3.0 - version: 5.3.0 - playwright: - specifier: ^1.43.0 - version: 1.43.0 - zx: - specifier: ^8.0.1 - version: 8.0.1 - -packages: - - /@playwright/test@1.43.0: - resolution: {integrity: sha512-Ebw0+MCqoYflop7wVKj711ccbNlrwTBCtjY5rlbiY9kHL2bCYxq+qltK6uPsVBGGAOb033H2VO0YobcQVxoW7Q==} - engines: {node: '>=16'} - hasBin: true - dependencies: - playwright: 1.43.0 - dev: false - - /@types/fs-extra@11.0.4: - resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} - requiresBuild: true - dependencies: - '@types/jsonfile': 6.1.4 - '@types/node': 20.12.7 - dev: false - optional: true - - /@types/jsonfile@6.1.4: - resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} - requiresBuild: true - dependencies: - '@types/node': 20.12.7 - dev: false - optional: true - - /@types/node@20.12.7: - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - requiresBuild: true - dependencies: - undici-types: 5.26.5 - dev: false - optional: true - - /chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: false - - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /playwright-core@1.43.0: - resolution: {integrity: sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==} - engines: {node: '>=16'} - hasBin: true - dev: false - - /playwright@1.43.0: - resolution: {integrity: sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==} - engines: {node: '>=16'} - hasBin: true - dependencies: - playwright-core: 1.43.0 - optionalDependencies: - fsevents: 2.3.2 - dev: false - - /undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - requiresBuild: true - dev: false - optional: true - - /zx@8.0.1: - resolution: {integrity: sha512-Y+ITW1GQjADk7qgrbhnukMgoNsJmlyx53cUQ6/6NXU+BMBdCbTc6flTOHUctmzKvPjTmdwaddzJY/dbLie9sQg==} - engines: {node: '>= 16.0.0'} - hasBin: true - optionalDependencies: - '@types/fs-extra': 11.0.4 - '@types/node': 20.12.7 - dev: false diff --git a/python/tests/session.json b/python/tests/session.json deleted file mode 100644 index 97367b91f2c..00000000000 --- a/python/tests/session.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "cookies": [ - { - "name": "authToken", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI4OGFhMjE1YS1jNjFiLTQ0NGItOWVhZS1iZjJhMDNmNTgzMWIiLCJlbWFpbCI6Imh1ZGl4dEBnbWFpbC5jb20iLCJpYXQiOjE3MTIzMDgwNzcsImV4cCI6MTcxNDkwMDA3N30.j26WMT-kt-WjLyW_9zF5J441RrlCLh8t2-564CBx3_I", - "domain": "backend.composio.dev", - "path": "/", - "expires": 1712912876.544323, - "httpOnly": true, - "secure": true, - "sameSite": "None" - }, - { - "name": "isLoggedIn", - "value": "true", - "domain": "app.composio.dev", - "path": "/", - "expires": 1714900076, - "httpOnly": false, - "secure": false, - "sameSite": "Lax" - }, - { - "name": "composio_email", - "value": "hudixt@gmail.com", - "domain": "app.composio.dev", - "path": "/", - "expires": 1714900076, - "httpOnly": false, - "secure": false, - "sameSite": "Lax" - }, - { - "name": "ph_phc_Gz8DBv1ZMbOwt3hE8sJZwKGsDl5FtMSkvBNSR0HC07c_posthog", - "value": "%7B%22distinct_id%22%3A%22hudixt%40gmail.com%22%2C%22%24sesid%22%3A%5B1712308080296%2C%22018ead83-6df3-7d6b-9c8d-458e9e991f30%22%2C1712308055539%5D%7D", - "domain": ".composio.dev", - "path": "/", - "expires": 1743844080, - "httpOnly": false, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "_octo", - "value": "GH1.1.63664123.1712308173", - "domain": ".github.com", - "path": "/", - "expires": 1743844172.069958, - "httpOnly": false, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "preferred_color_mode", - "value": "light", - "domain": ".github.com", - "path": "/", - "expires": -1, - "httpOnly": false, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "tz", - "value": "Asia%2FCalcutta", - "domain": ".github.com", - "path": "/", - "expires": -1, - "httpOnly": false, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "_device_id", - "value": "0e3a7efabef2f19f873dffe01d66ab17", - "domain": "github.com", - "path": "/", - "expires": 1743844655.292897, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "has_recent_activity", - "value": "1", - "domain": "github.com", - "path": "/", - "expires": 1712312305.18919, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "saved_user_sessions", - "value": "6849438%3AI6Wg_Aagj8GykK-FchA1lWwa4W6ogwHxrWB47Ko_iguszZcN", - "domain": "github.com", - "path": "/", - "expires": 1720084698.758532, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "user_session", - "value": "I6Wg_Aagj8GykK-FchA1lWwa4W6ogwHxrWB47Ko_iguszZcN", - "domain": "github.com", - "path": "/", - "expires": 1713518298.758679, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "__Host-user_session_same_site", - "value": "I6Wg_Aagj8GykK-FchA1lWwa4W6ogwHxrWB47Ko_iguszZcN", - "domain": "github.com", - "path": "/", - "expires": 1713518298.758705, - "httpOnly": true, - "secure": true, - "sameSite": "Strict" - }, - { - "name": "tz", - "value": "Asia%2FCalcutta", - "domain": "github.com", - "path": "/", - "expires": -1, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "color_mode", - "value": "%7B%22color_mode%22%3A%22dark%22%2C%22light_theme%22%3A%7B%22name%22%3A%22light%22%2C%22color_mode%22%3A%22light%22%7D%2C%22dark_theme%22%3A%7B%22name%22%3A%22dark%22%2C%22color_mode%22%3A%22dark%22%7D%7D", - "domain": ".github.com", - "path": "/", - "expires": -1, - "httpOnly": false, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "logged_in", - "value": "yes", - "domain": ".github.com", - "path": "/", - "expires": 1743844698.758782, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "dotcom_user", - "value": "himanshu-dixit", - "domain": ".github.com", - "path": "/", - "expires": 1743844698.758813, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - }, - { - "name": "_gh_sess", - "value": "mKASkpGe29rbd1vDMLUeDdV9Fnqsmg94rBoheBM1w%2B1uc5X%2FPJAdBpUvLBfc7lK8MVH29RVSQs%2FcBjthIZSmwfMMafg9Sr%2BJ3r%2BMt6lZ%2BwfeF0U4PpFFm5vlgm8meaw1%2BGzNi7%2BSlX6EBrBbmKHNIzoyBrqlVoTFd4wLy4U2UClZ34kyCdTkEdyuk%2BBcSw59FbKjBdvR3BqFupFvUpoBLcNc69J7dK0K9vwe1sJVcdvyyT0704Wd7K%2F2CYcpoWo6SUCTWG%2B1CBDcdFJgopsqBJUfi9oO1iNqkKQgV%2Fu6w9XtHINCxKgVPfpcvL4ra3b5Mx%2FifrclsCC1A%2B4C8uLCxkOeGuciXYlv9M29qBX%2BXwxzxsDnWy401yvb225Rx936GcCCaEmEKRRhL%2FRuVpF6LuNwvm0nBlN%2BWMervfkQBTGS0IqIb9%2FbDKvKiCv44M0%2BWDaDSrf1PTUZKoEkIChAiMHz4eahT94WGOIq3sCK7VGPi4tbtJxUNhtr70JOKMOU%2FcUifsDC6KEFjCBjavImYydpMTR4xIv%2FeLt21DZ2OmIjiiS429cBxb8NJVa4kQWLlW7AFPtE%2BpocDHAaH2nFn3fnVf40RzbS6g%2BbObyCM4ivL3QaKvELzrYMxlYadUR0vYsfrWj3Ba9o%2FCGom2DV%2B9oMQP%2BLs0Jmk5KN%2FkGIxM4%2F3zjThPcAeRU3mD%2FsXcB4Vce6lONeUaDrhKfpwdQZNJKn5EN%2FaHXKO2QBco9jIYxSuCGuNXQbIOAayDi81NttnfSYdSXkFBOZsvfujulsfyMuXe6B4ApMzt%2FnyLB3VEZJYaozJtqFCP3j9SsHaEC0y%2B0B7pAfodt5d0BX%2BOIBeni4YGnp2aYnt1Xqm0CCJQXntJICwQjUKB1NfxtDLUME1IqjkqXeYgAOJsYTPw43S7WQZybEQ7R4lM8vx1ZrI6s%2FRnomVMXlkOFFdPFCntE54OZB6D5LL4UZe9lSDNVxD5EdCTHxUEej0UC1KRTjqe4jdl5TpKH0CTsSuQHIT%2FtoE6oYEdmozL4%2FT7fWMdjKgMGGkFrlLdm1VveTYl3ZbgcnnImf4j7heO7gNxfecH0qtLY8zNXa5smVpEfrBchBPitir2pmvpwGLONM27Fq36AmCNjl0ZC3Eg%3D%3D--63dPK2Np4KtxmP5H--sxzwnlAH%2BHI%2By3E3JTRJOQ%3D%3D", - "domain": "github.com", - "path": "/", - "expires": -1, - "httpOnly": true, - "secure": true, - "sameSite": "Lax" - } - ], - "origins": [ - { - "origin": "https://app.composio.dev", - "localStorage": [ - { - "name": "intercom.intercom-state", - "value": "{\"app\":{\"openConfig\":{\"spaces\":[],\"userHasReceivedChecklists\":false,\"userHasLiveNewsfeed\":false,\"userHasTickets\":false},\"selfServeSuggestionsMatch\":false,\"features\":{\"anonymousInboundMessages\":false,\"googleAnalytics\":false,\"inboundMessages\":false,\"outboundMessages\":false,\"googleAnalytics4Integration\":false},\"isInstantBootEnabled\":true,\"isDeveloperWorkspace\":false},\"launcher\":{\"isLauncherEnabled\":false},\"launcherDiscoveryMode\":{\"hasDiscoveredLauncher\":false},\"user\":{},\"message\":{},\"conversations\":{\"byId\":{}},\"openOnBoot\":{\"type\":null,\"metadata\":{}},\"operator\":{\"lastComposerEvent\":0},\"router\":{\"location\":null,\"action\":null,\"previousLocations\":[]}}" - }, - { - "name": "ph_phc_Gz8DBv1ZMbOwt3hE8sJZwKGsDl5FtMSkvBNSR0HC07c_posthog", - "value": "{\"distinct_id\":\"hudixt@gmail.com\",\"$sesid\":[1712308080296,\"018ead83-6df3-7d6b-9c8d-458e9e991f30\",1712308055539],\"$device_id\":\"018ead83-6ddf-7d7a-bbfe-7e7bf9ad9cdb\",\"$user_state\":\"identified\",\"$client_session_props\":{\"sessionId\":\"018ead83-6df3-7d6b-9c8d-458e9e991f30\",\"props\":{\"initialPathName\":\"/\",\"referringDomain\":\"$direct\"}},\"$session_recording_enabled_server_side\":true,\"$console_log_recording_enabled_server_side\":true,\"$session_recording_recorder_version_server_side\":\"v2\",\"$session_recording_network_payload_capture\":{\"capturePerformance\":true},\"$session_recording_canvas_recording\":{},\"$autocapture_disabled_server_side\":false,\"$active_feature_flags\":[\"custom_repo\"],\"$enabled_feature_flags\":{\"custom_repo\":true},\"$feature_flag_payloads\":{},\"$user_id\":\"hudixt@gmail.com\",\"$stored_person_properties\":{\"email\":\"hudixt@gmail.com\"}}" - } - ] - }, - { - "origin": "https://github.com", - "localStorage": [ - { - "name": "bundle-urls", - "value": "{\"wp-runtime.js\":\"https://github.githubassets.com/assets/wp-runtime-3828f7d1fc7f.js\",\"vendors-node_modules_dompurify_dist_purify_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_dompurify_dist_purify_js-6890e890956f.js\",\"vendors-node_modules_oddbird_popover-polyfill_dist_popover_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-7bd350d761f4.js\",\"vendors-node_modules_smoothscroll-polyfill_dist_smoothscroll_js-node_modules_stacktrace-parse-a448e4.js\":\"https://github.githubassets.com/assets/vendors-node_modules_smoothscroll-polyfill_dist_smoothscroll_js-node_modules_stacktrace-parse-a448e4-bb5415637fe0.js\",\"ui_packages_trusted-types-policies_policy_ts-ui_packages_trusted-types_trusted-types_ts.js\":\"https://github.githubassets.com/assets/ui_packages_trusted-types-policies_policy_ts-ui_packages_trusted-types_trusted-types_ts-87f4b80f478d.js\",\"environment.js\":\"https://github.githubassets.com/assets/environment-ed840352dfda.js\",\"vendors-node_modules_github_selector-observer_dist_index_esm_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-9f960d9b217c.js\",\"vendors-node_modules_primer_behaviors_dist_esm_focus-zone_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_focus-zone_js-086f7a27bac0.js\",\"vendors-node_modules_github_relative-time-element_dist_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-c76945c5961a.js\",\"vendors-node_modules_github_combobox-nav_dist_index_js-node_modules_github_markdown-toolbar-e-820fc0.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_combobox-nav_dist_index_js-node_modules_github_markdown-toolbar-e-820fc0-bc8f02b96749.js\",\"vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-14eb72583307.js\",\"vendors-node_modules_github_text-expander-element_dist_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-8a621df59e80.js\",\"vendors-node_modules_delegated-events_dist_index_js-node_modules_stacktrace-parser_dist_stack-443cd5.js\":\"https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_stacktrace-parser_dist_stack-443cd5-559829a63de0.js\",\"vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b7d8f4.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b7d8f4-654130b7cde5.js\",\"vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-3959a9.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-3959a9-134c7fee9431.js\",\"github-elements.js\":\"https://github.githubassets.com/assets/github-elements-817a1189f75d.js\",\"element-registry.js\":\"https://github.githubassets.com/assets/element-registry-9a5692830082.js\",\"vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-1acb1c.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-1acb1c-a745699a1cfa.js\",\"vendors-node_modules_lit-html_lit-html_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-5b376145beff.js\",\"vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_memoize_dist_esm_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_memoize_dist_esm_index_js-05801f7ca718.js\",\"vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-c91f4ad18b62.js\",\"vendors-node_modules_delegated-events_dist_index_js-node_modules_github_hydro-analytics-clien-b632a3.js\":\"https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_hydro-analytics-clien-b632a3-7938aac89f16.js\",\"vendors-node_modules_github_remote-form_dist_index_js-node_modules_scroll-anchoring_dist_scro-52dc4b.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_scroll-anchoring_dist_scro-52dc4b-4fecca2d00e4.js\",\"vendors-node_modules_color-convert_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-72c9fbde5ad4.js\",\"vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_jtml_lib_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_jtml_lib_index_js-95b84ee6bc34.js\",\"vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-ff65ee.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-ff65ee-c202d20e2d3d.js\",\"ui_packages_jtml-shimmed_jtml-shimmed_ts-ui_packages_safe-storage_safe-storage_ts.js\":\"https://github.githubassets.com/assets/ui_packages_jtml-shimmed_jtml-shimmed_ts-ui_packages_safe-storage_safe-storage_ts-19f49df05d21.js\",\"app_assets_modules_github_updatable-content_ts-ui_packages_hydro-analytics_hydro-analytics_ts-82813f.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-ui_packages_hydro-analytics_hydro-analytics_ts-82813f-fb8253d1c2f5.js\",\"app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_onfocus_ts-app_ass-421cec.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_onfocus_ts-app_ass-421cec-9de4213015af.js\",\"app_assets_modules_github_sticky-scroll-into-view_ts.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-94209c43e6af.js\",\"app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-2e2258.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-2e2258-05fd80a7ea89.js\",\"app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-9285faa0e011.js\",\"behaviors.js\":\"https://github.githubassets.com/assets/behaviors-5f00c24f2137.js\",\"vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531.js\":\"https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-2ea61fcc9a71.js\",\"notifications-global.js\":\"https://github.githubassets.com/assets/notifications-global-6d6db5144cc3.js\",\"vendors-node_modules_delegated-events_dist_index_js-node_modules_stacktrace-parser_dist_stack-8189f0.js\":\"https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_stacktrace-parser_dist_stack-8189f0-44949a0e0322.js\",\"marketing.js\":\"https://github.githubassets.com/assets/marketing-855932953f6a.js\",\"home.js\":\"https://github.githubassets.com/assets/home-5523b374aaa9.js\",\"vendors-node_modules_github_webgl-globe_dist_js_main_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_webgl-globe_dist_js_main_js-cf5f119d1214.js\",\"webgl-globe.js\":\"https://github.githubassets.com/assets/webgl-globe-d3e3295f0ac2.js\",\"react-lib.js\":\"https://github.githubassets.com/assets/react-lib-1fbfc5be2c18.js\",\"vendors-node_modules_primer_octicons-react_dist_index_esm_js-node_modules_primer_react_lib-es-541a38.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_octicons-react_dist_index_esm_js-node_modules_primer_react_lib-es-541a38-c07b07af7c0d.js\",\"vendors-node_modules_primer_react_lib-esm_Box_Box_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Box_Box_js-8f8c5e2a2cbf.js\",\"vendors-node_modules_primer_react_lib-esm_Button_Button_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Button_Button_js-95a7748e3c39.js\",\"vendors-node_modules_primer_react_lib-esm_TooltipV2_Tooltip_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_TooltipV2_Tooltip_js-70d5275ffcb7.js\",\"vendors-node_modules_primer_react_lib-esm_ActionList_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_ActionList_index_js-5401af055c2c.js\",\"vendors-node_modules_primer_react_lib-esm_Button_IconButton_js-node_modules_primer_react_lib--610986.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Button_IconButton_js-node_modules_primer_react_lib--610986-df5a52bd0a99.js\",\"ui_packages_react-core_create-browser-history_ts-ui_packages_safe-storage_safe-storage_ts-ui_-682c2c.js\":\"https://github.githubassets.com/assets/ui_packages_react-core_create-browser-history_ts-ui_packages_safe-storage_safe-storage_ts-ui_-682c2c-7be102c61d97.js\",\"keyboard-shortcuts-dialog.js\":\"https://github.githubassets.com/assets/keyboard-shortcuts-dialog-55cc6b01aee5.js\",\"vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-99519581d0f8.js\",\"sessions.js\":\"https://github.githubassets.com/assets/sessions-694c8423e347.js\",\"light.css\":\"https://github.githubassets.com/assets/light-0eace2597ca3.css\",\"dark.css\":\"https://github.githubassets.com/assets/dark-a167e256da9c.css\",\"primer-primitives.css\":\"https://github.githubassets.com/assets/primer-primitives-366b5c973fad.css\",\"primer.css\":\"https://github.githubassets.com/assets/primer-44fa1513ddd0.css\",\"global.css\":\"https://github.githubassets.com/assets/global-dc4670c5d15d.css\",\"github.css\":\"https://github.githubassets.com/assets/github-f1c434a52a69.css\",\"dashboard.css\":\"https://github.githubassets.com/assets/dashboard-eff640980650.css\",\"discussions.css\":\"https://github.githubassets.com/assets/discussions-4a9715cdd9f3.css\",\"site.css\":\"https://github.githubassets.com/assets/site-fe2057b57083.css\",\"home.css\":\"https://github.githubassets.com/assets/home-993d2c38b2c1.css\",\"vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_delegated-events_di-94a48b.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_delegated-events_di-94a48b-793ce2c025bd.js\",\"vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js-878844713bc9.js\",\"vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-045591.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-045591-bc89387d00c4.js\",\"app_assets_modules_github_filter-input_ts.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_filter-input_ts-a5bf7ded6592.js\",\"app_assets_modules_github_ref-selector_ts.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-54fecb2be147.js\",\"app_assets_modules_github_behaviors_details_ts-app_assets_modules_github_onfocus_ts-app_asset-d34eef.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_behaviors_details_ts-app_assets_modules_github_onfocus_ts-app_asset-d34eef-d214b7c1c950.js\",\"settings.js\":\"https://github.githubassets.com/assets/settings-af2d2e4ae169.js\",\"signup.js\":\"https://github.githubassets.com/assets/signup-529c28197b91.js\",\"vendors-node_modules_lodash-es__Stack_js-node_modules_lodash-es__Uint8Array_js-node_modules_l-e2b6ab.js\":\"https://github.githubassets.com/assets/vendors-node_modules_lodash-es__Stack_js-node_modules_lodash-es__Uint8Array_js-node_modules_l-e2b6ab-53248aafae87.js\",\"vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_remote-form_dist_-c1ee80.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_remote-form_dist_-c1ee80-0c02f5b487d2.js\",\"vendors-node_modules_github_hotkey_dist_index_js-node_modules_lodash-es_isEqual_js-node_modul-9dd274.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_hotkey_dist_index_js-node_modules_lodash-es_isEqual_js-node_modul-9dd274-f368774844b1.js\",\"app_assets_modules_github_behaviors_inline-comment_ts-ui_packages_aria-live_aria-live_ts-ui_p-c9ec3c.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_behaviors_inline-comment_ts-ui_packages_aria-live_aria-live_ts-ui_p-c9ec3c-535d8ecb061f.js\",\"app_assets_modules_github_profile_pinned-item-reordering_ts-ui_packages_fetch-utils_fetch-uti-198397.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_profile_pinned-item-reordering_ts-ui_packages_fetch-utils_fetch-uti-198397-af43f7d9c95e.js\",\"app_assets_modules_github_discussions_voting_ts-app_assets_modules_github_has-interactions_ts-cc28cb.js\":\"https://github.githubassets.com/assets/app_assets_modules_github_discussions_voting_ts-app_assets_modules_github_has-interactions_ts-cc28cb-37fedba67ef3.js\",\"dashboard.js\":\"https://github.githubassets.com/assets/dashboard-e882561cdf89.js\",\"vendors-node_modules_github_clipboard-copy-element_dist_index_esm_js-node_modules_delegated-e-b37f7d.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_clipboard-copy-element_dist_index_esm_js-node_modules_delegated-e-b37f7d-6c7c27fd1f12.js\",\"command-palette.js\":\"https://github.githubassets.com/assets/command-palette-5a8f1ca7246f.js\",\"dark_v2.css\":\"https://github.githubassets.com/assets/dark_v2-2ac5f5fe1aeb.css\",\"vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-e53a3f.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-e53a3f-f88b44202115.js\",\"codespaces.js\":\"https://github.githubassets.com/assets/codespaces-ada11cc888bd.js\",\"vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-55cf52.js\":\"https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-55cf52-e14cb4b719b4.js\",\"repositories.js\":\"https://github.githubassets.com/assets/repositories-705cdcf2f997.js\",\"code-menu.js\":\"https://github.githubassets.com/assets/code-menu-6ed703a40ffd.js\",\"vendors-node_modules_primer_react_lib-esm_Overlay_Overlay_js-node_modules_primer_react_lib-es-fa1130.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Overlay_Overlay_js-node_modules_primer_react_lib-es-fa1130-829932cf63db.js\",\"vendors-node_modules_primer_react_lib-esm_ActionMenu_ActionMenu_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_ActionMenu_ActionMenu_js-eaf74522e470.js\",\"vendors-node_modules_primer_react_lib-esm_Heading_Heading_js-node_modules_github_catalyst_lib-b39cf6.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Heading_Heading_js-node_modules_github_catalyst_lib-b39cf6-b74f76286b95.js\",\"vendors-node_modules_react-router-dom_dist_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_react-router-dom_dist_index_js-3b41341d50fe.js\",\"vendors-node_modules_primer_react_lib-esm_Dialog_js-node_modules_react-virtual_dist_react-vir-155ebc.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Dialog_js-node_modules_react-virtual_dist_react-vir-155ebc-07457159712f.js\",\"vendors-node_modules_primer_react_lib-esm_UnderlineNav_index_js.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_UnderlineNav_index_js-89fa5806aa3c.js\",\"vendors-node_modules_primer_react_lib-esm_AvatarStack_AvatarStack_js-node_modules_primer_reac-36b6f3.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_AvatarStack_AvatarStack_js-node_modules_primer_reac-36b6f3-1b3c8357c7d0.js\",\"vendors-node_modules_primer_react_lib-esm_Dialog_Dialog_js-node_modules_primer_react_lib-esm_-114c24.js\":\"https://github.githubassets.com/assets/vendors-node_modules_primer_react_lib-esm_Dialog_Dialog_js-node_modules_primer_react_lib-esm_-114c24-1306e57fe74e.js\",\"ui_packages_ref-selector_RefSelector_tsx.js\":\"https://github.githubassets.com/assets/ui_packages_ref-selector_RefSelector_tsx-dbbdef4348e2.js\",\"app_assets_modules_react-shared_hooks_use-canonical-object_ts-ui_packages_code-view-shared_ho-e725dc.js\":\"https://github.githubassets.com/assets/app_assets_modules_react-shared_hooks_use-canonical-object_ts-ui_packages_code-view-shared_ho-e725dc-1cefd136a8f5.js\",\"repos-overview.js\":\"https://github.githubassets.com/assets/repos-overview-444fc767eb92.js\",\"repository.css\":\"https://github.githubassets.com/assets/repository-c7fc2cc90211.css\",\"code.css\":\"https://github.githubassets.com/assets/code-111be5e4092d.css\"}" - }, - { - "name": "jump_to:page_views", - "value": "{\"repository:SamparkAI/hermes\":{\"lastVisitedAt\":1712308704,\"visitCount\":1}}" - } - ] - } - ] - } \ No newline at end of file diff --git a/tools.py b/tools.py deleted file mode 100644 index b4c27ba1c62..00000000000 --- a/tools.py +++ /dev/null @@ -1,22 +0,0 @@ -import typing as t -from typing import Type -from praisonai_tools import BaseTool -from composio_praisonai import ComposioToolSet -from langchain.pydantic_v1 import BaseModel, Field - - - -class SERPAPI_SEARCH_PARAMS(BaseModel): - query: str = Field(description="The search query for the SERP API.") - -class SERPAPI_SEARCH_TOOL(BaseTool): - name: str = "SERPAPI_SEARCH_TOOL" - description: str = "Perform a Google search using the SERP API." - args_schema: Type[BaseModel] = SERPAPI_SEARCH_PARAMS - - def _run(self, **kwargs: t.Any) -> t.Any: - toolset = ComposioToolSet(entity_id='default') - return toolset.execute_tool( - tool_identifier="serpapi_search", - params=kwargs, - ) \ No newline at end of file From d26d62fb4a9c9d2b104e6928a9fc9d915e4be409 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Mon, 28 Oct 2024 20:45:29 +0530 Subject: [PATCH 2/2] lint --- python/composio/client/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/composio/client/__init__.py b/python/composio/client/__init__.py index 9542b6c4a4d..440de641a9e 100644 --- a/python/composio/client/__init__.py +++ b/python/composio/client/__init__.py @@ -258,7 +258,7 @@ def execute( entity_id=self.id, session_id=session_id, text=text, - auth=auth + auth=auth, ) connected_account = self.get_connection( @@ -273,7 +273,7 @@ def execute( connected_account=connected_account.id, session_id=session_id, text=text, - auth=auth + auth=auth, ) def get_connection(