chore: bump version 0.8.12 (#2712)
This commit is contained in:
@@ -5,8 +5,7 @@ try:
|
||||
__version__ = version("letta")
|
||||
except PackageNotFoundError:
|
||||
# Fallback for development installations
|
||||
__version__ = "0.8.11"
|
||||
|
||||
__version__ = "0.8.12"
|
||||
|
||||
if os.environ.get("LETTA_VERSION"):
|
||||
__version__ = os.environ["LETTA_VERSION"]
|
||||
|
||||
@@ -101,6 +101,14 @@ async def retrieve_block(
|
||||
@router.get("/{block_id}/agents", response_model=List[AgentState], operation_id="list_agents_for_block")
|
||||
async def list_agents_for_block(
|
||||
block_id: str,
|
||||
include_relationships: list[str] | None = Query(
|
||||
None,
|
||||
description=(
|
||||
"Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. "
|
||||
"If not provided, all relationships are loaded by default. "
|
||||
"Using this can optimize performance by reducing unnecessary joins."
|
||||
),
|
||||
),
|
||||
server: SyncServer = Depends(get_letta_server),
|
||||
actor_id: Optional[str] = Header(None, alias="user_id"),
|
||||
):
|
||||
@@ -110,7 +118,9 @@ async def list_agents_for_block(
|
||||
"""
|
||||
actor = await server.user_manager.get_actor_or_default_async(actor_id=actor_id)
|
||||
try:
|
||||
agents = await server.block_manager.get_agents_for_block_async(block_id=block_id, actor=actor)
|
||||
agents = await server.block_manager.get_agents_for_block_async(
|
||||
block_id=block_id, include_relationships=include_relationships, actor=actor
|
||||
)
|
||||
return agents
|
||||
except NoResultFound:
|
||||
raise HTTPException(status_code=404, detail=f"Block with id={block_id} not found")
|
||||
|
||||
@@ -286,14 +286,20 @@ class BlockManager:
|
||||
|
||||
@trace_method
|
||||
@enforce_types
|
||||
async def get_agents_for_block_async(self, block_id: str, actor: PydanticUser) -> List[PydanticAgentState]:
|
||||
async def get_agents_for_block_async(
|
||||
self,
|
||||
block_id: str,
|
||||
actor: PydanticUser,
|
||||
include_relationships: Optional[List[str]] = None,
|
||||
) -> List[PydanticAgentState]:
|
||||
"""
|
||||
Retrieve all agents associated with a given block.
|
||||
"""
|
||||
async with db_registry.async_session() as session:
|
||||
block = await BlockModel.read_async(db_session=session, identifier=block_id, actor=actor)
|
||||
agents_orm = block.agents
|
||||
return await asyncio.gather(*[agent.to_pydantic_async() for agent in agents_orm])
|
||||
agents = await asyncio.gather(*[agent.to_pydantic_async(include_relationships=include_relationships) for agent in agents_orm])
|
||||
return agents
|
||||
|
||||
@trace_method
|
||||
@enforce_types
|
||||
|
||||
@@ -158,6 +158,7 @@ class AsyncToolSandboxLocal(AsyncToolSandboxBase):
|
||||
if not settings.debug:
|
||||
os.remove(temp_file_path)
|
||||
|
||||
@trace_method
|
||||
async def _prepare_venv(self, local_configs, venv_path: str, env: Dict[str, str]):
|
||||
"""
|
||||
Prepare virtual environment asynchronously (in a background thread).
|
||||
@@ -174,11 +175,12 @@ class AsyncToolSandboxLocal(AsyncToolSandboxBase):
|
||||
)
|
||||
log_event(name="finish create_venv_for_local_sandbox")
|
||||
|
||||
log_event(name="start install_pip_requirements_for_sandbox", attributes={"local_configs": local_configs.model_dump_json()})
|
||||
await asyncio.to_thread(
|
||||
install_pip_requirements_for_sandbox, local_configs, upgrade=True, user_install_if_no_venv=False, env=env, tool=self.tool
|
||||
)
|
||||
log_event(name="finish install_pip_requirements_for_sandbox", attributes={"local_configs": local_configs.model_dump_json()})
|
||||
if local_configs.pip_requirements or (self.tool and self.tool.pip_requirements):
|
||||
log_event(name="start install_pip_requirements_for_sandbox", attributes={"local_configs": local_configs.model_dump_json()})
|
||||
await asyncio.to_thread(
|
||||
install_pip_requirements_for_sandbox, local_configs, upgrade=True, user_install_if_no_venv=False, env=env, tool=self.tool
|
||||
)
|
||||
log_event(name="finish install_pip_requirements_for_sandbox", attributes={"local_configs": local_configs.model_dump_json()})
|
||||
|
||||
@trace_method
|
||||
async def _execute_tool_subprocess(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "letta"
|
||||
version = "0.8.11"
|
||||
version = "0.8.12"
|
||||
packages = [
|
||||
{include = "letta"},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user