-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Identify Composio tools (#721)
Co-authored-by: Caren Thomas <[email protected]> Co-authored-by: Shubham Naik <[email protected]> Co-authored-by: Shubham Naik <[email protected]> Co-authored-by: mlong93 <[email protected]> Co-authored-by: Mindy Long <[email protected]>
- Loading branch information
1 parent
bb91dab
commit cc8f93c
Showing
12 changed files
with
210 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""Backfill composio tools | ||
Revision ID: f895232c144a | ||
Revises: 25fc99e97839 | ||
Create Date: 2025-01-16 14:21:33.764332 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
from letta.orm.enums import ToolType | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "f895232c144a" | ||
down_revision: Union[str, None] = "416b9d2db10b" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
# Define the value for EXTERNAL_COMPOSIO | ||
external_composio_value = ToolType.EXTERNAL_COMPOSIO.value | ||
|
||
# Update tool_type to EXTERNAL_COMPOSIO if the tags field includes "composio" | ||
# This is super brittle and awful but no other way to do this | ||
op.execute( | ||
f""" | ||
UPDATE tools | ||
SET tool_type = '{external_composio_value}' | ||
WHERE tags::jsonb @> '["composio"]'; | ||
""" | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
custom_value = ToolType.CUSTOM.value | ||
|
||
# Update tool_type to CUSTOM if the tags field includes "composio" | ||
# This is super brittle and awful but no other way to do this | ||
op.execute( | ||
f""" | ||
UPDATE tools | ||
SET tool_type = '{custom_value}' | ||
WHERE tags::jsonb @> '["composio"]'; | ||
""" | ||
) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.