Skip to content

Commit

Permalink
fix: make app optional on get_auth_params
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Oct 17, 2024
1 parent 366f976 commit 9659e77
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/composio/tools/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,18 +931,20 @@ def format_list(items):

def get_auth_params(
self,
app: AppType,
app: t.Optional[AppType] = None,
connection_id: t.Optional[str] = None,
entity_id: t.Optional[str] = None,
) -> t.Optional[ConnectionParams]:
"""Get authentication parameters for given app."""
app = App(app)
if app.is_local:
return None
if app is None and connection_id is None:
raise ComposioSDKError("Both `app` and `connection_id` cannot be `None`")

try:
connection_id = (
connection_id
or self.client.get_entity(id=self.entity_id).get_connection(app=app).id
or self.client.get_entity(id=entity_id or self.entity_id)
.get_connection(app=app)
.id
)
return self.client.connected_accounts.info(connection_id=connection_id)
except ComposioClientError:
Expand Down

0 comments on commit 9659e77

Please sign in to comment.