Skip to content

Commit

Permalink
Merge branch 'main' into bump-6.14
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahwooders authored Jan 23, 2025
2 parents 829debb + fd66fbf commit 419adf2
Show file tree
Hide file tree
Showing 76 changed files with 1,422 additions and 1,324 deletions.
51 changes: 51 additions & 0 deletions alembic/versions/f895232c144a_backfill_composio_tools.py
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 ###
2 changes: 1 addition & 1 deletion examples/docs/agent_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
),
],
# LLM model & endpoint configuration
llm="openai/gpt-4",
model="openai/gpt-4",
context_window_limit=8000,
# embedding model & endpoint configuration (cannot be changed)
embedding="openai/text-embedding-ada-002",
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/agent_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
),
],
# set automatic defaults for LLM/embedding config
llm="openai/gpt-4",
model="openai/gpt-4",
embedding="openai/text-embedding-ada-002",
)
print(f"Created agent with name {agent_state.name} and unique ID {agent_state.id}")
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main():
value="I am a friendly AI",
),
],
llm=llm_configs[0].handle,
model=llm_configs[0].handle,
embedding=embedding_configs[0].handle,
)
print(f"Created agent: {agent_state.name} with ID {str(agent_state.id)}")
Expand Down
4 changes: 2 additions & 2 deletions examples/docs/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def roll_d20() -> str:
),
],
# set automatic defaults for LLM/embedding config
llm="openai/gpt-4",
model="openai/gpt-4",
embedding="openai/text-embedding-ada-002",
# create the agent with an additional tool
tool_ids=[tool.id],
Expand Down Expand Up @@ -88,7 +88,7 @@ def roll_d20() -> str:
value="username: sarah",
),
],
llm="openai/gpt-4",
model="openai/gpt-4",
embedding="openai/text-embedding-ada-002",
include_base_tools=False,
tool_ids=[tool.id, send_message_tool],
Expand Down
12 changes: 6 additions & 6 deletions examples/notebooks/Agentic RAG with Letta.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
}
],
"source": [
"client.jobs.get(job_id=job.id).metadata_"
"client.jobs.get(job_id=job.id).metadata"
]
},
{
Expand All @@ -118,7 +118,7 @@
" value=\"Name: Sarah\",\n",
" ),\n",
" ],\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
")"
]
Expand Down Expand Up @@ -305,7 +305,7 @@
" ),\n",
" ],\n",
" # set automatic defaults for LLM/embedding config\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
")\n",
"normal_agent.tools"
Expand Down Expand Up @@ -345,7 +345,7 @@
" ),\n",
" ],\n",
" # set automatic defaults for LLM/embedding config\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
" tools=['send_message'], \n",
" include_base_tools=False\n",
Expand Down Expand Up @@ -422,7 +422,7 @@
" + \"that you use to lookup information about users' birthdays.\"\n",
" ),\n",
" ],\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\"\n",
")"
]
Expand Down Expand Up @@ -852,7 +852,7 @@
" ),\n",
" ],\n",
" tool_ids=[search_tool.id], \n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
")"
]
},
Expand Down
10 changes: 5 additions & 5 deletions examples/notebooks/Multi-agent recruiting workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
" ],\n",
" block_ids=[org_block.id],\n",
" tool_ids=[read_resume_tool.id, submit_evaluation_tool.id]\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
")\n"
]
Expand Down Expand Up @@ -251,7 +251,7 @@
" ],\n",
" block_ids=[org_block.id],\n",
" tool_ids=[email_candidate_tool.id]\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
")"
]
Expand Down Expand Up @@ -623,7 +623,7 @@
" ],\n",
" block_ids=[org_block.id],\n",
" tool_ids=[read_resume_tool.id, submit_evaluation_tool.id]\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
")\n",
"\n",
Expand All @@ -637,7 +637,7 @@
" ],\n",
" block_ids=[org_block.id],\n",
" tool_ids=[email_candidate_tool.id]\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\",\n",
")"
]
Expand Down Expand Up @@ -740,7 +740,7 @@
" ],\n",
" block_ids=[org_block.id],\n",
" tool_ids=[search_candidate_tool.id, consider_candidate_tool.id],\n",
" llm=\"openai/gpt-4\",\n",
" model=\"openai/gpt-4\",\n",
" embedding=\"openai/text-embedding-ada-002\"\n",
")\n",
" \n"
Expand Down
2 changes: 1 addition & 1 deletion letta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

__version__ = "0.6.14"


Expand All @@ -15,7 +16,6 @@
from letta.schemas.llm_config import LLMConfig
from letta.schemas.memory import ArchivalMemorySummary, BasicBlockMemory, ChatMemory, Memory, RecallMemorySummary
from letta.schemas.message import Message
from letta.schemas.openai.chat_completion_response import UsageStatistics
from letta.schemas.organization import Organization
from letta.schemas.passage import Passage
from letta.schemas.source import Source
Expand Down
Loading

0 comments on commit 419adf2

Please sign in to comment.