-
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: enable configuration of
response_char_limit
for tools (#2207)
- Loading branch information
1 parent
85a9046
commit af5ef6d
Showing
7 changed files
with
133 additions
and
27 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
alembic/versions/a91994b9752f_add_column_to_tools_table_to_contain_.py
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,39 @@ | ||
"""add column to tools table to contain function return limit return_char_limit | ||
Revision ID: a91994b9752f | ||
Revises: e1a625072dbf | ||
Create Date: 2024-12-09 18:27:25.650079 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
from letta.constants import FUNCTION_RETURN_CHAR_LIMIT | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "a91994b9752f" | ||
down_revision: Union[str, None] = "e1a625072dbf" | ||
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! ### | ||
op.add_column("tools", sa.Column("return_char_limit", sa.Integer(), nullable=True)) | ||
|
||
# Populate `return_char_limit` column | ||
op.execute( | ||
f""" | ||
UPDATE tools | ||
SET return_char_limit = {FUNCTION_RETURN_CHAR_LIMIT} | ||
""" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("tools", "return_char_limit") | ||
# ### 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
Oops, something went wrong.