From 919b9e913eff976684f6c81d0d0804386e24782b Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 4 Aug 2024 17:59:57 -0400 Subject: [PATCH 1/5] feat(agents-api): Reimplement agents routes Signed-off-by: Diwank Tomer --- .../agents_api/models/agent/create_agent.py | 12 ++------ agents-api/agents_api/models/utils.py | 17 ++++++----- .../agents_api/routers/agents/__init__.py | 22 +++++++++----- .../agents_api/routers/agents/create_agent.py | 24 +++++---------- ...te_agent_tools.py => create_agent_tool.py} | 21 ++++++------- .../routers/agents/create_or_update_agent.py | 19 +++++------- .../agents_api/routers/agents/delete_agent.py | 12 ++------ ...te_agent_tools.py => delete_agent_tool.py} | 2 +- .../routers/agents/get_agent_details.py | 12 ++------ .../routers/agents/list_agent_tools.py | 24 +++++++-------- .../agents_api/routers/agents/list_agents.py | 13 +++++--- .../agents_api/routers/agents/patch_agent.py | 28 ++++++----------- ...tch_agent_tools.py => patch_agent_tool.py} | 20 +++++-------- .../agents_api/routers/agents/update_agent.py | 30 ++++++------------- ...te_agent_tools.py => update_agent_tool.py} | 18 +++++------ 15 files changed, 111 insertions(+), 163 deletions(-) rename agents-api/agents_api/routers/agents/{create_agent_tools.py => create_agent_tool.py} (53%) rename agents-api/agents_api/routers/agents/{delete_agent_tools.py => delete_agent_tool.py} (95%) rename agents-api/agents_api/routers/agents/{patch_agent_tools.py => patch_agent_tool.py} (61%) rename agents-api/agents_api/routers/agents/{update_agent_tools.py => update_agent_tool.py} (65%) diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index 0e86c6634..404276a23 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -43,18 +43,12 @@ def create_agent( Constructs and executes a datalog query to create a new agent in the database. Parameters: - - agent_id (UUID): The unique identifier for the agent. + - agent_id (UUID | None): The unique identifier for the agent. - developer_id (UUID): The unique identifier for the developer creating the agent. - - name (str): The name of the agent. - - about (str): A description of the agent. - - instructions (list[str], optional): A list of instructions for using the agent. Defaults to an empty list. - - model (str, optional): The model identifier for the agent. Defaults to "julep-ai/samantha-1-turbo". - - metadata (dict, optional): A dictionary of metadata for the agent. Defaults to an empty dict. - - default_settings (dict, optional): A dictionary of default settings for the agent. Defaults to an empty dict. - - client (CozoClient, optional): The CozoDB client instance to use for the query. Defaults to a preconfigured client instance. + - data (CreateAgentRequest): The data for the new agent. Returns: - Agent: The newly created agent record. + - Agent: The newly created agent record. """ agent_id = agent_id or uuid4() diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index 1aea0e07e..5eafe4d78 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -1,7 +1,7 @@ import inspect import re from functools import partialmethod, wraps -from typing import Any, Callable, ParamSpec, Type +from typing import Any, Callable, ParamSpec, Type, TypeVar from uuid import UUID import pandas as pd @@ -11,6 +11,7 @@ from ..common.utils.cozo import uuid_int_list_to_uuid4 P = ParamSpec("P") +T = TypeVar("T") def fix_uuid( @@ -126,7 +127,9 @@ def cozo_query_dec(func: Callable[P, tuple[str | list[str], dict]]): from pprint import pprint @wraps(func) - def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: + def wrapper( + *args: P.args, client=cozo_client, **kwargs: P.kwargs + ) -> pd.DataFrame: queries, variables = func(*args, **kwargs) if isinstance(queries, str): @@ -173,9 +176,9 @@ def wrap_in_class( one: bool = False, transform: Callable[[dict], dict] | None = None, ): - def decorator(func: Callable[..., pd.DataFrame]): + def decorator(func: Callable[P, pd.DataFrame]): @wraps(func) - def wrapper(*args, **kwargs): + def wrapper(*args: P.args, **kwargs: P.kwargs): df = func(*args, **kwargs) # Convert df to list of dicts @@ -206,13 +209,13 @@ def rewrap_exceptions( ], /, ): - def decorator(func: Callable[..., Any]): + def decorator(func: Callable[P, T]): @wraps(func) - def wrapper(*args, **kwargs): + def wrapper(*args: P.args, **kwargs: P.kwargs) -> T: nonlocal mapping try: - result = func(*args, **kwargs) + result: T = func(*args, **kwargs) except BaseException as error: for check, transform in mapping.items(): diff --git a/agents-api/agents_api/routers/agents/__init__.py b/agents-api/agents_api/routers/agents/__init__.py index 54624e374..2eadecb3d 100644 --- a/agents-api/agents_api/routers/agents/__init__.py +++ b/agents-api/agents_api/routers/agents/__init__.py @@ -1,7 +1,15 @@ -from .create_agent import create_agent # noqa: F401 -from .delete_agent import delete_agent # noqa: F401 -from .get_agent_details import get_agent_details # noqa: F401 -from .list_agents import list_agents # noqa: F401 -from .patch_agent import patch_agent # noqa: F401 -from .router import router # noqa: F401 -from .update_agent import update_agent # noqa: F401 +# ruff: noqa: F401 + +from .create_agent import create_agent +from .create_agent_tool import create_agent_tool +from .create_or_update_agent import create_or_update_agent +from .delete_agent import delete_agent +from .delete_agent_tool import delete_agent_tool +from .get_agent_details import get_agent_details +from .list_agent_tools import list_agent_tools +from .list_agents import list_agents +from .patch_agent import patch_agent +from .patch_agent_tool import patch_agent_tool +from .router import router +from .update_agent import update_agent +from .update_agent_tool import update_agent_tool diff --git a/agents-api/agents_api/routers/agents/create_agent.py b/agents-api/agents_api/routers/agents/create_agent.py index d1b04e1f4..f6e60e728 100644 --- a/agents-api/agents_api/routers/agents/create_agent.py +++ b/agents-api/agents_api/routers/agents/create_agent.py @@ -1,37 +1,27 @@ from typing import Annotated -from uuid import uuid4 from fastapi import Depends from pydantic import UUID4 from starlette.status import HTTP_201_CREATED +import agents_api.models as models + from ...autogen.openapi_model import ( CreateAgentRequest, ResourceCreatedResponse, ) from ...dependencies.developer_id import get_developer_id -from ...models.agent.create_agent import create_agent as create_agent_query from .router import router @router.post("/agents", status_code=HTTP_201_CREATED, tags=["agents"]) async def create_agent( - request: CreateAgentRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + data: CreateAgentRequest, ) -> ResourceCreatedResponse: - new_agent_id = uuid4() - - _, resp = next( - create_agent_query( - developer_id=x_developer_id, - agent_id=new_agent_id, - name=request.name, - about=request.about, - instructions=request.instructions or [], - model=request.model, - default_settings=request.default_settings or {}, - metadata=request.metadata or {}, - ).iterrows() + agent = models.agent.create_agent( + developer_id=x_developer_id, + data=data, ) - return ResourceCreatedResponse(id=new_agent_id, created_at=resp["created_at"]) + return ResourceCreatedResponse(id=agent.id, created_at=agent.created_at) diff --git a/agents-api/agents_api/routers/agents/create_agent_tools.py b/agents-api/agents_api/routers/agents/create_agent_tool.py similarity index 53% rename from agents-api/agents_api/routers/agents/create_agent_tools.py rename to agents-api/agents_api/routers/agents/create_agent_tool.py index cafd6cb07..aaa434743 100644 --- a/agents-api/agents_api/routers/agents/create_agent_tools.py +++ b/agents-api/agents_api/routers/agents/create_agent_tool.py @@ -5,29 +5,26 @@ from pydantic import UUID4 from starlette.status import HTTP_201_CREATED +import agents_api.models as models + from ...autogen.openapi_model import ( CreateToolRequest, ResourceCreatedResponse, ) from ...dependencies.developer_id import get_developer_id -from ...models.tools.create_tools import create_tools as create_tools_query from .router import router @router.post("/agents/{agent_id}/tools", status_code=HTTP_201_CREATED, tags=["agents"]) -async def create_agent_tools( +async def create_agent_tool( agent_id: UUID, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], - data: list[CreateToolRequest], - ignore_existing: bool = False, + data: CreateToolRequest, ) -> ResourceCreatedResponse: - _, resp = next( - create_tools_query( - developer_id=x_developer_id, - agent_id=agent_id, - data=data, - ignore_existing=ignore_existing, - ).iterrows() + tool = models.tools.create_tools( + developer_id=x_developer_id, + agent_id=agent_id, + data=[data], ) - return ResourceCreatedResponse(id=resp["tool_id"], created_at=resp["created_at"]) + return ResourceCreatedResponse(id=tool.id, created_at=tool.created_at) diff --git a/agents-api/agents_api/routers/agents/create_or_update_agent.py b/agents-api/agents_api/routers/agents/create_or_update_agent.py index bcd53f800..0c40c98b8 100644 --- a/agents-api/agents_api/routers/agents/create_or_update_agent.py +++ b/agents-api/agents_api/routers/agents/create_or_update_agent.py @@ -5,29 +5,26 @@ from pydantic import UUID4 from starlette.status import HTTP_201_CREATED +import agents_api.models as models + from ...autogen.openapi_model import ( CreateOrUpdateAgentRequest, ResourceCreatedResponse, ) from ...dependencies.developer_id import get_developer_id -from ...models.agent.create_or_update_agent import ( - create_or_update_agent as create_or_update_agent_query, -) from .router import router @router.post("/agents/{agent_id}", status_code=HTTP_201_CREATED, tags=["agents"]) async def create_or_update_agent( agent_id: UUID, - x_developer_id: Annotated[UUID4, Depends(get_developer_id)], data: CreateOrUpdateAgentRequest, + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], ) -> ResourceCreatedResponse: - _, resp = next( - create_or_update_agent_query( - developer_id=x_developer_id, - agent_id=agent_id, - data=data, - ).iterrows() + agent = models.agent.create_or_update_agent( + developer_id=x_developer_id, + agent_id=agent_id, + data=data, ) - return ResourceCreatedResponse(id=agent_id, created_at=resp["created_at"]) + return ResourceCreatedResponse(id=agent.id, created_at=agent.created_at) diff --git a/agents-api/agents_api/routers/agents/delete_agent.py b/agents-api/agents_api/routers/agents/delete_agent.py index 8a94dda46..4603c2217 100644 --- a/agents-api/agents_api/routers/agents/delete_agent.py +++ b/agents-api/agents_api/routers/agents/delete_agent.py @@ -1,12 +1,10 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_202_ACCEPTED, HTTP_404_NOT_FOUND +from starlette.status import HTTP_202_ACCEPTED from ...autogen.openapi_model import ResourceDeletedResponse -from ...common.exceptions.agents import AgentNotFoundError -from ...common.utils.datetime import utcnow from ...dependencies.developer_id import get_developer_id from ...models.agent.delete_agent import delete_agent as delete_agent_query from .router import router @@ -16,8 +14,4 @@ async def delete_agent( agent_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] ) -> ResourceDeletedResponse: - try: - delete_agent_query(x_developer_id, agent_id) - except AgentNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) - return ResourceDeletedResponse(id=agent_id, deleted_at=utcnow()) + return delete_agent_query(developer_id=x_developer_id, agent_id=agent_id) diff --git a/agents-api/agents_api/routers/agents/delete_agent_tools.py b/agents-api/agents_api/routers/agents/delete_agent_tool.py similarity index 95% rename from agents-api/agents_api/routers/agents/delete_agent_tools.py rename to agents-api/agents_api/routers/agents/delete_agent_tool.py index a2c5c147b..c220a2cf7 100644 --- a/agents-api/agents_api/routers/agents/delete_agent_tools.py +++ b/agents-api/agents_api/routers/agents/delete_agent_tool.py @@ -11,7 +11,7 @@ @router.delete("/agents/{agent_id}/tools/{tool_id}", tags=["agents"]) -async def delete_agent_tools( +async def delete_agent_tool( agent_id: UUID, tool_id: UUID, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], diff --git a/agents-api/agents_api/routers/agents/get_agent_details.py b/agents-api/agents_api/routers/agents/get_agent_details.py index d9c865cf0..04511527a 100644 --- a/agents-api/agents_api/routers/agents/get_agent_details.py +++ b/agents-api/agents_api/routers/agents/get_agent_details.py @@ -1,11 +1,9 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND from ...autogen.openapi_model import Agent -from ...common.exceptions.agents import AgentNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.agent.get_agent import get_agent as get_agent_query from .router import router @@ -16,10 +14,4 @@ async def get_agent_details( agent_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], ) -> Agent: - try: - agent = get_agent_query(developer_id=x_developer_id, agent_id=agent_id) - if not agent: - raise AgentNotFoundError(x_developer_id, agent_id) - return Agent(**agent) - except AgentNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) + return get_agent_query(developer_id=x_developer_id, agent_id=agent_id) diff --git a/agents-api/agents_api/routers/agents/list_agent_tools.py b/agents-api/agents_api/routers/agents/list_agent_tools.py index d4068d8a2..1b86f227a 100644 --- a/agents-api/agents_api/routers/agents/list_agent_tools.py +++ b/agents-api/agents_api/routers/agents/list_agent_tools.py @@ -4,6 +4,7 @@ from fastapi import Depends from pydantic import UUID4 +from ...autogen.openapi_model import Tool from ...dependencies.developer_id import get_developer_id from ...models.tools.list_tools import list_tools as list_tools_query from .router import router @@ -11,21 +12,18 @@ @router.get("/agents/{agent_id}/tools", tags=["agents"]) async def list_agent_tools( - agent_id: UUID, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + agent_id: UUID, limit: int = 100, offset: int = 0, sort_by: Literal["created_at", "updated_at"] = "created_at", direction: Literal["asc", "desc"] = "desc", -) -> list[tuple[str, dict]]: - return [ - row - for _, row in list_tools_query( - developer_id=x_developer_id, - agent_id=agent_id, - limit=limit, - offset=offset, - sort_by=sort_by, - direction=direction, - ).iterrows() - ] +) -> list[Tool]: + return list_tools_query( + agent_id=agent_id, + developer_id=x_developer_id, + limit=limit, + offset=offset, + sort_by=sort_by, + direction=direction, + ) diff --git a/agents-api/agents_api/routers/agents/list_agents.py b/agents-api/agents_api/routers/agents/list_agents.py index 652a26de7..c7a339bc9 100644 --- a/agents-api/agents_api/routers/agents/list_agents.py +++ b/agents-api/agents_api/routers/agents/list_agents.py @@ -1,11 +1,11 @@ -from typing import Annotated, List +from typing import Annotated, List, Literal from fastapi import Depends from pydantic import UUID4 from ...autogen.openapi_model import Agent from ...dependencies.developer_id import get_developer_id -from ...models.agent.list_agents import list_agents +from ...models.agent.list_agents import list_agents as list_agents_query from .router import router @@ -14,12 +14,17 @@ async def list_agents( x_developer_id: Annotated[UUID4, Depends(get_developer_id)], limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", metadata_filter: str = "{}", ) -> List[Agent]: - agents = list_agents( + agents = list_agents_query( developer_id=x_developer_id, limit=limit, offset=offset, + sort_by=sort_by, + direction=direction, metadata_filter=metadata_filter, ) - return [Agent(**agent) for agent in agents] + + return agents diff --git a/agents-api/agents_api/routers/agents/patch_agent.py b/agents-api/agents_api/routers/agents/patch_agent.py index 7731dda81..29596447e 100644 --- a/agents-api/agents_api/routers/agents/patch_agent.py +++ b/agents-api/agents_api/routers/agents/patch_agent.py @@ -1,11 +1,10 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_200_OK, HTTP_404_NOT_FOUND +from starlette.status import HTTP_200_OK from ...autogen.openapi_model import PatchAgentRequest, ResourceUpdatedResponse -from ...common.exceptions.agents import AgentNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.agent.patch_agent import patch_agent as patch_agent_query from .router import router @@ -18,21 +17,12 @@ tags=["agents"], ) async def patch_agent( - agent_id: UUID4, - request: PatchAgentRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + agent_id: UUID4, + data: PatchAgentRequest, ) -> ResourceUpdatedResponse: - try: - updated_agent = patch_agent_query( - agent_id=agent_id, - developer_id=x_developer_id, - default_settings=request.default_settings, - name=request.name, - about=request.about, - model=request.model, - metadata=request.metadata, - instructions=request.instructions, - ) - return ResourceUpdatedResponse(**updated_agent) - except AgentNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) + return patch_agent_query( + agent_id=agent_id, + developer_id=x_developer_id, + data=data, + ) diff --git a/agents-api/agents_api/routers/agents/patch_agent_tools.py b/agents-api/agents_api/routers/agents/patch_agent_tool.py similarity index 61% rename from agents-api/agents_api/routers/agents/patch_agent_tools.py rename to agents-api/agents_api/routers/agents/patch_agent_tool.py index ab8e0c206..843fa91eb 100644 --- a/agents-api/agents_api/routers/agents/patch_agent_tools.py +++ b/agents-api/agents_api/routers/agents/patch_agent_tool.py @@ -14,19 +14,15 @@ @router.patch("/agents/{agent_id}/tools/{tool_id}", tags=["agents"]) -async def patch_agent_tools( +async def patch_agent_tool( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], agent_id: UUID, tool_id: UUID, - x_developer_id: Annotated[UUID4, Depends(get_developer_id)], - patch_tool: PatchToolRequest, + data: PatchToolRequest, ) -> ResourceUpdatedResponse: - _, resp = next( - patch_tool_query( - developer_id=x_developer_id, - agent_id=agent_id, - tool_id=tool_id, - patch_tool=patch_tool, - ).iterrows() + return patch_tool_query( + developer_id=x_developer_id, + agent_id=agent_id, + tool_id=tool_id, + data=data, ) - - return ResourceUpdatedResponse(id=resp["tool_id"], updated_at=resp["updated_at"]) diff --git a/agents-api/agents_api/routers/agents/update_agent.py b/agents-api/agents_api/routers/agents/update_agent.py index e37296ef3..865954a6d 100644 --- a/agents-api/agents_api/routers/agents/update_agent.py +++ b/agents-api/agents_api/routers/agents/update_agent.py @@ -1,11 +1,10 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_200_OK, HTTP_404_NOT_FOUND +from starlette.status import HTTP_200_OK from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateAgentRequest -from ...common.exceptions.agents import AgentNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.agent.update_agent import update_agent as update_agent_query from .router import router @@ -18,23 +17,12 @@ tags=["agents"], ) async def update_agent( - agent_id: UUID4, - request: UpdateAgentRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + agent_id: UUID4, + data: UpdateAgentRequest, ) -> ResourceUpdatedResponse: - try: - _, updated_agent = next( - update_agent_query( - agent_id=agent_id, - developer_id=x_developer_id, - name=request.name, - about=request.about, - model=request.model, - default_settings=request.default_settings, - metadata=request.metadata, - instructions=request.instructions, - ).iterrows() - ) - return ResourceUpdatedResponse(**updated_agent) - except AgentNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) + return update_agent_query( + developer_id=x_developer_id, + agent_id=agent_id, + data=data, + ) diff --git a/agents-api/agents_api/routers/agents/update_agent_tools.py b/agents-api/agents_api/routers/agents/update_agent_tool.py similarity index 65% rename from agents-api/agents_api/routers/agents/update_agent_tools.py rename to agents-api/agents_api/routers/agents/update_agent_tool.py index ac51afd16..60e38ad76 100644 --- a/agents-api/agents_api/routers/agents/update_agent_tools.py +++ b/agents-api/agents_api/routers/agents/update_agent_tool.py @@ -14,19 +14,15 @@ @router.put("/agents/{agent_id}/tools/{tool_id}", tags=["agents"]) -async def update_agent_tools( +async def update_agent_tool( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], agent_id: UUID, tool_id: UUID, - x_developer_id: Annotated[UUID4, Depends(get_developer_id)], data: UpdateToolRequest, ) -> ResourceUpdatedResponse: - _, resp = next( - update_tool_query( - developer_id=x_developer_id, - agent_id=agent_id, - tool_id=tool_id, - data=data, - ).iterrows() + return update_tool_query( + developer_id=x_developer_id, + agent_id=agent_id, + tool_id=tool_id, + data=data, ) - - return ResourceUpdatedResponse(id=resp["tool_id"], updated_at=resp["updated_at"]) From 65a0b991b969355676cbb67b85e6558c06ed72ef Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 4 Aug 2024 18:20:52 -0400 Subject: [PATCH 2/5] wip(agents-api): Session routes Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Chat.py | 2 +- agents-api/agents_api/autogen/Entries.py | 2 +- .../agents_api/autogen/openapi_model.py | 9 +- .../routers/agents/list_agent_tools.py | 8 +- .../agents_api/routers/agents/list_agents.py | 8 +- .../agents_api/routers/sessions/__init__.py | 17 +- .../sessions/create_or_update_session.py | 34 ++ .../routers/sessions/create_session.py | 20 +- .../routers/sessions/delete_session.py | 13 +- .../routers/sessions/get_session.py | 16 +- .../routers/sessions/list_sessions.py | 26 +- .../routers/sessions/patch_session.py | 37 +- .../agents_api/routers/sessions/protocol.py | 36 -- .../agents_api/routers/sessions/session.py | 550 ------------------ .../routers/sessions/update_session.py | 37 +- agents-api/poetry.lock | 199 ++++--- .../api/types/agents_route_list_response.py | 2 +- .../api/types/sessions_route_list_response.py | 2 +- .../api/types/users_route_list_response.py | 2 +- sdks/python/poetry.lock | 199 ++++--- sdks/ts/src/api/services/DefaultService.ts | 6 +- typespec/common/interfaces.tsp | 2 +- 22 files changed, 328 insertions(+), 899 deletions(-) create mode 100644 agents-api/agents_api/routers/sessions/create_or_update_session.py delete mode 100644 agents-api/agents_api/routers/sessions/protocol.py delete mode 100644 agents-api/agents_api/routers/sessions/session.py diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index c7c25c7ad..6669fbcec 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AwareDatetime, BaseModel, ConfigDict, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel from .Docs import DocReference from .Entries import ChatMLMessage diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index 6c8bf9ca4..d56b333d8 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel from .Tools import ChosenToolCall, Tool, ToolResponse diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index 3d5d3afaa..362384251 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -1,5 +1,5 @@ # ruff: noqa: F401, F403, F405 -from typing import Annotated +from typing import Annotated, Generic, TypeVar from uuid import UUID from pydantic import AwareDatetime, Field @@ -158,3 +158,10 @@ class UpdateTaskRequest(_UpdateTaskRequest): "extra": "allow", } ) + + +DataT = TypeVar("DataT", bound=BaseModel) + + +class ListResponse(BaseModel, Generic[DataT]): + items: list[DataT] diff --git a/agents-api/agents_api/routers/agents/list_agent_tools.py b/agents-api/agents_api/routers/agents/list_agent_tools.py index 1b86f227a..dff135920 100644 --- a/agents-api/agents_api/routers/agents/list_agent_tools.py +++ b/agents-api/agents_api/routers/agents/list_agent_tools.py @@ -4,7 +4,7 @@ from fastapi import Depends from pydantic import UUID4 -from ...autogen.openapi_model import Tool +from ...autogen.openapi_model import ListResponse, Tool from ...dependencies.developer_id import get_developer_id from ...models.tools.list_tools import list_tools as list_tools_query from .router import router @@ -18,8 +18,8 @@ async def list_agent_tools( offset: int = 0, sort_by: Literal["created_at", "updated_at"] = "created_at", direction: Literal["asc", "desc"] = "desc", -) -> list[Tool]: - return list_tools_query( +) -> ListResponse[Tool]: + tools = list_tools_query( agent_id=agent_id, developer_id=x_developer_id, limit=limit, @@ -27,3 +27,5 @@ async def list_agent_tools( sort_by=sort_by, direction=direction, ) + + return ListResponse[Tool](items=tools) diff --git a/agents-api/agents_api/routers/agents/list_agents.py b/agents-api/agents_api/routers/agents/list_agents.py index c7a339bc9..f894d9c36 100644 --- a/agents-api/agents_api/routers/agents/list_agents.py +++ b/agents-api/agents_api/routers/agents/list_agents.py @@ -1,9 +1,9 @@ -from typing import Annotated, List, Literal +from typing import Annotated, Literal from fastapi import Depends from pydantic import UUID4 -from ...autogen.openapi_model import Agent +from ...autogen.openapi_model import Agent, ListResponse from ...dependencies.developer_id import get_developer_id from ...models.agent.list_agents import list_agents as list_agents_query from .router import router @@ -17,7 +17,7 @@ async def list_agents( sort_by: Literal["created_at", "updated_at"] = "created_at", direction: Literal["asc", "desc"] = "desc", metadata_filter: str = "{}", -) -> List[Agent]: +) -> ListResponse[Agent]: agents = list_agents_query( developer_id=x_developer_id, limit=limit, @@ -27,4 +27,4 @@ async def list_agents( metadata_filter=metadata_filter, ) - return agents + return ListResponse[Agent](items=agents) diff --git a/agents-api/agents_api/routers/sessions/__init__.py b/agents-api/agents_api/routers/sessions/__init__.py index 3cea3eb2d..24ae2d9e8 100644 --- a/agents-api/agents_api/routers/sessions/__init__.py +++ b/agents-api/agents_api/routers/sessions/__init__.py @@ -1,7 +1,10 @@ -from .create_session import create_session # noqa: F401 -from .delete_session import delete_session # noqa: F401 -from .get_session import get_session # noqa: F401 -from .list_sessions import list_sessions # noqa: F401 -from .patch_session import patch_session # noqa: F401 -from .router import router # noqa: F401 -from .update_session import update_session # noqa: F401 +# ruff: noqa: F401 + +from .create_or_update_session import create_or_update_session +from .create_session import create_session +from .delete_session import delete_session +from .get_session import get_session +from .list_sessions import list_sessions +from .patch_session import patch_session +from .router import router +from .update_session import update_session diff --git a/agents-api/agents_api/routers/sessions/create_or_update_session.py b/agents-api/agents_api/routers/sessions/create_or_update_session.py new file mode 100644 index 000000000..8ed9ff7ba --- /dev/null +++ b/agents-api/agents_api/routers/sessions/create_or_update_session.py @@ -0,0 +1,34 @@ +from typing import Annotated +from uuid import UUID + +from fastapi import Depends +from pydantic import UUID4 +from starlette.status import HTTP_201_CREATED + +from ...autogen.openapi_model import ( + CreateOrUpdateSessionRequest, + ResourceCreatedResponse, +) +from ...dependencies.developer_id import get_developer_id +from ...models.session.create_or_update_session import ( + create_or_update_session as create_session_query, +) +from .router import router + + +@router.post("/sessions/{session_id}", status_code=HTTP_201_CREATED, tags=["sessions"]) +async def create_or_update_session( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + session_id: UUID, + data: CreateOrUpdateSessionRequest, +) -> ResourceCreatedResponse: + session = create_session_query( + developer_id=x_developer_id, + session_id=session_id, + data=data, + ) + + return ResourceCreatedResponse( + id=session.id, + created_at=session.created_at, + ) diff --git a/agents-api/agents_api/routers/sessions/create_session.py b/agents-api/agents_api/routers/sessions/create_session.py index 558a4ae22..cf4ba119d 100644 --- a/agents-api/agents_api/routers/sessions/create_session.py +++ b/agents-api/agents_api/routers/sessions/create_session.py @@ -1,7 +1,5 @@ from typing import Annotated -from uuid import uuid4 -import pandas as pd from fastapi import Depends from pydantic import UUID4 from starlette.status import HTTP_201_CREATED @@ -17,23 +15,15 @@ @router.post("/sessions", status_code=HTTP_201_CREATED, tags=["sessions"]) async def create_session( - request: CreateSessionRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + data: CreateSessionRequest, ) -> ResourceCreatedResponse: - session_id = uuid4() - resp: pd.DataFrame = create_session_query( - session_id=session_id, + session = create_session_query( developer_id=x_developer_id, - agent_id=request.agent_id, - user_id=request.user_id, - situation=request.situation, - metadata=request.metadata or {}, - render_templates=request.render_templates or False, - token_budget=request.token_budget, - context_overflow=request.context_overflow, + data=data, ) return ResourceCreatedResponse( - id=resp["session_id"][0], - created_at=resp["created_at"][0], + id=session.id, + created_at=session.created_at, ) diff --git a/agents-api/agents_api/routers/sessions/delete_session.py b/agents-api/agents_api/routers/sessions/delete_session.py index 969363d70..9645eb8de 100644 --- a/agents-api/agents_api/routers/sessions/delete_session.py +++ b/agents-api/agents_api/routers/sessions/delete_session.py @@ -1,12 +1,10 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_202_ACCEPTED, HTTP_404_NOT_FOUND +from starlette.status import HTTP_202_ACCEPTED from ...autogen.openapi_model import ResourceDeletedResponse -from ...common.exceptions.sessions import SessionNotFoundError -from ...common.utils.datetime import utcnow from ...dependencies.developer_id import get_developer_id from ...models.session.delete_session import delete_session as delete_session_query from .router import router @@ -18,9 +16,4 @@ async def delete_session( session_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] ) -> ResourceDeletedResponse: - try: - delete_session_query(x_developer_id, session_id) - except SessionNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) - - return ResourceDeletedResponse(id=session_id, deleted_at=utcnow()) + return delete_session_query(developer_id=x_developer_id, session_id=session_id) diff --git a/agents-api/agents_api/routers/sessions/get_session.py b/agents-api/agents_api/routers/sessions/get_session.py index 5aed042dc..c357394fa 100644 --- a/agents-api/agents_api/routers/sessions/get_session.py +++ b/agents-api/agents_api/routers/sessions/get_session.py @@ -1,6 +1,6 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 from ...autogen.openapi_model import Session @@ -13,16 +13,4 @@ async def get_session( session_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] ) -> Session: - try: - res = [ - row.to_dict() - for _, row in get_session_query( - developer_id=x_developer_id, session_id=session_id - ).iterrows() - ][0] - return Session(**res) - except (IndexError, KeyError): - raise HTTPException( - status_code=404, - detail="Session not found", - ) + return get_session_query(developer_id=x_developer_id, session_id=session_id) diff --git a/agents-api/agents_api/routers/sessions/list_sessions.py b/agents-api/agents_api/routers/sessions/list_sessions.py index e93c22228..bf5458887 100644 --- a/agents-api/agents_api/routers/sessions/list_sessions.py +++ b/agents-api/agents_api/routers/sessions/list_sessions.py @@ -1,27 +1,25 @@ import json from json import JSONDecodeError -from typing import Annotated +from typing import Annotated, Literal from fastapi import Depends, HTTPException, status -from pydantic import UUID4, BaseModel +from pydantic import UUID4 -from ...autogen.openapi_model import Session +from ...autogen.openapi_model import ListResponse, Session from ...dependencies.developer_id import get_developer_id -from ...models.session.list_sessions import list_sessions +from ...models.session.list_sessions import list_sessions as list_sessions_query from .router import router -class SessionList(BaseModel): - items: list[Session] - - @router.get("/sessions", tags=["sessions"]) -async def list_sessions_route( +async def list_sessions( x_developer_id: Annotated[UUID4, Depends(get_developer_id)], limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", metadata_filter: str = "{}", -) -> SessionList: +) -> ListResponse[Session]: try: metadata_filter = json.loads(metadata_filter) except JSONDecodeError: @@ -30,13 +28,13 @@ async def list_sessions_route( detail="metadata_filter is not a valid JSON", ) - query_results = list_sessions( + sessions = list_sessions_query( developer_id=x_developer_id, limit=limit, offset=offset, + sort_by=sort_by, + direction=direction, metadata_filter=metadata_filter, ) - return SessionList( - items=[Session(**row.to_dict()) for _, row in query_results.iterrows()] - ) + return ListResponse[Session](items=sessions) diff --git a/agents-api/agents_api/routers/sessions/patch_session.py b/agents-api/agents_api/routers/sessions/patch_session.py index 992b272a8..365fa49ca 100644 --- a/agents-api/agents_api/routers/sessions/patch_session.py +++ b/agents-api/agents_api/routers/sessions/patch_session.py @@ -1,14 +1,12 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND from ...autogen.openapi_model import ( PatchSessionRequest, ResourceUpdatedResponse, ) -from ...common.exceptions.sessions import SessionNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.session.patch_session import patch_session as patch_session_query from .router import router @@ -16,31 +14,12 @@ @router.patch("/sessions/{session_id}", tags=["sessions"]) async def patch_session( - session_id: UUID4, - request: PatchSessionRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + session_id: UUID4, + data: PatchSessionRequest, ) -> ResourceUpdatedResponse: - try: - resp = patch_session_query( - session_id=session_id, - developer_id=x_developer_id, - situation=request.situation, - metadata=request.metadata, - token_budget=request.token_budget, - context_overflow=request.context_overflow, - ) - - return ResourceUpdatedResponse( - id=resp["session_id"][0], - updated_at=resp["updated_at"][0][0], - ) - except (IndexError, KeyError): - raise HTTPException( - status_code=HTTP_404_NOT_FOUND, - detail="Session not found", - ) - except SessionNotFoundError as e: - raise HTTPException( - status_code=HTTP_404_NOT_FOUND, - detail=str(e), - ) + return patch_session_query( + developer_id=x_developer_id, + session_id=session_id, + data=data, + ) diff --git a/agents-api/agents_api/routers/sessions/protocol.py b/agents-api/agents_api/routers/sessions/protocol.py deleted file mode 100644 index 6502e98a2..000000000 --- a/agents-api/agents_api/routers/sessions/protocol.py +++ /dev/null @@ -1,36 +0,0 @@ -from pydantic import BaseModel, ConfigDict, Field, field_validator - -from agents_api.autogen.openapi_model import Preset, ResponseFormat, Tool - - -class Settings(BaseModel): - model_config = ConfigDict(validate_assignment=True) - - model: str - frequency_penalty: float | None = Field(default=0) - length_penalty: float | None = Field(default=1.0) - logit_bias: float | None = None - max_tokens: int | None = Field(default=200) - presence_penalty: float | None = Field(default=0) - repetition_penalty: float | None = Field(default=1) - response_format: ResponseFormat | None - seed: int | None = Field(default=0) - stop: list[str] | None = None - stream: bool | None = Field(default=False) - temperature: float | None = Field(default=0.7) - top_p: float | None = Field(default=1) - remember: bool | None = Field(default=True) - recall: bool | None = Field(default=True) - min_p: float | None = Field(default=0.01) - preset: Preset | None = Field(default=None) - tools: list[Tool] | None = Field(default=None) - token_budget: int | None = Field(default=None) - context_overflow: str | None = Field(default=None) - - @field_validator("max_tokens") - def set_max_tokens(cls, max_tokens): - return max_tokens if max_tokens is not None else 200 - - @field_validator("stream") - def set_stream(cls, stream): - return stream or False diff --git a/agents-api/agents_api/routers/sessions/session.py b/agents-api/agents_api/routers/sessions/session.py deleted file mode 100644 index 5784f40af..000000000 --- a/agents-api/agents_api/routers/sessions/session.py +++ /dev/null @@ -1,550 +0,0 @@ -import json -from dataclasses import dataclass -from functools import partial, reduce -from json import JSONDecodeError -from typing import Callable -from uuid import uuid4 - -import litellm -import xxhash -from litellm import acompletion -from openai.types.chat.chat_completion import ChatCompletion -from pydantic import UUID4 - -from ...autogen.openapi_model import ( - CreateEntryRequest, - DocIds, - InputChatMLMessage, - Tool, -) -from ...clients.embed import embed -from ...clients.temporal import run_summarization_task, run_truncation_task -from ...clients.worker.types import ChatML -from ...common.exceptions.sessions import SessionNotFoundError -from ...common.protocol.entries import Entry -from ...common.protocol.sessions import SessionData -from ...common.utils.json import CustomJSONEncoder -from ...common.utils.messages import stringify_content -from ...common.utils.template import render_template -from ...env import ( - embedding_model_id, - embedding_service_url, - model_api_key, - model_inference_url, -) -from ...exceptions import PromptTooBigError -from ...model_registry import ( - LOCAL_MODELS, - LOCAL_MODELS_WITH_TOOL_CALLS, - OLLAMA_MODELS, - get_extra_settings, - load_context, - validate_and_extract_tool_calls, -) -from ...models.entry.create_entries import create_entries -from ...models.session.get_cached_response import get_cached_response -from ...models.session.prepare_session_data import prepare_session_data -from ...models.session.set_cached_response import set_cached_response -from .exceptions import InputTooBigError -from .protocol import Settings - -THOUGHTS_STRIP_LEN = 2 -MESSAGES_STRIP_LEN = 4 - - -tool_query_instruction = ( - "Transform this user request for fetching helpful tool descriptions: " -) -instruction_query_instruction = ( - "Embed this text chunk for finding useful historical chunks: " -) -doc_query_instruction = ( - "Encode this query and context for searching relevant passages: " -) - - -def cache(f): - async def wrapper(init_context: list[ChatML], settings: Settings) -> ChatCompletion: - key = xxhash.xxh64( - json.dumps( - { - "init_context": [c.model_dump() for c in init_context], - "settings": settings.model_dump(), - }, - cls=CustomJSONEncoder, - default_empty_value="", - ) - ).hexdigest() - result = get_cached_response(key=key) - if not result.size: - resp = await f(init_context, settings) - set_cached_response(key=key, value=resp.model_dump()) - return resp - choices = result.iloc[0].to_dict()["value"] - return ChatCompletion(**choices) - - return wrapper - - -# FIXME: Refactor llm_generate and cache for use inside tasks as well -# - these should probably be moved to a separate module -@cache -async def llm_generate( - init_context: list[ChatML], settings: Settings -) -> ChatCompletion: - init_context = load_context(init_context, settings.model) - tools = None - api_base = None - api_key = None - model = settings.model - if model in [*LOCAL_MODELS.keys(), *LOCAL_MODELS_WITH_TOOL_CALLS.keys()]: - api_base = model_inference_url - api_key = model_api_key - model = f"openai/{model}" - if model in OLLAMA_MODELS: - model = f"ollama/{model}" - - if settings.tools: - tools = [(tool.model_dump(exclude="id")) for tool in settings.tools] - - extra_body = get_extra_settings(settings) - - litellm.drop_params = True - litellm.add_function_to_prompt = True - - res = await acompletion( - model=model, - messages=init_context, - max_tokens=settings.max_tokens, - stop=settings.stop, - temperature=settings.temperature, - frequency_penalty=settings.frequency_penalty, - top_p=settings.top_p, - presence_penalty=settings.presence_penalty, - stream=settings.stream, - tools=tools, - response_format=settings.response_format, - api_base=api_base, - api_key=api_key, - **extra_body, - ) - - return res - - -@dataclass -class BaseSession: - session_id: UUID4 - developer_id: UUID4 - - def _remove_messages( - self, - messages: list[Entry], - start_idx: int | None, - end_idx: int | None, - token_count: int, - summarization_tokens_threshold: int, - predicate: Callable[[Entry], bool], - ) -> tuple[list[Entry], int]: - if len(messages) < abs((end_idx or len(messages)) - (start_idx or 0)): - return messages, token_count - - result: list[Entry] = messages[: start_idx or 0] - skip_check = False - for m in messages[start_idx:end_idx]: - if predicate(m) and not skip_check: - token_count -= m.token_count - if token_count <= summarization_tokens_threshold: - skip_check = True - - continue - - result.append(m) - - if end_idx is not None: - result += messages[end_idx:] - - return result, token_count - - def _truncate_context( - self, messages: list[Entry], summarization_tokens_threshold: int | None - ) -> list[Entry]: - def rm_thoughts(m): - return m.role == "system" and m.name == "thought" - - def rm_user_assistant(m): - return m.role in ("user", "assistant") - - if summarization_tokens_threshold is None: - return messages - - token_count = reduce(lambda c, e: (e.token_count or 0) + c, messages, 0) - - if token_count <= summarization_tokens_threshold: - return messages - - for start_idx, end_idx, cond in [ - (THOUGHTS_STRIP_LEN, -THOUGHTS_STRIP_LEN, rm_thoughts), - (None, None, rm_thoughts), - (MESSAGES_STRIP_LEN, -MESSAGES_STRIP_LEN, rm_user_assistant), - ]: - messages, token_count = self._remove_messages( - messages, - start_idx, - end_idx, - token_count, - summarization_tokens_threshold, - cond, - ) - - if token_count <= summarization_tokens_threshold and messages: - return messages - - # TODO: - # Compress info sections using LLM Lingua - # - If more space is still needed, remove info sections iteratively - - raise InputTooBigError(token_count, summarization_tokens_threshold) - - async def run( - self, new_input, settings: Settings - ) -> tuple[ChatCompletion, Entry, Callable | None, DocIds]: - # TODO: implement locking at some point - - # Get session data - session_data = prepare_session_data( - developer_id=self.developer_id, session_id=self.session_id - ) - if session_data is None: - raise SessionNotFoundError(self.developer_id, self.session_id) - - # Assemble context - init_context, final_settings, doc_ids = await self.forward( - session_data, new_input, settings - ) - - # Generate response - response = await self.generate( - self._truncate_context(init_context, final_settings.token_budget), - final_settings, - ) - - # Save response to session - # if final_settings.get("remember"): - # await self.add_to_session(new_input, response) - - # FIXME: Implement support for multiple choices, will need a revisit to the schema - message = response.choices[0].message - role = message.role - content = message.content - - # FIXME: Implement support for multiple tool calls - - # Unpack tool calls if present - # TODO: implement changes in the openapi spec - # Currently our function_call does the same job as openai's function role - # Need to add a new role for openai's paradigm of shoving function selected into assistant's context - # Ref: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_with_chat_models.ipynb - if not message.content and message.tool_calls: - role = "function_call" - content = message.tool_calls[0].function.model_dump_json() - - elif not message.content: - raise ValueError("No content in response") - - total_tokens = response.usage.total_tokens - completion_tokens = response.usage.completion_tokens - new_entry = Entry( - session_id=self.session_id, - role=role, - name=None if session_data is None else session_data.agent_name, - content=content, - token_count=completion_tokens, - ) - - # Return response and the backward pass as a background task (dont await here) - backward_pass = await self.backward( - new_input, total_tokens, new_entry, final_settings - ) - - return response, new_entry, backward_pass, doc_ids - - async def forward( - self, - session_data: SessionData | None, - new_input: list[Entry], - settings: Settings, - ) -> tuple[list[ChatML], Settings, DocIds]: - if session_data is not None: - settings.token_budget = session_data.token_budget - settings.context_overflow = session_data.context_overflow - - stringified_input = [] - for msg in new_input: - stringified_input.append( - ( - msg.role, - msg.name, - stringify_content(msg.content), - ) - ) - - # role, name, content, token_count, created_at - string_to_embed = "\n".join( - [ - f"{name or role}: {content}" - for (role, name, content) in stringified_input - if content - ] - ) - - # FIXME: bge-m3 does not require instructions - ( - tool_query_embedding, - doc_query_embedding, - ) = await embed( - [ - instruction + string_to_embed - for instruction in [ - tool_query_instruction, - doc_query_instruction, - ] - ], - join_inputs=False, - embedding_service_url=embedding_service_url, - embedding_model_name=embedding_model_id, - ) - - entries: list[Entry] = [] - instructions = "Instructions:\n\n" - first_instruction_idx = -1 - first_instruction_created_at = 0 - tools = [] - doc_ids = DocIds(agent_doc_ids=[], user_doc_ids=[]) - - for idx, row in proc_mem_context_query( - session_id=self.session_id, - tool_query_embedding=tool_query_embedding, - doc_query_embedding=doc_query_embedding, - ).iterrows(): - agent_doc_id = row.get("agent_doc_id") - user_doc_id = row.get("user_doc_id") - - if agent_doc_id is not None: - doc_ids.agent_doc_ids.append(agent_doc_id) - - if user_doc_id is not None: - doc_ids.user_doc_ids.append(user_doc_id) - - # If a `functions` message is encountered, extract into tools list - if row["name"] == "functions": - # FIXME: This might also break if {role: system, name: functions, content} but content not valid json object - try: - # FIXME: This is a hack for now, need to fix to support multiple function calls - assert ( - len(row["content"]) == 1 - ), "Only one function can be called at a time" - content = row["content"][0]["text"] - saved_function = json.loads(content) - except JSONDecodeError as e: - # FIXME: raise a proper error that can be caught by the router - raise ValueError(str(e)) - - tool = Tool(type="function", function=saved_function, id=str(uuid4())) - tools.append(tool) - - continue - - # If `instruction` encoountered, extract and compile together (because of a quirk in how cozo queries work) - if row["name"] == "instruction": - if first_instruction_idx < 0: - first_instruction_idx = idx - first_instruction_created_at = row["created_at"] - - instructions += f"{row['content'][0]['text']}" + "\n\n" - - continue - - # Else add to entries as is - entries.append( - Entry( - role=row["role"], - name=row["name"], - content=row["content"], - session_id=self.session_id, - created_at=row["created_at"], - ) - ) - - # If any instructions were found, add them as info block - if first_instruction_idx >= 0: - entries.insert( - first_instruction_idx, - Entry( - role="system", - name="information", - content=instructions, - session_id=self.session_id, - created_at=first_instruction_created_at, - ), - ) - - messages = [ - ChatML( - role=e.role.value if hasattr(e.role, "value") else e.role, - name=e.name, - content=e.content, - ) - for e in entries + new_input - if e.content - ] - - # Simplify messages if possible - for message in messages: - if ( - isinstance(message.content, list) - and len(message.content) == 1 - and message.content[0].type == "text" - ): - message.content = message.content[0].text - # Add tools to settings - if tools: - settings.tools = settings.tools or [] - settings.tools.extend(tools) - # If render_templates=True, render the templates - if session_data is not None and session_data.render_templates: - template_data = { - "session": { - "id": session_data.session_id, - "situation": session_data.situation, - "metadata": session_data.metadata, - }, - "user": { - "id": session_data.user_id, - "name": session_data.user_name, - "about": session_data.user_about, - "metadata": session_data.user_metadata, - }, - "agent": { - "id": session_data.agent_id, - "name": session_data.agent_name, - "about": session_data.agent_about, - "metadata": session_data.agent_metadata, - "tools": settings.tools, - }, - } - - for i, msg in enumerate(messages): - # Only render templates for system/assistant messages - if msg.role not in ["system", "assistant"]: - continue - - messages[i].content = await render_template(msg.content, template_data) - - # FIXME: This sometimes returns "The model `` does not exist." - if session_data is not None: - settings.model = session_data.model - - return messages, settings, doc_ids - - async def generate( - self, init_context: list[ChatML], settings: Settings - ) -> ChatCompletion: - # return await llm_generate(init_context, settings) - - init_context = load_context(init_context, settings.model) - tools = None - api_base = None - api_key = None - model = settings.model - if model in LOCAL_MODELS: - api_base = model_inference_url - api_key = model_api_key - model = f"openai/{model}" - - if settings.tools: - tools = [(tool.model_dump(exclude="id")) for tool in settings.tools] - - litellm.drop_params = True - litellm.add_function_to_prompt = True - res = await acompletion( - model=model, - messages=init_context, - max_tokens=settings.max_tokens, - stop=settings.stop, - temperature=settings.temperature, - frequency_penalty=settings.frequency_penalty, - top_p=settings.top_p, - presence_penalty=settings.presence_penalty, - stream=settings.stream, - tools=tools, - response_format=settings.response_format, - api_base=api_base, - api_key=api_key, - ) - if model in LOCAL_MODELS_WITH_TOOL_CALLS: - validation, tool_call, error_msg = validate_and_extract_tool_calls( - res.choices[0].message.content - ) - if validation: - res.choices[0].message.role = ( - "function_call" if tool_call else "assistant" - ) - res.choices[0].finish_reason = "tool_calls" - res.choices[0].message.tool_calls = tool_call - res.choices[0].message.content = json.dumps(tool_call) - return res - - async def backward( - self, - new_input: list[InputChatMLMessage], - total_tokens: int, - new_entry: Entry, - final_settings: Settings, - ) -> Callable | None: - if not final_settings.remember: - return - - entries: list[Entry] = [] - for m in new_input: - entries.append( - CreateEntryRequest( - role=m.role, - content=m.content, - name=m.name, - ) - ) - - entries.append( - CreateEntryRequest( - role=new_entry.role, - content=new_entry.content, - name=new_entry.name, - ) - ) - bg_task = None - - if ( - final_settings.token_budget is not None - and total_tokens >= final_settings.token_budget - ): - if final_settings.context_overflow == "truncate": - bg_task = partial(run_truncation_task, final_settings.token_budget) - elif final_settings.context_overflow == "adaptive": - bg_task = run_summarization_task - else: - raise PromptTooBigError(total_tokens, final_settings.token_budget) - - create_entries( - developer_id=self.developer_id, session_id=self.session_id, data=entries - ) - - return bg_task - - -class PlainCompletionSession(BaseSession): - pass - - -class RecursiveSummarizationSession(PlainCompletionSession): - pass diff --git a/agents-api/agents_api/routers/sessions/update_session.py b/agents-api/agents_api/routers/sessions/update_session.py index 1f2658525..8d7c28b33 100644 --- a/agents-api/agents_api/routers/sessions/update_session.py +++ b/agents-api/agents_api/routers/sessions/update_session.py @@ -1,14 +1,12 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND from ...autogen.openapi_model import ( ResourceUpdatedResponse, UpdateSessionRequest, ) -from ...common.exceptions.sessions import SessionNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.session.update_session import update_session as update_session_query from .router import router @@ -16,31 +14,12 @@ @router.put("/sessions/{session_id}", tags=["sessions"]) async def update_session( - session_id: UUID4, - request: UpdateSessionRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + session_id: UUID4, + data: UpdateSessionRequest, ) -> ResourceUpdatedResponse: - try: - resp = update_session_query( - session_id=session_id, - developer_id=x_developer_id, - situation=request.situation, - metadata=request.metadata, - token_budget=request.token_budget, - context_overflow=request.context_overflow, - ) - - return ResourceUpdatedResponse( - id=resp["session_id"][0], - updated_at=resp["updated_at"][0][0], - ) - except (IndexError, KeyError): - raise HTTPException( - status_code=HTTP_404_NOT_FOUND, - detail="Session not found", - ) - except SessionNotFoundError as e: - raise HTTPException( - status_code=HTTP_404_NOT_FOUND, - detail=str(e), - ) + return update_session_query( + developer_id=x_developer_id, + session_id=session_id, + data=data, + ) diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index cd7983feb..203e8b1ee 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -4127,99 +4127,120 @@ files = [ [[package]] name = "pyzmq" -version = "26.0.3" +version = "26.1.0" description = "Python bindings for 0MQ" optional = false python-versions = ">=3.7" files = [ - {file = "pyzmq-26.0.3-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:44dd6fc3034f1eaa72ece33588867df9e006a7303725a12d64c3dff92330f625"}, - {file = "pyzmq-26.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:acb704195a71ac5ea5ecf2811c9ee19ecdc62b91878528302dd0be1b9451cc90"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5dbb9c997932473a27afa93954bb77a9f9b786b4ccf718d903f35da3232317de"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6bcb34f869d431799c3ee7d516554797f7760cb2198ecaa89c3f176f72d062be"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38ece17ec5f20d7d9b442e5174ae9f020365d01ba7c112205a4d59cf19dc38ee"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:ba6e5e6588e49139a0979d03a7deb9c734bde647b9a8808f26acf9c547cab1bf"}, - {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3bf8b000a4e2967e6dfdd8656cd0757d18c7e5ce3d16339e550bd462f4857e59"}, - {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2136f64fbb86451dbbf70223635a468272dd20075f988a102bf8a3f194a411dc"}, - {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e8918973fbd34e7814f59143c5f600ecd38b8038161239fd1a3d33d5817a38b8"}, - {file = "pyzmq-26.0.3-cp310-cp310-win32.whl", hash = "sha256:0aaf982e68a7ac284377d051c742610220fd06d330dcd4c4dbb4cdd77c22a537"}, - {file = "pyzmq-26.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:f1a9b7d00fdf60b4039f4455afd031fe85ee8305b019334b72dcf73c567edc47"}, - {file = "pyzmq-26.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:80b12f25d805a919d53efc0a5ad7c0c0326f13b4eae981a5d7b7cc343318ebb7"}, - {file = "pyzmq-26.0.3-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:a72a84570f84c374b4c287183debc776dc319d3e8ce6b6a0041ce2e400de3f32"}, - {file = "pyzmq-26.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7ca684ee649b55fd8f378127ac8462fb6c85f251c2fb027eb3c887e8ee347bcd"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e222562dc0f38571c8b1ffdae9d7adb866363134299264a1958d077800b193b7"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f17cde1db0754c35a91ac00b22b25c11da6eec5746431d6e5092f0cd31a3fea9"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b7c0c0b3244bb2275abe255d4a30c050d541c6cb18b870975553f1fb6f37527"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:ac97a21de3712afe6a6c071abfad40a6224fd14fa6ff0ff8d0c6e6cd4e2f807a"}, - {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:88b88282e55fa39dd556d7fc04160bcf39dea015f78e0cecec8ff4f06c1fc2b5"}, - {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:72b67f966b57dbd18dcc7efbc1c7fc9f5f983e572db1877081f075004614fcdd"}, - {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4b6cecbbf3b7380f3b61de3a7b93cb721125dc125c854c14ddc91225ba52f83"}, - {file = "pyzmq-26.0.3-cp311-cp311-win32.whl", hash = "sha256:eed56b6a39216d31ff8cd2f1d048b5bf1700e4b32a01b14379c3b6dde9ce3aa3"}, - {file = "pyzmq-26.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:3191d312c73e3cfd0f0afdf51df8405aafeb0bad71e7ed8f68b24b63c4f36500"}, - {file = "pyzmq-26.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:b6907da3017ef55139cf0e417c5123a84c7332520e73a6902ff1f79046cd3b94"}, - {file = "pyzmq-26.0.3-cp312-cp312-macosx_10_15_universal2.whl", hash = "sha256:068ca17214038ae986d68f4a7021f97e187ed278ab6dccb79f837d765a54d753"}, - {file = "pyzmq-26.0.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7821d44fe07335bea256b9f1f41474a642ca55fa671dfd9f00af8d68a920c2d4"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eeb438a26d87c123bb318e5f2b3d86a36060b01f22fbdffd8cf247d52f7c9a2b"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69ea9d6d9baa25a4dc9cef5e2b77b8537827b122214f210dd925132e34ae9b12"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7daa3e1369355766dea11f1d8ef829905c3b9da886ea3152788dc25ee6079e02"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6ca7a9a06b52d0e38ccf6bca1aeff7be178917893f3883f37b75589d42c4ac20"}, - {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1b7d0e124948daa4d9686d421ef5087c0516bc6179fdcf8828b8444f8e461a77"}, - {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e746524418b70f38550f2190eeee834db8850088c834d4c8406fbb9bc1ae10b2"}, - {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:6b3146f9ae6af82c47a5282ac8803523d381b3b21caeae0327ed2f7ecb718798"}, - {file = "pyzmq-26.0.3-cp312-cp312-win32.whl", hash = "sha256:2b291d1230845871c00c8462c50565a9cd6026fe1228e77ca934470bb7d70ea0"}, - {file = "pyzmq-26.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:926838a535c2c1ea21c903f909a9a54e675c2126728c21381a94ddf37c3cbddf"}, - {file = "pyzmq-26.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:5bf6c237f8c681dfb91b17f8435b2735951f0d1fad10cc5dfd96db110243370b"}, - {file = "pyzmq-26.0.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c0991f5a96a8e620f7691e61178cd8f457b49e17b7d9cfa2067e2a0a89fc1d5"}, - {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:dbf012d8fcb9f2cf0643b65df3b355fdd74fc0035d70bb5c845e9e30a3a4654b"}, - {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:01fbfbeb8249a68d257f601deb50c70c929dc2dfe683b754659569e502fbd3aa"}, - {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c8eb19abe87029c18f226d42b8a2c9efdd139d08f8bf6e085dd9075446db450"}, - {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:5344b896e79800af86ad643408ca9aa303a017f6ebff8cee5a3163c1e9aec987"}, - {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:204e0f176fd1d067671157d049466869b3ae1fc51e354708b0dc41cf94e23a3a"}, - {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a42db008d58530efa3b881eeee4991146de0b790e095f7ae43ba5cc612decbc5"}, - {file = "pyzmq-26.0.3-cp37-cp37m-win32.whl", hash = "sha256:8d7a498671ca87e32b54cb47c82a92b40130a26c5197d392720a1bce1b3c77cf"}, - {file = "pyzmq-26.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:3b4032a96410bdc760061b14ed6a33613ffb7f702181ba999df5d16fb96ba16a"}, - {file = "pyzmq-26.0.3-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:2cc4e280098c1b192c42a849de8de2c8e0f3a84086a76ec5b07bfee29bda7d18"}, - {file = "pyzmq-26.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bde86a2ed3ce587fa2b207424ce15b9a83a9fa14422dcc1c5356a13aed3df9d"}, - {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:34106f68e20e6ff253c9f596ea50397dbd8699828d55e8fa18bd4323d8d966e6"}, - {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ebbbd0e728af5db9b04e56389e2299a57ea8b9dd15c9759153ee2455b32be6ad"}, - {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6b1d1c631e5940cac5a0b22c5379c86e8df6a4ec277c7a856b714021ab6cfad"}, - {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e891ce81edd463b3b4c3b885c5603c00141151dd9c6936d98a680c8c72fe5c67"}, - {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9b273ecfbc590a1b98f014ae41e5cf723932f3b53ba9367cfb676f838038b32c"}, - {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b32bff85fb02a75ea0b68f21e2412255b5731f3f389ed9aecc13a6752f58ac97"}, - {file = "pyzmq-26.0.3-cp38-cp38-win32.whl", hash = "sha256:f6c21c00478a7bea93caaaef9e7629145d4153b15a8653e8bb4609d4bc70dbfc"}, - {file = "pyzmq-26.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:3401613148d93ef0fd9aabdbddb212de3db7a4475367f49f590c837355343972"}, - {file = "pyzmq-26.0.3-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:2ed8357f4c6e0daa4f3baf31832df8a33334e0fe5b020a61bc8b345a3db7a606"}, - {file = "pyzmq-26.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c1c8f2a2ca45292084c75bb6d3a25545cff0ed931ed228d3a1810ae3758f975f"}, - {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b63731993cdddcc8e087c64e9cf003f909262b359110070183d7f3025d1c56b5"}, - {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b3cd31f859b662ac5d7f4226ec7d8bd60384fa037fc02aee6ff0b53ba29a3ba8"}, - {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:115f8359402fa527cf47708d6f8a0f8234f0e9ca0cab7c18c9c189c194dbf620"}, - {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:715bdf952b9533ba13dfcf1f431a8f49e63cecc31d91d007bc1deb914f47d0e4"}, - {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e1258c639e00bf5e8a522fec6c3eaa3e30cf1c23a2f21a586be7e04d50c9acab"}, - {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:15c59e780be8f30a60816a9adab900c12a58d79c1ac742b4a8df044ab2a6d920"}, - {file = "pyzmq-26.0.3-cp39-cp39-win32.whl", hash = "sha256:d0cdde3c78d8ab5b46595054e5def32a755fc028685add5ddc7403e9f6de9879"}, - {file = "pyzmq-26.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:ce828058d482ef860746bf532822842e0ff484e27f540ef5c813d516dd8896d2"}, - {file = "pyzmq-26.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:788f15721c64109cf720791714dc14afd0f449d63f3a5487724f024345067381"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2c18645ef6294d99b256806e34653e86236eb266278c8ec8112622b61db255de"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7e6bc96ebe49604df3ec2c6389cc3876cabe475e6bfc84ced1bf4e630662cb35"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:971e8990c5cc4ddcff26e149398fc7b0f6a042306e82500f5e8db3b10ce69f84"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8416c23161abd94cc7da80c734ad7c9f5dbebdadfdaa77dad78244457448223"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:082a2988364b60bb5de809373098361cf1dbb239623e39e46cb18bc035ed9c0c"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d57dfbf9737763b3a60d26e6800e02e04284926329aee8fb01049635e957fe81"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:77a85dca4c2430ac04dc2a2185c2deb3858a34fe7f403d0a946fa56970cf60a1"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4c82a6d952a1d555bf4be42b6532927d2a5686dd3c3e280e5f63225ab47ac1f5"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4496b1282c70c442809fc1b151977c3d967bfb33e4e17cedbf226d97de18f709"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:e4946d6bdb7ba972dfda282f9127e5756d4f299028b1566d1245fa0d438847e6"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:03c0ae165e700364b266876d712acb1ac02693acd920afa67da2ebb91a0b3c09"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3e3070e680f79887d60feeda051a58d0ac36622e1759f305a41059eff62c6da7"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6ca08b840fe95d1c2bd9ab92dac5685f949fc6f9ae820ec16193e5ddf603c3b2"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e76654e9dbfb835b3518f9938e565c7806976c07b37c33526b574cc1a1050480"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:871587bdadd1075b112e697173e946a07d722459d20716ceb3d1bd6c64bd08ce"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d0a2d1bd63a4ad79483049b26514e70fa618ce6115220da9efdff63688808b17"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0270b49b6847f0d106d64b5086e9ad5dc8a902413b5dbbb15d12b60f9c1747a4"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:703c60b9910488d3d0954ca585c34f541e506a091a41930e663a098d3b794c67"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74423631b6be371edfbf7eabb02ab995c2563fee60a80a30829176842e71722a"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4adfbb5451196842a88fda3612e2c0414134874bffb1c2ce83ab4242ec9e027d"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3516119f4f9b8671083a70b6afaa0a070f5683e431ab3dc26e9215620d7ca1ad"}, - {file = "pyzmq-26.0.3.tar.gz", hash = "sha256:dba7d9f2e047dfa2bca3b01f4f84aa5246725203d6284e3790f2ca15fba6b40a"}, + {file = "pyzmq-26.1.0-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:263cf1e36862310bf5becfbc488e18d5d698941858860c5a8c079d1511b3b18e"}, + {file = "pyzmq-26.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d5c8b17f6e8f29138678834cf8518049e740385eb2dbf736e8f07fc6587ec682"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75a95c2358fcfdef3374cb8baf57f1064d73246d55e41683aaffb6cfe6862917"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f99de52b8fbdb2a8f5301ae5fc0f9e6b3ba30d1d5fc0421956967edcc6914242"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bcbfbab4e1895d58ab7da1b5ce9a327764f0366911ba5b95406c9104bceacb0"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:77ce6a332c7e362cb59b63f5edf730e83590d0ab4e59c2aa5bd79419a42e3449"}, + {file = "pyzmq-26.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ba0a31d00e8616149a5ab440d058ec2da621e05d744914774c4dde6837e1f545"}, + {file = "pyzmq-26.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8b88641384e84a258b740801cd4dbc45c75f148ee674bec3149999adda4a8598"}, + {file = "pyzmq-26.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2fa76ebcebe555cce90f16246edc3ad83ab65bb7b3d4ce408cf6bc67740c4f88"}, + {file = "pyzmq-26.1.0-cp310-cp310-win32.whl", hash = "sha256:fbf558551cf415586e91160d69ca6416f3fce0b86175b64e4293644a7416b81b"}, + {file = "pyzmq-26.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:a7b8aab50e5a288c9724d260feae25eda69582be84e97c012c80e1a5e7e03fb2"}, + {file = "pyzmq-26.1.0-cp310-cp310-win_arm64.whl", hash = "sha256:08f74904cb066e1178c1ec706dfdb5c6c680cd7a8ed9efebeac923d84c1f13b1"}, + {file = "pyzmq-26.1.0-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:46d6800b45015f96b9d92ece229d92f2aef137d82906577d55fadeb9cf5fcb71"}, + {file = "pyzmq-26.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5bc2431167adc50ba42ea3e5e5f5cd70d93e18ab7b2f95e724dd8e1bd2c38120"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b3bb34bebaa1b78e562931a1687ff663d298013f78f972a534f36c523311a84d"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd3f6329340cef1c7ba9611bd038f2d523cea79f09f9c8f6b0553caba59ec562"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:471880c4c14e5a056a96cd224f5e71211997d40b4bf5e9fdded55dafab1f98f2"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:ce6f2b66799971cbae5d6547acefa7231458289e0ad481d0be0740535da38d8b"}, + {file = "pyzmq-26.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0a1f6ea5b1d6cdbb8cfa0536f0d470f12b4b41ad83625012e575f0e3ecfe97f0"}, + {file = "pyzmq-26.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b45e6445ac95ecb7d728604bae6538f40ccf4449b132b5428c09918523abc96d"}, + {file = "pyzmq-26.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:94c4262626424683feea0f3c34951d39d49d354722db2745c42aa6bb50ecd93b"}, + {file = "pyzmq-26.1.0-cp311-cp311-win32.whl", hash = "sha256:a0f0ab9df66eb34d58205913f4540e2ad17a175b05d81b0b7197bc57d000e829"}, + {file = "pyzmq-26.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:8efb782f5a6c450589dbab4cb0f66f3a9026286333fe8f3a084399149af52f29"}, + {file = "pyzmq-26.1.0-cp311-cp311-win_arm64.whl", hash = "sha256:f133d05aaf623519f45e16ab77526e1e70d4e1308e084c2fb4cedb1a0c764bbb"}, + {file = "pyzmq-26.1.0-cp312-cp312-macosx_10_15_universal2.whl", hash = "sha256:3d3146b1c3dcc8a1539e7cc094700b2be1e605a76f7c8f0979b6d3bde5ad4072"}, + {file = "pyzmq-26.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d9270fbf038bf34ffca4855bcda6e082e2c7f906b9eb8d9a8ce82691166060f7"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:995301f6740a421afc863a713fe62c0aaf564708d4aa057dfdf0f0f56525294b"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7eca8b89e56fb8c6c26dd3e09bd41b24789022acf1cf13358e96f1cafd8cae3"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d4feb2e83dfe9ace6374a847e98ee9d1246ebadcc0cb765482e272c34e5820"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:d4fafc2eb5d83f4647331267808c7e0c5722c25a729a614dc2b90479cafa78bd"}, + {file = "pyzmq-26.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:58c33dc0e185dd97a9ac0288b3188d1be12b756eda67490e6ed6a75cf9491d79"}, + {file = "pyzmq-26.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:68a0a1d83d33d8367ddddb3e6bb4afbb0f92bd1dac2c72cd5e5ddc86bdafd3eb"}, + {file = "pyzmq-26.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2ae7c57e22ad881af78075e0cea10a4c778e67234adc65c404391b417a4dda83"}, + {file = "pyzmq-26.1.0-cp312-cp312-win32.whl", hash = "sha256:347e84fc88cc4cb646597f6d3a7ea0998f887ee8dc31c08587e9c3fd7b5ccef3"}, + {file = "pyzmq-26.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:9f136a6e964830230912f75b5a116a21fe8e34128dcfd82285aa0ef07cb2c7bd"}, + {file = "pyzmq-26.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:a4b7a989c8f5a72ab1b2bbfa58105578753ae77b71ba33e7383a31ff75a504c4"}, + {file = "pyzmq-26.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d416f2088ac8f12daacffbc2e8918ef4d6be8568e9d7155c83b7cebed49d2322"}, + {file = "pyzmq-26.1.0-cp313-cp313-macosx_10_15_universal2.whl", hash = "sha256:ecb6c88d7946166d783a635efc89f9a1ff11c33d680a20df9657b6902a1d133b"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:471312a7375571857a089342beccc1a63584315188560c7c0da7e0a23afd8a5c"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e6cea102ffa16b737d11932c426f1dc14b5938cf7bc12e17269559c458ac334"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec7248673ffc7104b54e4957cee38b2f3075a13442348c8d651777bf41aa45ee"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:0614aed6f87d550b5cecb03d795f4ddbb1544b78d02a4bd5eecf644ec98a39f6"}, + {file = "pyzmq-26.1.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:e8746ce968be22a8a1801bf4a23e565f9687088580c3ed07af5846580dd97f76"}, + {file = "pyzmq-26.1.0-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:7688653574392d2eaeef75ddcd0b2de5b232d8730af29af56c5adf1df9ef8d6f"}, + {file = "pyzmq-26.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8d4dac7d97f15c653a5fedcafa82626bd6cee1450ccdaf84ffed7ea14f2b07a4"}, + {file = "pyzmq-26.1.0-cp313-cp313-win32.whl", hash = "sha256:ccb42ca0a4a46232d716779421bbebbcad23c08d37c980f02cc3a6bd115ad277"}, + {file = "pyzmq-26.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:e1e5d0a25aea8b691a00d6b54b28ac514c8cc0d8646d05f7ca6cb64b97358250"}, + {file = "pyzmq-26.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:fc82269d24860cfa859b676d18850cbb8e312dcd7eada09e7d5b007e2f3d9eb1"}, + {file = "pyzmq-26.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:416ac51cabd54f587995c2b05421324700b22e98d3d0aa2cfaec985524d16f1d"}, + {file = "pyzmq-26.1.0-cp313-cp313t-macosx_10_15_universal2.whl", hash = "sha256:ff832cce719edd11266ca32bc74a626b814fff236824aa1aeaad399b69fe6eae"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:393daac1bcf81b2a23e696b7b638eedc965e9e3d2112961a072b6cd8179ad2eb"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9869fa984c8670c8ab899a719eb7b516860a29bc26300a84d24d8c1b71eae3ec"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b3b8e36fd4c32c0825b4461372949ecd1585d326802b1321f8b6dc1d7e9318c"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:3ee647d84b83509b7271457bb428cc347037f437ead4b0b6e43b5eba35fec0aa"}, + {file = "pyzmq-26.1.0-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:45cb1a70eb00405ce3893041099655265fabcd9c4e1e50c330026e82257892c1"}, + {file = "pyzmq-26.1.0-cp313-cp313t-musllinux_1_1_i686.whl", hash = "sha256:5cca7b4adb86d7470e0fc96037771981d740f0b4cb99776d5cb59cd0e6684a73"}, + {file = "pyzmq-26.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:91d1a20bdaf3b25f3173ff44e54b1cfbc05f94c9e8133314eb2962a89e05d6e3"}, + {file = "pyzmq-26.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c0665d85535192098420428c779361b8823d3d7ec4848c6af3abb93bc5c915bf"}, + {file = "pyzmq-26.1.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:96d7c1d35ee4a495df56c50c83df7af1c9688cce2e9e0edffdbf50889c167595"}, + {file = "pyzmq-26.1.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b281b5ff5fcc9dcbfe941ac5c7fcd4b6c065adad12d850f95c9d6f23c2652384"}, + {file = "pyzmq-26.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5384c527a9a004445c5074f1e20db83086c8ff1682a626676229aafd9cf9f7d1"}, + {file = "pyzmq-26.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:754c99a9840839375ee251b38ac5964c0f369306eddb56804a073b6efdc0cd88"}, + {file = "pyzmq-26.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:9bdfcb74b469b592972ed881bad57d22e2c0acc89f5e8c146782d0d90fb9f4bf"}, + {file = "pyzmq-26.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:bd13f0231f4788db619347b971ca5f319c5b7ebee151afc7c14632068c6261d3"}, + {file = "pyzmq-26.1.0-cp37-cp37m-win32.whl", hash = "sha256:c5668dac86a869349828db5fc928ee3f58d450dce2c85607067d581f745e4fb1"}, + {file = "pyzmq-26.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:ad875277844cfaeca7fe299ddf8c8d8bfe271c3dc1caf14d454faa5cdbf2fa7a"}, + {file = "pyzmq-26.1.0-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:65c6e03cc0222eaf6aad57ff4ecc0a070451e23232bb48db4322cc45602cede0"}, + {file = "pyzmq-26.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:038ae4ffb63e3991f386e7fda85a9baab7d6617fe85b74a8f9cab190d73adb2b"}, + {file = "pyzmq-26.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:bdeb2c61611293f64ac1073f4bf6723b67d291905308a7de9bb2ca87464e3273"}, + {file = "pyzmq-26.1.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:61dfa5ee9d7df297c859ac82b1226d8fefaf9c5113dc25c2c00ecad6feeeb04f"}, + {file = "pyzmq-26.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3292d384537b9918010769b82ab3e79fca8b23d74f56fc69a679106a3e2c2cf"}, + {file = "pyzmq-26.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f9499c70c19ff0fbe1007043acb5ad15c1dec7d8e84ab429bca8c87138e8f85c"}, + {file = "pyzmq-26.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d3dd5523ed258ad58fed7e364c92a9360d1af8a9371e0822bd0146bdf017ef4c"}, + {file = "pyzmq-26.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:baba2fd199b098c5544ef2536b2499d2e2155392973ad32687024bd8572a7d1c"}, + {file = "pyzmq-26.1.0-cp38-cp38-win32.whl", hash = "sha256:ddbb2b386128d8eca92bd9ca74e80f73fe263bcca7aa419f5b4cbc1661e19741"}, + {file = "pyzmq-26.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:79e45a4096ec8388cdeb04a9fa5e9371583bcb826964d55b8b66cbffe7b33c86"}, + {file = "pyzmq-26.1.0-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:add52c78a12196bc0fda2de087ba6c876ea677cbda2e3eba63546b26e8bf177b"}, + {file = "pyzmq-26.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:98c03bd7f3339ff47de7ea9ac94a2b34580a8d4df69b50128bb6669e1191a895"}, + {file = "pyzmq-26.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:dcc37d9d708784726fafc9c5e1232de655a009dbf97946f117aefa38d5985a0f"}, + {file = "pyzmq-26.1.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5a6ed52f0b9bf8dcc64cc82cce0607a3dfed1dbb7e8c6f282adfccc7be9781de"}, + {file = "pyzmq-26.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:451e16ae8bea3d95649317b463c9f95cd9022641ec884e3d63fc67841ae86dfe"}, + {file = "pyzmq-26.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:906e532c814e1d579138177a00ae835cd6becbf104d45ed9093a3aaf658f6a6a"}, + {file = "pyzmq-26.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:05bacc4f94af468cc82808ae3293390278d5f3375bb20fef21e2034bb9a505b6"}, + {file = "pyzmq-26.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:57bb2acba798dc3740e913ffadd56b1fcef96f111e66f09e2a8db3050f1f12c8"}, + {file = "pyzmq-26.1.0-cp39-cp39-win32.whl", hash = "sha256:f774841bb0e8588505002962c02da420bcfb4c5056e87a139c6e45e745c0e2e2"}, + {file = "pyzmq-26.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:359c533bedc62c56415a1f5fcfd8279bc93453afdb0803307375ecf81c962402"}, + {file = "pyzmq-26.1.0-cp39-cp39-win_arm64.whl", hash = "sha256:7907419d150b19962138ecec81a17d4892ea440c184949dc29b358bc730caf69"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:b24079a14c9596846bf7516fe75d1e2188d4a528364494859106a33d8b48be38"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59d0acd2976e1064f1b398a00e2c3e77ed0a157529779e23087d4c2fb8aaa416"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:911c43a4117915203c4cc8755e0f888e16c4676a82f61caee2f21b0c00e5b894"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10163e586cc609f5f85c9b233195554d77b1e9a0801388907441aaeb22841c5"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:28a8b2abb76042f5fd7bd720f7fea48c0fd3e82e9de0a1bf2c0de3812ce44a42"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:bef24d3e4ae2c985034439f449e3f9e06bf579974ce0e53d8a507a1577d5b2ab"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2cd0f4d314f4a2518e8970b6f299ae18cff7c44d4a1fc06fc713f791c3a9e3ea"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fa25a620eed2a419acc2cf10135b995f8f0ce78ad00534d729aa761e4adcef8a"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef3b048822dca6d231d8a8ba21069844ae38f5d83889b9b690bf17d2acc7d099"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:9a6847c92d9851b59b9f33f968c68e9e441f9a0f8fc972c5580c5cd7cbc6ee24"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:c9b9305004d7e4e6a824f4f19b6d8f32b3578aad6f19fc1122aaf320cbe3dc83"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:63c1d3a65acb2f9c92dce03c4e1758cc552f1ae5c78d79a44e3bb88d2fa71f3a"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d36b8fffe8b248a1b961c86fbdfa0129dfce878731d169ede7fa2631447331be"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67976d12ebfd61a3bc7d77b71a9589b4d61d0422282596cf58c62c3866916544"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:998444debc8816b5d8d15f966e42751032d0f4c55300c48cc337f2b3e4f17d03"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:e5c88b2f13bcf55fee78ea83567b9fe079ba1a4bef8b35c376043440040f7edb"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d906d43e1592be4b25a587b7d96527cb67277542a5611e8ea9e996182fae410"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:80b0c9942430d731c786545da6be96d824a41a51742e3e374fedd9018ea43106"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:314d11564c00b77f6224d12eb3ddebe926c301e86b648a1835c5b28176c83eab"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:093a1a3cae2496233f14b57f4b485da01b4ff764582c854c0f42c6dd2be37f3d"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3c397b1b450f749a7e974d74c06d69bd22dd362142f370ef2bd32a684d6b480c"}, + {file = "pyzmq-26.1.0.tar.gz", hash = "sha256:6c5aeea71f018ebd3b9115c7cb13863dd850e98ca6b9258509de1246461a7e7f"}, ] [package.dependencies] diff --git a/sdks/python/julep/api/types/agents_route_list_response.py b/sdks/python/julep/api/types/agents_route_list_response.py index 98362162e..8802e37f5 100644 --- a/sdks/python/julep/api/types/agents_route_list_response.py +++ b/sdks/python/julep/api/types/agents_route_list_response.py @@ -9,7 +9,7 @@ class AgentsRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[AgentsAgent] + items: typing.List[AgentsAgent] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/sessions_route_list_response.py b/sdks/python/julep/api/types/sessions_route_list_response.py index 874d1bd1e..ff1807961 100644 --- a/sdks/python/julep/api/types/sessions_route_list_response.py +++ b/sdks/python/julep/api/types/sessions_route_list_response.py @@ -9,7 +9,7 @@ class SessionsRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[SessionsSession] + items: typing.List[SessionsSession] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/users_route_list_response.py b/sdks/python/julep/api/types/users_route_list_response.py index 7cb75ac18..77b2b9fb5 100644 --- a/sdks/python/julep/api/types/users_route_list_response.py +++ b/sdks/python/julep/api/types/users_route_list_response.py @@ -9,7 +9,7 @@ class UsersRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[UsersUser] + items: typing.List[UsersUser] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index 02908773a..ae3a59f88 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -2402,99 +2402,120 @@ files = [ [[package]] name = "pyzmq" -version = "26.0.3" +version = "26.1.0" description = "Python bindings for 0MQ" optional = false python-versions = ">=3.7" files = [ - {file = "pyzmq-26.0.3-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:44dd6fc3034f1eaa72ece33588867df9e006a7303725a12d64c3dff92330f625"}, - {file = "pyzmq-26.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:acb704195a71ac5ea5ecf2811c9ee19ecdc62b91878528302dd0be1b9451cc90"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5dbb9c997932473a27afa93954bb77a9f9b786b4ccf718d903f35da3232317de"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6bcb34f869d431799c3ee7d516554797f7760cb2198ecaa89c3f176f72d062be"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38ece17ec5f20d7d9b442e5174ae9f020365d01ba7c112205a4d59cf19dc38ee"}, - {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:ba6e5e6588e49139a0979d03a7deb9c734bde647b9a8808f26acf9c547cab1bf"}, - {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3bf8b000a4e2967e6dfdd8656cd0757d18c7e5ce3d16339e550bd462f4857e59"}, - {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2136f64fbb86451dbbf70223635a468272dd20075f988a102bf8a3f194a411dc"}, - {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e8918973fbd34e7814f59143c5f600ecd38b8038161239fd1a3d33d5817a38b8"}, - {file = "pyzmq-26.0.3-cp310-cp310-win32.whl", hash = "sha256:0aaf982e68a7ac284377d051c742610220fd06d330dcd4c4dbb4cdd77c22a537"}, - {file = "pyzmq-26.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:f1a9b7d00fdf60b4039f4455afd031fe85ee8305b019334b72dcf73c567edc47"}, - {file = "pyzmq-26.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:80b12f25d805a919d53efc0a5ad7c0c0326f13b4eae981a5d7b7cc343318ebb7"}, - {file = "pyzmq-26.0.3-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:a72a84570f84c374b4c287183debc776dc319d3e8ce6b6a0041ce2e400de3f32"}, - {file = "pyzmq-26.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7ca684ee649b55fd8f378127ac8462fb6c85f251c2fb027eb3c887e8ee347bcd"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e222562dc0f38571c8b1ffdae9d7adb866363134299264a1958d077800b193b7"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f17cde1db0754c35a91ac00b22b25c11da6eec5746431d6e5092f0cd31a3fea9"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b7c0c0b3244bb2275abe255d4a30c050d541c6cb18b870975553f1fb6f37527"}, - {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:ac97a21de3712afe6a6c071abfad40a6224fd14fa6ff0ff8d0c6e6cd4e2f807a"}, - {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:88b88282e55fa39dd556d7fc04160bcf39dea015f78e0cecec8ff4f06c1fc2b5"}, - {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:72b67f966b57dbd18dcc7efbc1c7fc9f5f983e572db1877081f075004614fcdd"}, - {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4b6cecbbf3b7380f3b61de3a7b93cb721125dc125c854c14ddc91225ba52f83"}, - {file = "pyzmq-26.0.3-cp311-cp311-win32.whl", hash = "sha256:eed56b6a39216d31ff8cd2f1d048b5bf1700e4b32a01b14379c3b6dde9ce3aa3"}, - {file = "pyzmq-26.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:3191d312c73e3cfd0f0afdf51df8405aafeb0bad71e7ed8f68b24b63c4f36500"}, - {file = "pyzmq-26.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:b6907da3017ef55139cf0e417c5123a84c7332520e73a6902ff1f79046cd3b94"}, - {file = "pyzmq-26.0.3-cp312-cp312-macosx_10_15_universal2.whl", hash = "sha256:068ca17214038ae986d68f4a7021f97e187ed278ab6dccb79f837d765a54d753"}, - {file = "pyzmq-26.0.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7821d44fe07335bea256b9f1f41474a642ca55fa671dfd9f00af8d68a920c2d4"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eeb438a26d87c123bb318e5f2b3d86a36060b01f22fbdffd8cf247d52f7c9a2b"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69ea9d6d9baa25a4dc9cef5e2b77b8537827b122214f210dd925132e34ae9b12"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7daa3e1369355766dea11f1d8ef829905c3b9da886ea3152788dc25ee6079e02"}, - {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6ca7a9a06b52d0e38ccf6bca1aeff7be178917893f3883f37b75589d42c4ac20"}, - {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1b7d0e124948daa4d9686d421ef5087c0516bc6179fdcf8828b8444f8e461a77"}, - {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e746524418b70f38550f2190eeee834db8850088c834d4c8406fbb9bc1ae10b2"}, - {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:6b3146f9ae6af82c47a5282ac8803523d381b3b21caeae0327ed2f7ecb718798"}, - {file = "pyzmq-26.0.3-cp312-cp312-win32.whl", hash = "sha256:2b291d1230845871c00c8462c50565a9cd6026fe1228e77ca934470bb7d70ea0"}, - {file = "pyzmq-26.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:926838a535c2c1ea21c903f909a9a54e675c2126728c21381a94ddf37c3cbddf"}, - {file = "pyzmq-26.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:5bf6c237f8c681dfb91b17f8435b2735951f0d1fad10cc5dfd96db110243370b"}, - {file = "pyzmq-26.0.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c0991f5a96a8e620f7691e61178cd8f457b49e17b7d9cfa2067e2a0a89fc1d5"}, - {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:dbf012d8fcb9f2cf0643b65df3b355fdd74fc0035d70bb5c845e9e30a3a4654b"}, - {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:01fbfbeb8249a68d257f601deb50c70c929dc2dfe683b754659569e502fbd3aa"}, - {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c8eb19abe87029c18f226d42b8a2c9efdd139d08f8bf6e085dd9075446db450"}, - {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:5344b896e79800af86ad643408ca9aa303a017f6ebff8cee5a3163c1e9aec987"}, - {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:204e0f176fd1d067671157d049466869b3ae1fc51e354708b0dc41cf94e23a3a"}, - {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a42db008d58530efa3b881eeee4991146de0b790e095f7ae43ba5cc612decbc5"}, - {file = "pyzmq-26.0.3-cp37-cp37m-win32.whl", hash = "sha256:8d7a498671ca87e32b54cb47c82a92b40130a26c5197d392720a1bce1b3c77cf"}, - {file = "pyzmq-26.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:3b4032a96410bdc760061b14ed6a33613ffb7f702181ba999df5d16fb96ba16a"}, - {file = "pyzmq-26.0.3-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:2cc4e280098c1b192c42a849de8de2c8e0f3a84086a76ec5b07bfee29bda7d18"}, - {file = "pyzmq-26.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bde86a2ed3ce587fa2b207424ce15b9a83a9fa14422dcc1c5356a13aed3df9d"}, - {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:34106f68e20e6ff253c9f596ea50397dbd8699828d55e8fa18bd4323d8d966e6"}, - {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ebbbd0e728af5db9b04e56389e2299a57ea8b9dd15c9759153ee2455b32be6ad"}, - {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6b1d1c631e5940cac5a0b22c5379c86e8df6a4ec277c7a856b714021ab6cfad"}, - {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e891ce81edd463b3b4c3b885c5603c00141151dd9c6936d98a680c8c72fe5c67"}, - {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9b273ecfbc590a1b98f014ae41e5cf723932f3b53ba9367cfb676f838038b32c"}, - {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b32bff85fb02a75ea0b68f21e2412255b5731f3f389ed9aecc13a6752f58ac97"}, - {file = "pyzmq-26.0.3-cp38-cp38-win32.whl", hash = "sha256:f6c21c00478a7bea93caaaef9e7629145d4153b15a8653e8bb4609d4bc70dbfc"}, - {file = "pyzmq-26.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:3401613148d93ef0fd9aabdbddb212de3db7a4475367f49f590c837355343972"}, - {file = "pyzmq-26.0.3-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:2ed8357f4c6e0daa4f3baf31832df8a33334e0fe5b020a61bc8b345a3db7a606"}, - {file = "pyzmq-26.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c1c8f2a2ca45292084c75bb6d3a25545cff0ed931ed228d3a1810ae3758f975f"}, - {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b63731993cdddcc8e087c64e9cf003f909262b359110070183d7f3025d1c56b5"}, - {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b3cd31f859b662ac5d7f4226ec7d8bd60384fa037fc02aee6ff0b53ba29a3ba8"}, - {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:115f8359402fa527cf47708d6f8a0f8234f0e9ca0cab7c18c9c189c194dbf620"}, - {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:715bdf952b9533ba13dfcf1f431a8f49e63cecc31d91d007bc1deb914f47d0e4"}, - {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e1258c639e00bf5e8a522fec6c3eaa3e30cf1c23a2f21a586be7e04d50c9acab"}, - {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:15c59e780be8f30a60816a9adab900c12a58d79c1ac742b4a8df044ab2a6d920"}, - {file = "pyzmq-26.0.3-cp39-cp39-win32.whl", hash = "sha256:d0cdde3c78d8ab5b46595054e5def32a755fc028685add5ddc7403e9f6de9879"}, - {file = "pyzmq-26.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:ce828058d482ef860746bf532822842e0ff484e27f540ef5c813d516dd8896d2"}, - {file = "pyzmq-26.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:788f15721c64109cf720791714dc14afd0f449d63f3a5487724f024345067381"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2c18645ef6294d99b256806e34653e86236eb266278c8ec8112622b61db255de"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7e6bc96ebe49604df3ec2c6389cc3876cabe475e6bfc84ced1bf4e630662cb35"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:971e8990c5cc4ddcff26e149398fc7b0f6a042306e82500f5e8db3b10ce69f84"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8416c23161abd94cc7da80c734ad7c9f5dbebdadfdaa77dad78244457448223"}, - {file = "pyzmq-26.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:082a2988364b60bb5de809373098361cf1dbb239623e39e46cb18bc035ed9c0c"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d57dfbf9737763b3a60d26e6800e02e04284926329aee8fb01049635e957fe81"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:77a85dca4c2430ac04dc2a2185c2deb3858a34fe7f403d0a946fa56970cf60a1"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4c82a6d952a1d555bf4be42b6532927d2a5686dd3c3e280e5f63225ab47ac1f5"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4496b1282c70c442809fc1b151977c3d967bfb33e4e17cedbf226d97de18f709"}, - {file = "pyzmq-26.0.3-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:e4946d6bdb7ba972dfda282f9127e5756d4f299028b1566d1245fa0d438847e6"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:03c0ae165e700364b266876d712acb1ac02693acd920afa67da2ebb91a0b3c09"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3e3070e680f79887d60feeda051a58d0ac36622e1759f305a41059eff62c6da7"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6ca08b840fe95d1c2bd9ab92dac5685f949fc6f9ae820ec16193e5ddf603c3b2"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e76654e9dbfb835b3518f9938e565c7806976c07b37c33526b574cc1a1050480"}, - {file = "pyzmq-26.0.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:871587bdadd1075b112e697173e946a07d722459d20716ceb3d1bd6c64bd08ce"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d0a2d1bd63a4ad79483049b26514e70fa618ce6115220da9efdff63688808b17"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0270b49b6847f0d106d64b5086e9ad5dc8a902413b5dbbb15d12b60f9c1747a4"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:703c60b9910488d3d0954ca585c34f541e506a091a41930e663a098d3b794c67"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74423631b6be371edfbf7eabb02ab995c2563fee60a80a30829176842e71722a"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4adfbb5451196842a88fda3612e2c0414134874bffb1c2ce83ab4242ec9e027d"}, - {file = "pyzmq-26.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3516119f4f9b8671083a70b6afaa0a070f5683e431ab3dc26e9215620d7ca1ad"}, - {file = "pyzmq-26.0.3.tar.gz", hash = "sha256:dba7d9f2e047dfa2bca3b01f4f84aa5246725203d6284e3790f2ca15fba6b40a"}, + {file = "pyzmq-26.1.0-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:263cf1e36862310bf5becfbc488e18d5d698941858860c5a8c079d1511b3b18e"}, + {file = "pyzmq-26.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d5c8b17f6e8f29138678834cf8518049e740385eb2dbf736e8f07fc6587ec682"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75a95c2358fcfdef3374cb8baf57f1064d73246d55e41683aaffb6cfe6862917"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f99de52b8fbdb2a8f5301ae5fc0f9e6b3ba30d1d5fc0421956967edcc6914242"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bcbfbab4e1895d58ab7da1b5ce9a327764f0366911ba5b95406c9104bceacb0"}, + {file = "pyzmq-26.1.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:77ce6a332c7e362cb59b63f5edf730e83590d0ab4e59c2aa5bd79419a42e3449"}, + {file = "pyzmq-26.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ba0a31d00e8616149a5ab440d058ec2da621e05d744914774c4dde6837e1f545"}, + {file = "pyzmq-26.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8b88641384e84a258b740801cd4dbc45c75f148ee674bec3149999adda4a8598"}, + {file = "pyzmq-26.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2fa76ebcebe555cce90f16246edc3ad83ab65bb7b3d4ce408cf6bc67740c4f88"}, + {file = "pyzmq-26.1.0-cp310-cp310-win32.whl", hash = "sha256:fbf558551cf415586e91160d69ca6416f3fce0b86175b64e4293644a7416b81b"}, + {file = "pyzmq-26.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:a7b8aab50e5a288c9724d260feae25eda69582be84e97c012c80e1a5e7e03fb2"}, + {file = "pyzmq-26.1.0-cp310-cp310-win_arm64.whl", hash = "sha256:08f74904cb066e1178c1ec706dfdb5c6c680cd7a8ed9efebeac923d84c1f13b1"}, + {file = "pyzmq-26.1.0-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:46d6800b45015f96b9d92ece229d92f2aef137d82906577d55fadeb9cf5fcb71"}, + {file = "pyzmq-26.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5bc2431167adc50ba42ea3e5e5f5cd70d93e18ab7b2f95e724dd8e1bd2c38120"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b3bb34bebaa1b78e562931a1687ff663d298013f78f972a534f36c523311a84d"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd3f6329340cef1c7ba9611bd038f2d523cea79f09f9c8f6b0553caba59ec562"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:471880c4c14e5a056a96cd224f5e71211997d40b4bf5e9fdded55dafab1f98f2"}, + {file = "pyzmq-26.1.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:ce6f2b66799971cbae5d6547acefa7231458289e0ad481d0be0740535da38d8b"}, + {file = "pyzmq-26.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0a1f6ea5b1d6cdbb8cfa0536f0d470f12b4b41ad83625012e575f0e3ecfe97f0"}, + {file = "pyzmq-26.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b45e6445ac95ecb7d728604bae6538f40ccf4449b132b5428c09918523abc96d"}, + {file = "pyzmq-26.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:94c4262626424683feea0f3c34951d39d49d354722db2745c42aa6bb50ecd93b"}, + {file = "pyzmq-26.1.0-cp311-cp311-win32.whl", hash = "sha256:a0f0ab9df66eb34d58205913f4540e2ad17a175b05d81b0b7197bc57d000e829"}, + {file = "pyzmq-26.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:8efb782f5a6c450589dbab4cb0f66f3a9026286333fe8f3a084399149af52f29"}, + {file = "pyzmq-26.1.0-cp311-cp311-win_arm64.whl", hash = "sha256:f133d05aaf623519f45e16ab77526e1e70d4e1308e084c2fb4cedb1a0c764bbb"}, + {file = "pyzmq-26.1.0-cp312-cp312-macosx_10_15_universal2.whl", hash = "sha256:3d3146b1c3dcc8a1539e7cc094700b2be1e605a76f7c8f0979b6d3bde5ad4072"}, + {file = "pyzmq-26.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d9270fbf038bf34ffca4855bcda6e082e2c7f906b9eb8d9a8ce82691166060f7"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:995301f6740a421afc863a713fe62c0aaf564708d4aa057dfdf0f0f56525294b"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7eca8b89e56fb8c6c26dd3e09bd41b24789022acf1cf13358e96f1cafd8cae3"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d4feb2e83dfe9ace6374a847e98ee9d1246ebadcc0cb765482e272c34e5820"}, + {file = "pyzmq-26.1.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:d4fafc2eb5d83f4647331267808c7e0c5722c25a729a614dc2b90479cafa78bd"}, + {file = "pyzmq-26.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:58c33dc0e185dd97a9ac0288b3188d1be12b756eda67490e6ed6a75cf9491d79"}, + {file = "pyzmq-26.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:68a0a1d83d33d8367ddddb3e6bb4afbb0f92bd1dac2c72cd5e5ddc86bdafd3eb"}, + {file = "pyzmq-26.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2ae7c57e22ad881af78075e0cea10a4c778e67234adc65c404391b417a4dda83"}, + {file = "pyzmq-26.1.0-cp312-cp312-win32.whl", hash = "sha256:347e84fc88cc4cb646597f6d3a7ea0998f887ee8dc31c08587e9c3fd7b5ccef3"}, + {file = "pyzmq-26.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:9f136a6e964830230912f75b5a116a21fe8e34128dcfd82285aa0ef07cb2c7bd"}, + {file = "pyzmq-26.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:a4b7a989c8f5a72ab1b2bbfa58105578753ae77b71ba33e7383a31ff75a504c4"}, + {file = "pyzmq-26.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d416f2088ac8f12daacffbc2e8918ef4d6be8568e9d7155c83b7cebed49d2322"}, + {file = "pyzmq-26.1.0-cp313-cp313-macosx_10_15_universal2.whl", hash = "sha256:ecb6c88d7946166d783a635efc89f9a1ff11c33d680a20df9657b6902a1d133b"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:471312a7375571857a089342beccc1a63584315188560c7c0da7e0a23afd8a5c"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e6cea102ffa16b737d11932c426f1dc14b5938cf7bc12e17269559c458ac334"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec7248673ffc7104b54e4957cee38b2f3075a13442348c8d651777bf41aa45ee"}, + {file = "pyzmq-26.1.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:0614aed6f87d550b5cecb03d795f4ddbb1544b78d02a4bd5eecf644ec98a39f6"}, + {file = "pyzmq-26.1.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:e8746ce968be22a8a1801bf4a23e565f9687088580c3ed07af5846580dd97f76"}, + {file = "pyzmq-26.1.0-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:7688653574392d2eaeef75ddcd0b2de5b232d8730af29af56c5adf1df9ef8d6f"}, + {file = "pyzmq-26.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8d4dac7d97f15c653a5fedcafa82626bd6cee1450ccdaf84ffed7ea14f2b07a4"}, + {file = "pyzmq-26.1.0-cp313-cp313-win32.whl", hash = "sha256:ccb42ca0a4a46232d716779421bbebbcad23c08d37c980f02cc3a6bd115ad277"}, + {file = "pyzmq-26.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:e1e5d0a25aea8b691a00d6b54b28ac514c8cc0d8646d05f7ca6cb64b97358250"}, + {file = "pyzmq-26.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:fc82269d24860cfa859b676d18850cbb8e312dcd7eada09e7d5b007e2f3d9eb1"}, + {file = "pyzmq-26.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:416ac51cabd54f587995c2b05421324700b22e98d3d0aa2cfaec985524d16f1d"}, + {file = "pyzmq-26.1.0-cp313-cp313t-macosx_10_15_universal2.whl", hash = "sha256:ff832cce719edd11266ca32bc74a626b814fff236824aa1aeaad399b69fe6eae"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:393daac1bcf81b2a23e696b7b638eedc965e9e3d2112961a072b6cd8179ad2eb"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9869fa984c8670c8ab899a719eb7b516860a29bc26300a84d24d8c1b71eae3ec"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b3b8e36fd4c32c0825b4461372949ecd1585d326802b1321f8b6dc1d7e9318c"}, + {file = "pyzmq-26.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:3ee647d84b83509b7271457bb428cc347037f437ead4b0b6e43b5eba35fec0aa"}, + {file = "pyzmq-26.1.0-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:45cb1a70eb00405ce3893041099655265fabcd9c4e1e50c330026e82257892c1"}, + {file = "pyzmq-26.1.0-cp313-cp313t-musllinux_1_1_i686.whl", hash = "sha256:5cca7b4adb86d7470e0fc96037771981d740f0b4cb99776d5cb59cd0e6684a73"}, + {file = "pyzmq-26.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:91d1a20bdaf3b25f3173ff44e54b1cfbc05f94c9e8133314eb2962a89e05d6e3"}, + {file = "pyzmq-26.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c0665d85535192098420428c779361b8823d3d7ec4848c6af3abb93bc5c915bf"}, + {file = "pyzmq-26.1.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:96d7c1d35ee4a495df56c50c83df7af1c9688cce2e9e0edffdbf50889c167595"}, + {file = "pyzmq-26.1.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b281b5ff5fcc9dcbfe941ac5c7fcd4b6c065adad12d850f95c9d6f23c2652384"}, + {file = "pyzmq-26.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5384c527a9a004445c5074f1e20db83086c8ff1682a626676229aafd9cf9f7d1"}, + {file = "pyzmq-26.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:754c99a9840839375ee251b38ac5964c0f369306eddb56804a073b6efdc0cd88"}, + {file = "pyzmq-26.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:9bdfcb74b469b592972ed881bad57d22e2c0acc89f5e8c146782d0d90fb9f4bf"}, + {file = "pyzmq-26.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:bd13f0231f4788db619347b971ca5f319c5b7ebee151afc7c14632068c6261d3"}, + {file = "pyzmq-26.1.0-cp37-cp37m-win32.whl", hash = "sha256:c5668dac86a869349828db5fc928ee3f58d450dce2c85607067d581f745e4fb1"}, + {file = "pyzmq-26.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:ad875277844cfaeca7fe299ddf8c8d8bfe271c3dc1caf14d454faa5cdbf2fa7a"}, + {file = "pyzmq-26.1.0-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:65c6e03cc0222eaf6aad57ff4ecc0a070451e23232bb48db4322cc45602cede0"}, + {file = "pyzmq-26.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:038ae4ffb63e3991f386e7fda85a9baab7d6617fe85b74a8f9cab190d73adb2b"}, + {file = "pyzmq-26.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:bdeb2c61611293f64ac1073f4bf6723b67d291905308a7de9bb2ca87464e3273"}, + {file = "pyzmq-26.1.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:61dfa5ee9d7df297c859ac82b1226d8fefaf9c5113dc25c2c00ecad6feeeb04f"}, + {file = "pyzmq-26.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3292d384537b9918010769b82ab3e79fca8b23d74f56fc69a679106a3e2c2cf"}, + {file = "pyzmq-26.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f9499c70c19ff0fbe1007043acb5ad15c1dec7d8e84ab429bca8c87138e8f85c"}, + {file = "pyzmq-26.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d3dd5523ed258ad58fed7e364c92a9360d1af8a9371e0822bd0146bdf017ef4c"}, + {file = "pyzmq-26.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:baba2fd199b098c5544ef2536b2499d2e2155392973ad32687024bd8572a7d1c"}, + {file = "pyzmq-26.1.0-cp38-cp38-win32.whl", hash = "sha256:ddbb2b386128d8eca92bd9ca74e80f73fe263bcca7aa419f5b4cbc1661e19741"}, + {file = "pyzmq-26.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:79e45a4096ec8388cdeb04a9fa5e9371583bcb826964d55b8b66cbffe7b33c86"}, + {file = "pyzmq-26.1.0-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:add52c78a12196bc0fda2de087ba6c876ea677cbda2e3eba63546b26e8bf177b"}, + {file = "pyzmq-26.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:98c03bd7f3339ff47de7ea9ac94a2b34580a8d4df69b50128bb6669e1191a895"}, + {file = "pyzmq-26.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:dcc37d9d708784726fafc9c5e1232de655a009dbf97946f117aefa38d5985a0f"}, + {file = "pyzmq-26.1.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5a6ed52f0b9bf8dcc64cc82cce0607a3dfed1dbb7e8c6f282adfccc7be9781de"}, + {file = "pyzmq-26.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:451e16ae8bea3d95649317b463c9f95cd9022641ec884e3d63fc67841ae86dfe"}, + {file = "pyzmq-26.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:906e532c814e1d579138177a00ae835cd6becbf104d45ed9093a3aaf658f6a6a"}, + {file = "pyzmq-26.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:05bacc4f94af468cc82808ae3293390278d5f3375bb20fef21e2034bb9a505b6"}, + {file = "pyzmq-26.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:57bb2acba798dc3740e913ffadd56b1fcef96f111e66f09e2a8db3050f1f12c8"}, + {file = "pyzmq-26.1.0-cp39-cp39-win32.whl", hash = "sha256:f774841bb0e8588505002962c02da420bcfb4c5056e87a139c6e45e745c0e2e2"}, + {file = "pyzmq-26.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:359c533bedc62c56415a1f5fcfd8279bc93453afdb0803307375ecf81c962402"}, + {file = "pyzmq-26.1.0-cp39-cp39-win_arm64.whl", hash = "sha256:7907419d150b19962138ecec81a17d4892ea440c184949dc29b358bc730caf69"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:b24079a14c9596846bf7516fe75d1e2188d4a528364494859106a33d8b48be38"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59d0acd2976e1064f1b398a00e2c3e77ed0a157529779e23087d4c2fb8aaa416"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:911c43a4117915203c4cc8755e0f888e16c4676a82f61caee2f21b0c00e5b894"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10163e586cc609f5f85c9b233195554d77b1e9a0801388907441aaeb22841c5"}, + {file = "pyzmq-26.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:28a8b2abb76042f5fd7bd720f7fea48c0fd3e82e9de0a1bf2c0de3812ce44a42"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:bef24d3e4ae2c985034439f449e3f9e06bf579974ce0e53d8a507a1577d5b2ab"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2cd0f4d314f4a2518e8970b6f299ae18cff7c44d4a1fc06fc713f791c3a9e3ea"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fa25a620eed2a419acc2cf10135b995f8f0ce78ad00534d729aa761e4adcef8a"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef3b048822dca6d231d8a8ba21069844ae38f5d83889b9b690bf17d2acc7d099"}, + {file = "pyzmq-26.1.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:9a6847c92d9851b59b9f33f968c68e9e441f9a0f8fc972c5580c5cd7cbc6ee24"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:c9b9305004d7e4e6a824f4f19b6d8f32b3578aad6f19fc1122aaf320cbe3dc83"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:63c1d3a65acb2f9c92dce03c4e1758cc552f1ae5c78d79a44e3bb88d2fa71f3a"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d36b8fffe8b248a1b961c86fbdfa0129dfce878731d169ede7fa2631447331be"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67976d12ebfd61a3bc7d77b71a9589b4d61d0422282596cf58c62c3866916544"}, + {file = "pyzmq-26.1.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:998444debc8816b5d8d15f966e42751032d0f4c55300c48cc337f2b3e4f17d03"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:e5c88b2f13bcf55fee78ea83567b9fe079ba1a4bef8b35c376043440040f7edb"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d906d43e1592be4b25a587b7d96527cb67277542a5611e8ea9e996182fae410"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:80b0c9942430d731c786545da6be96d824a41a51742e3e374fedd9018ea43106"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:314d11564c00b77f6224d12eb3ddebe926c301e86b648a1835c5b28176c83eab"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:093a1a3cae2496233f14b57f4b485da01b4ff764582c854c0f42c6dd2be37f3d"}, + {file = "pyzmq-26.1.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3c397b1b450f749a7e974d74c06d69bd22dd362142f370ef2bd32a684d6b480c"}, + {file = "pyzmq-26.1.0.tar.gz", hash = "sha256:6c5aeea71f018ebd3b9115c7cb13863dd850e98ca6b9258509de1246461a7e7f"}, ] [package.dependencies] diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index c642a99bd..8c7945853 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -88,7 +88,7 @@ export class DefaultService { */ metadataFilter?: string; }): CancelablePromise<{ - results: Array; + items: Array; }> { return this.httpRequest.request({ method: "GET", @@ -936,7 +936,7 @@ export class DefaultService { */ metadataFilter?: string; }): CancelablePromise<{ - results: Array; + items: Array; }> { return this.httpRequest.request({ method: "GET", @@ -1545,7 +1545,7 @@ export class DefaultService { */ metadataFilter?: string; }): CancelablePromise<{ - results: Array; + items: Array; }> { return this.httpRequest.request({ method: "GET", diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp index 56beb423a..f6a6f2510 100644 --- a/typespec/common/interfaces.tsp +++ b/typespec/common/interfaces.tsp @@ -18,7 +18,7 @@ interface LimitOffsetPagination< @get @doc(DocString) list(...PaginationOptions): { - results: Type[]; + items: Type[]; }; } From 160c76f9e316e04acc63af448e24ba39d8c91383 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 5 Aug 2024 17:59:40 -0400 Subject: [PATCH 3/5] feat(agents-api): Add user routes Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Chat.py | 2 +- agents-api/agents_api/autogen/Entries.py | 2 +- agents-api/agents_api/clients/temporal.py | 2 +- .../models/docs/search_docs_hybrid.py | 6 +- .../execution/get_paused_execution_token.py | 1 - .../agents_api/models/user/delete_user.py | 107 ++++++++++++++++++ .../agents_api/routers/agents/list_agents.py | 12 +- .../agents_api/routers/tasks/routers.py | 3 - .../agents_api/routers/users/__init__.py | 15 ++- .../routers/users/create_or_update_user.py | 27 +++++ .../agents_api/routers/users/create_user.py | 16 +-- .../agents_api/routers/users/delete_user.py | 17 +++ .../agents_api/routers/users/exceptions.py | 7 -- .../routers/users/get_user_details.py | 28 +---- .../agents_api/routers/users/list_users.py | 25 ++-- .../agents_api/routers/users/patch_user.py | 31 ++--- .../agents_api/routers/users/update_user.py | 31 ++--- .../agents_api/workflows/task_execution.py | 2 +- 18 files changed, 215 insertions(+), 119 deletions(-) create mode 100644 agents-api/agents_api/models/user/delete_user.py create mode 100644 agents-api/agents_api/routers/users/create_or_update_user.py create mode 100644 agents-api/agents_api/routers/users/delete_user.py delete mode 100644 agents-api/agents_api/routers/users/exceptions.py diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 6669fbcec..c7c25c7ad 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field from .Docs import DocReference from .Entries import ChatMLMessage diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index d56b333d8..6c8bf9ca4 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field from .Tools import ChosenToolCall, Tool, ToolResponse diff --git a/agents-api/agents_api/clients/temporal.py b/agents-api/agents_api/clients/temporal.py index 3fb9e9e99..7e45b50d7 100644 --- a/agents-api/agents_api/clients/temporal.py +++ b/agents-api/agents_api/clients/temporal.py @@ -1,6 +1,6 @@ from uuid import UUID -from temporalio.client import Client, TLSConfig, WorkflowHandle +from temporalio.client import Client, TLSConfig from agents_api.env import ( temporal_client_cert, diff --git a/agents-api/agents_api/models/docs/search_docs_hybrid.py b/agents-api/agents_api/models/docs/search_docs_hybrid.py index 1595b3ca5..b9d6a1ec0 100644 --- a/agents-api/agents_api/models/docs/search_docs_hybrid.py +++ b/agents-api/agents_api/models/docs/search_docs_hybrid.py @@ -39,7 +39,11 @@ def dbsf_fuse( """ all_docs = {doc.id: doc for doc in text_results + embedding_results} - text_scores: dict[UUID, float] = {doc.id: -doc.distance for doc in text_results} + assert all(doc.distance is not None in all_docs for doc in text_results) + + text_scores: dict[UUID, float] = { + doc.id: -(doc.distance or 0.0) for doc in text_results + } # Because these are cosine distances, we need to invert them embedding_scores: dict[UUID, float] = { diff --git a/agents-api/agents_api/models/execution/get_paused_execution_token.py b/agents-api/agents_api/models/execution/get_paused_execution_token.py index 00fe39873..1b1f6e803 100644 --- a/agents-api/agents_api/models/execution/get_paused_execution_token.py +++ b/agents-api/agents_api/models/execution/get_paused_execution_token.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError -from ...autogen.openapi_model import Transition from ..utils import ( cozo_query, partialclass, diff --git a/agents-api/agents_api/models/user/delete_user.py b/agents-api/agents_api/models/user/delete_user.py new file mode 100644 index 000000000..dfb720cf8 --- /dev/null +++ b/agents-api/agents_api/models/user/delete_user.py @@ -0,0 +1,107 @@ +""" +This module contains the implementation of the delete_user_query function, which is responsible for deleting an user and its related default settings from the CozoDB database. +""" + +from uuid import UUID + +from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError + +from ...autogen.openapi_model import ResourceDeletedResponse +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) +@wrap_in_class( + ResourceDeletedResponse, + one=True, + transform=lambda d: { + "id": UUID(d.pop("user_id")), + "deleted_at": utcnow(), + "jobs": [], + }, +) +@cozo_query +@beartype +def delete_user(*, developer_id: UUID, user_id: UUID) -> tuple[list[str], dict]: + """ + Constructs and returns a datalog query for deleting an user and its default settings from the database. + + Parameters: + - developer_id (UUID): The UUID of the developer owning the user. + - user_id (UUID): The UUID of the user to be deleted. + - client (CozoClient, optional): An instance of the CozoClient to execute the query. + + Returns: + - ResourceDeletedResponse: The response indicating the deletion of the user. + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "users", user_id=user_id), + """ + # Delete docs + ?[user_id, doc_id] := + *user_docs{ + user_id, + doc_id, + }, user_id = to_uuid($user_id) + + :delete user_docs { + user_id, + doc_id + } + :returning + """, + """ + # Delete tools + ?[user_id, tool_id] := + *tools{ + user_id, + tool_id, + }, user_id = to_uuid($user_id) + + :delete tools { + user_id, + tool_id + } + :returning + """, + """ + # Delete default user settings + ?[user_id] <- [[$user_id]] + + :delete user_default_settings { + user_id + } + :returning + """, + """ + # Delete the user + ?[user_id, developer_id] <- [[$user_id, $developer_id]] + + :delete users { + developer_id, + user_id + } + :returning + """, + ] + + return (queries, {"user_id": str(user_id), "developer_id": str(developer_id)}) diff --git a/agents-api/agents_api/routers/agents/list_agents.py b/agents-api/agents_api/routers/agents/list_agents.py index f894d9c36..f64d4bdbf 100644 --- a/agents-api/agents_api/routers/agents/list_agents.py +++ b/agents-api/agents_api/routers/agents/list_agents.py @@ -1,6 +1,8 @@ +import json +from json import JSONDecodeError from typing import Annotated, Literal -from fastapi import Depends +from fastapi import Depends, HTTPException, status from pydantic import UUID4 from ...autogen.openapi_model import Agent, ListResponse @@ -18,6 +20,14 @@ async def list_agents( direction: Literal["asc", "desc"] = "desc", metadata_filter: str = "{}", ) -> ListResponse[Agent]: + try: + metadata_filter = json.loads(metadata_filter) + except JSONDecodeError: + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail="metadata_filter is not a valid JSON", + ) + agents = list_agents_query( developer_id=x_developer_id, limit=limit, diff --git a/agents-api/agents_api/routers/tasks/routers.py b/agents-api/agents_api/routers/tasks/routers.py index 836531453..ca9a9c745 100644 --- a/agents-api/agents_api/routers/tasks/routers.py +++ b/agents-api/agents_api/routers/tasks/routers.py @@ -9,7 +9,6 @@ from pycozo.client import QueryException from pydantic import UUID4, BaseModel from starlette.status import HTTP_201_CREATED -from temporalio.client import WorkflowHandle from agents_api.autogen.openapi_model import ( CreateExecutionRequest, @@ -23,9 +22,7 @@ Transition, UpdateExecutionRequest, ) -from agents_api.clients.cozo import client as cozo_client from agents_api.clients.temporal import get_client, run_task_execution_workflow -from agents_api.common.protocol.tasks import ExecutionInput from agents_api.dependencies.developer_id import get_developer_id from agents_api.models.execution.create_execution import ( create_execution as create_execution_query, diff --git a/agents-api/agents_api/routers/users/__init__.py b/agents-api/agents_api/routers/users/__init__.py index 91888636d..0cfdf4a5e 100644 --- a/agents-api/agents_api/routers/users/__init__.py +++ b/agents-api/agents_api/routers/users/__init__.py @@ -1,6 +1,9 @@ -from .create_user import create_user # noqa: F401 -from .get_user_details import get_user_details # noqa: F401 -from .list_users import list_users # noqa: F401 -from .patch_user import patch_user # noqa: F401 -from .router import router # noqa: F401 -from .update_user import update_user # noqa: F401 +# ruff: noqa: F401 +from .create_or_update_user import create_or_update_user +from .create_user import create_user +from .delete_user import delete_user +from .get_user_details import get_user_details +from .list_users import list_users +from .patch_user import patch_user +from .router import router +from .update_user import update_user diff --git a/agents-api/agents_api/routers/users/create_or_update_user.py b/agents-api/agents_api/routers/users/create_or_update_user.py new file mode 100644 index 000000000..928bee62f --- /dev/null +++ b/agents-api/agents_api/routers/users/create_or_update_user.py @@ -0,0 +1,27 @@ +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 +from starlette.status import HTTP_201_CREATED + +from ...autogen.openapi_model import CreateOrUpdateUserRequest, ResourceCreatedResponse +from ...dependencies.developer_id import get_developer_id +from ...models.user.create_or_update_user import ( + create_or_update_user as create_or_update_user_query, +) +from .router import router + + +@router.post("/users/{user_id}", status_code=HTTP_201_CREATED, tags=["users"]) +async def create_or_update_user( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + user_id: UUID4, + data: CreateOrUpdateUserRequest, +) -> ResourceCreatedResponse: + user = create_or_update_user_query( + developer_id=x_developer_id, + user_id=user_id, + data=data, + ) + + return ResourceCreatedResponse(id=user.id, created_at=user.created_at) diff --git a/agents-api/agents_api/routers/users/create_user.py b/agents-api/agents_api/routers/users/create_user.py index 4e1986315..07e763b66 100644 --- a/agents-api/agents_api/routers/users/create_user.py +++ b/agents-api/agents_api/routers/users/create_user.py @@ -1,5 +1,4 @@ from typing import Annotated -from uuid import uuid4 from fastapi import Depends from pydantic import UUID4 @@ -13,17 +12,12 @@ @router.post("/users", status_code=HTTP_201_CREATED, tags=["users"]) async def create_user( - request: CreateUserRequest, + data: CreateUserRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], ) -> ResourceCreatedResponse: - user_id = uuid4() - created_user = create_user_query( + user = create_user_query( developer_id=x_developer_id, - user_id=user_id, - name=request.name, - about=request.about, - metadata=request.metadata, - ) - return ResourceCreatedResponse( - id=str(user_id), created_at=created_user["created_at"] + data=data, ) + + return ResourceCreatedResponse(id=user.id, created_at=user.created_at) diff --git a/agents-api/agents_api/routers/users/delete_user.py b/agents-api/agents_api/routers/users/delete_user.py new file mode 100644 index 000000000..fd1d02a94 --- /dev/null +++ b/agents-api/agents_api/routers/users/delete_user.py @@ -0,0 +1,17 @@ +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 +from starlette.status import HTTP_202_ACCEPTED + +from ...autogen.openapi_model import ResourceDeletedResponse +from ...dependencies.developer_id import get_developer_id +from ...models.user.delete_user import delete_user as delete_user_query +from .router import router + + +@router.delete("/users/{user_id}", status_code=HTTP_202_ACCEPTED, tags=["users"]) +async def delete_user( + user_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] +) -> ResourceDeletedResponse: + return delete_user_query(developer_id=x_developer_id, user_id=user_id) diff --git a/agents-api/agents_api/routers/users/exceptions.py b/agents-api/agents_api/routers/users/exceptions.py deleted file mode 100644 index 188c31bb8..000000000 --- a/agents-api/agents_api/routers/users/exceptions.py +++ /dev/null @@ -1,7 +0,0 @@ -class BaseUserException(Exception): - pass - - -class InvalidUserQueryError(BaseUserException): - def __init__(self, message: str): - super().__init__(f"Invalid user query: {message}") diff --git a/agents-api/agents_api/routers/users/get_user_details.py b/agents-api/agents_api/routers/users/get_user_details.py index bb3950cb6..0bc0460ca 100644 --- a/agents-api/agents_api/routers/users/get_user_details.py +++ b/agents-api/agents_api/routers/users/get_user_details.py @@ -1,11 +1,9 @@ from typing import Annotated -from fastapi import Depends, HTTPException, status -from pycozo.client import QueryException +from fastapi import Depends from pydantic import UUID4 from ...autogen.openapi_model import User -from ...common.exceptions.users import UserNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.user.get_user import get_user as get_user_query from .router import router @@ -13,27 +11,7 @@ @router.get("/users/{user_id}", tags=["users"]) async def get_user_details( - user_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + user_id: UUID4, ) -> User: - try: - resp = [ - row.to_dict() - for _, row in get_user_query( - developer_id=x_developer_id, - user_id=user_id, - ).iterrows() - ][0] - - return User(**resp) - except (IndexError, KeyError): - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail="User not found", - ) - except QueryException as e: - # the code is not so informative now, but it may be a good solution in the future - if e.code == "transact::assertion_failure": - raise UserNotFoundError(x_developer_id, user_id) - - raise + return get_user_query(developer_id=x_developer_id, user_id=user_id) diff --git a/agents-api/agents_api/routers/users/list_users.py b/agents-api/agents_api/routers/users/list_users.py index c7e7b33c4..aa57883b3 100644 --- a/agents-api/agents_api/routers/users/list_users.py +++ b/agents-api/agents_api/routers/users/list_users.py @@ -1,11 +1,11 @@ import json from json import JSONDecodeError -from typing import Annotated, List +from typing import Annotated, List, Literal from fastapi import Depends, HTTPException, status from pydantic import UUID4 -from ...autogen.openapi_model import User +from ...autogen.openapi_model import ListResponse, User from ...dependencies.developer_id import get_developer_id from ...models.user.list_users import list_users as list_users_query from .router import router @@ -16,6 +16,8 @@ async def list_users( x_developer_id: Annotated[UUID4, Depends(get_developer_id)], limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", metadata_filter: str = "{}", ) -> List[User]: try: @@ -26,14 +28,13 @@ async def list_users( detail="metadata_filter is not a valid JSON", ) - users = [ - User(**row.to_dict()) - for _, row in list_users_query( - developer_id=x_developer_id, - limit=limit, - offset=offset, - metadata_filter=metadata_filter, - ).iterrows() - ] + users = list_users_query( + developer_id=x_developer_id, + limit=limit, + offset=offset, + sort_by=sort_by, + direction=direction, + metadata_filter=metadata_filter, + ) - return users + return ListResponse[User](items=users) diff --git a/agents-api/agents_api/routers/users/patch_user.py b/agents-api/agents_api/routers/users/patch_user.py index 7ffeb8251..fcd1e9380 100644 --- a/agents-api/agents_api/routers/users/patch_user.py +++ b/agents-api/agents_api/routers/users/patch_user.py @@ -1,11 +1,9 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND from ...autogen.openapi_model import PatchUserRequest, ResourceUpdatedResponse -from ...common.exceptions.users import UserNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.user.patch_user import patch_user as patch_user_query from .router import router @@ -14,26 +12,11 @@ @router.patch("/users/{user_id}", tags=["users"]) async def patch_user( user_id: UUID4, - request: PatchUserRequest, + data: PatchUserRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], ) -> ResourceUpdatedResponse: - try: - resp = patch_user_query( - developer_id=x_developer_id, - user_id=user_id, - name=request.name, - about=request.about, - metadata=request.metadata, - ) - - return ResourceUpdatedResponse( - id=resp["user_id"][0], - updated_at=resp["updated_at"][0], - ) - except (IndexError, KeyError): - raise HTTPException( - status_code=HTTP_404_NOT_FOUND, - detail="User not found", - ) - except UserNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) + return patch_user_query( + developer_id=x_developer_id, + user_id=user_id, + data=data, + ) diff --git a/agents-api/agents_api/routers/users/update_user.py b/agents-api/agents_api/routers/users/update_user.py index 39e8f782b..258023173 100644 --- a/agents-api/agents_api/routers/users/update_user.py +++ b/agents-api/agents_api/routers/users/update_user.py @@ -1,11 +1,9 @@ from typing import Annotated -from fastapi import Depends, HTTPException +from fastapi import Depends from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateUserRequest -from ...common.exceptions.users import UserNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.user.update_user import update_user as update_user_query from .router import router @@ -14,26 +12,11 @@ @router.put("/users/{user_id}", tags=["users"]) async def update_user( user_id: UUID4, - request: UpdateUserRequest, + data: UpdateUserRequest, x_developer_id: Annotated[UUID4, Depends(get_developer_id)], ) -> ResourceUpdatedResponse: - try: - resp = update_user_query( - developer_id=x_developer_id, - user_id=user_id, - name=request.name, - about=request.about, - metadata=request.metadata, - ) - - return ResourceUpdatedResponse( - id=resp["user_id"][0], - updated_at=resp["updated_at"][0], - ) - except (IndexError, KeyError): - raise HTTPException( - status_code=HTTP_404_NOT_FOUND, - detail="User not found", - ) - except UserNotFoundError as e: - raise HTTPException(status_code=HTTP_404_NOT_FOUND, detail=str(e)) + return update_user_query( + developer_id=x_developer_id, + user_id=user_id, + data=data, + ) diff --git a/agents-api/agents_api/workflows/task_execution.py b/agents-api/agents_api/workflows/task_execution.py index 4870454d1..13c1af9f9 100644 --- a/agents-api/agents_api/workflows/task_execution.py +++ b/agents-api/agents_api/workflows/task_execution.py @@ -3,7 +3,7 @@ from datetime import timedelta -from temporalio import activity, workflow +from temporalio import workflow with workflow.unsafe.imports_passed_through(): from ..activities.task_steps import ( From c9c9a0681bc2d2e887ff04f74608aa22b4608299 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 5 Aug 2024 18:49:11 -0400 Subject: [PATCH 4/5] feat(agents-api): Add docs routes Signed-off-by: Diwank Tomer --- .../agents_api/models/docs/delete_doc.py | 27 +--- agents-api/agents_api/models/docs/get_doc.py | 8 +- agents-api/agents_api/routers/__init__.py | 8 ++ .../agents_api/routers/docs/__init__.py | 6 + .../agents_api/routers/docs/create_doc.py | 42 ++++++ .../agents_api/routers/docs/delete_doc.py | 17 +++ agents-api/agents_api/routers/docs/get_doc.py | 17 +++ .../agents_api/routers/docs/list_docs.py | 75 +++++++++++ agents-api/agents_api/routers/docs/router.py | 3 + .../agents_api/routers/sessions/__init__.py | 1 + .../routers/sessions/get_session_history.py | 16 +++ agents-api/poetry.lock | 126 ++++++++++-------- sdks/python/julep/api/client.py | 22 +-- sdks/python/julep/api/reference.md | 9 -- sdks/python/poetry.lock | 26 +++- sdks/ts/src/api/services/DefaultService.ts | 8 -- typespec/entries/endpoints.tsp | 4 - 17 files changed, 288 insertions(+), 127 deletions(-) create mode 100644 agents-api/agents_api/routers/docs/__init__.py create mode 100644 agents-api/agents_api/routers/docs/create_doc.py create mode 100644 agents-api/agents_api/routers/docs/delete_doc.py create mode 100644 agents-api/agents_api/routers/docs/get_doc.py create mode 100644 agents-api/agents_api/routers/docs/list_docs.py create mode 100644 agents-api/agents_api/routers/docs/router.py create mode 100644 agents-api/agents_api/routers/sessions/get_session_history.py diff --git a/agents-api/agents_api/models/docs/delete_doc.py b/agents-api/agents_api/models/docs/delete_doc.py index 842fc9d6f..d754a671a 100644 --- a/agents-api/agents_api/models/docs/delete_doc.py +++ b/agents-api/agents_api/models/docs/delete_doc.py @@ -1,4 +1,3 @@ -from typing import Literal from uuid import UUID from beartype import beartype @@ -13,7 +12,6 @@ partialclass, rewrap_exceptions, verify_developer_id_query, - verify_developer_owns_resource_query, wrap_in_class, ) @@ -39,8 +37,6 @@ def delete_doc( *, developer_id: UUID, - owner_type: Literal["user", "agent"], - owner_id: UUID, doc_id: UUID, ) -> tuple[list[str], dict]: """Constructs and returns a datalog query for deleting documents and associated information snippets. @@ -48,8 +44,6 @@ def delete_doc( This function targets the 'cozodb' database, allowing for the removal of documents and their related information snippets based on the provided document ID and owner (user or agent). Parameters: - owner_type (Literal["user", "agent"]): The type of the owner, either 'user' or 'agent'. - owner_id (UUID): The UUID of the owner. doc_id (UUID): The UUID of the document to be deleted. client (CozoClient): An instance of the CozoClient to execute the query. @@ -57,12 +51,11 @@ def delete_doc( pd.DataFrame: The result of the executed datalog query. """ # Convert UUID parameters to string format for use in the datalog query - owner_id = str(owner_id) doc_id = str(doc_id) # The following query is divided into two main parts: # 1. Deleting information snippets associated with the document - # 2. Deleting the document itself from the owner's collection + # 2. Deleting the document itself delete_snippets_query = """ # This section constructs the subquery for identifying and deleting all information snippets associated with the given document ID. # Delete snippets @@ -81,29 +74,17 @@ def delete_doc( """ delete_doc_query = """ - # This section constructs the subquery for deleting the document from the specified owner's (user or agent) document collection. # Delete the docs - ?[doc_id, owner_id, owner_type] <- [[ - to_uuid($doc_id), - to_uuid($owner_id), - $owner_type, - ]] + ?[doc_id] <- [[ to_uuid($doc_id) ]] - :delete docs { - doc_id, - owner_type, - owner_id, - } + :delete docs { doc_id } :returning """ queries = [ verify_developer_id_query(developer_id), - verify_developer_owns_resource_query( - developer_id, f"{owner_type}s", **{f"{owner_type}_id": owner_id} - ), delete_snippets_query, delete_doc_query, ] - return (queries, {"doc_id": doc_id, "owner_id": owner_id, "owner_type": owner_type}) + return (queries, {"doc_id": doc_id}) diff --git a/agents-api/agents_api/models/docs/get_doc.py b/agents-api/agents_api/models/docs/get_doc.py index 95b9414f4..fcac5b0a4 100644 --- a/agents-api/agents_api/models/docs/get_doc.py +++ b/agents-api/agents_api/models/docs/get_doc.py @@ -1,6 +1,5 @@ """Module for retrieving document snippets from the CozoDB based on document IDs.""" -from typing import Literal from uuid import UUID from beartype import beartype @@ -38,14 +37,12 @@ def get_doc( *, developer_id: UUID, - owner_type: Literal["user", "agent"], doc_id: UUID, ) -> tuple[list[str], dict]: """ Retrieves snippets of documents by their ID from the CozoDB. Parameters: - owner_type (Literal["user", "agent"]): The type of the owner of the document. doc_id (UUID): The unique identifier of the document. client (CozoClient, optional): The CozoDB client instance. Defaults to a pre-configured client. @@ -67,16 +64,13 @@ def get_doc( snippet_data = [index, content] ?[ - owner_type, id, title, snippet_data, created_at, metadata, ] := input[id], - owner_type = $owner_type, *docs { - owner_type, doc_id: id, title, created_at, @@ -90,4 +84,4 @@ def get_doc( get_query, ] - return (queries, {"doc_id": doc_id, "owner_type": owner_type}) + return (queries, {"doc_id": doc_id}) diff --git a/agents-api/agents_api/routers/__init__.py b/agents-api/agents_api/routers/__init__.py index 8d16aa32a..04280e706 100644 --- a/agents-api/agents_api/routers/__init__.py +++ b/agents-api/agents_api/routers/__init__.py @@ -9,3 +9,11 @@ Each sub-module defines its own set of API endpoints and is responsible for handling requests and responses related to its domain, ensuring a modular and organized approach to API development. """ + +# ruff: noqa: F401 + +from .agents import router as agents_router +from .docs import router as docs_router +from .jobs import router as jobs_router +from .sessions import router as sessions_router +from .users import router as users_router diff --git a/agents-api/agents_api/routers/docs/__init__.py b/agents-api/agents_api/routers/docs/__init__.py new file mode 100644 index 000000000..062db6a67 --- /dev/null +++ b/agents-api/agents_api/routers/docs/__init__.py @@ -0,0 +1,6 @@ +# ruff: noqa: F401 +from .create_doc import create_agent_doc, create_user_doc +from .delete_doc import delete_doc +from .get_doc import get_doc +from .list_docs import list_agent_docs, list_user_docs +from .router import router diff --git a/agents-api/agents_api/routers/docs/create_doc.py b/agents-api/agents_api/routers/docs/create_doc.py new file mode 100644 index 000000000..d99468733 --- /dev/null +++ b/agents-api/agents_api/routers/docs/create_doc.py @@ -0,0 +1,42 @@ +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 +from starlette.status import HTTP_201_CREATED + +from ...autogen.openapi_model import CreateDocRequest, ResourceCreatedResponse +from ...dependencies.developer_id import get_developer_id +from ...models.docs.create_doc import create_doc as create_doc_query +from .router import router + + +@router.post("/users/{user_id}/docs", status_code=HTTP_201_CREATED, tags=["docs"]) +async def create_user_doc( + user_id: UUID4, + data: CreateDocRequest, + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], +) -> ResourceCreatedResponse: + doc = create_doc_query( + developer_id=x_developer_id, + owner_type="user", + owner_id=user_id, + data=data, + ) + + return ResourceCreatedResponse(id=doc.id, created_at=doc.created_at) + + +@router.post("/agents/{agent_id}/docs", status_code=HTTP_201_CREATED, tags=["docs"]) +async def create_agent_doc( + agent_id: UUID4, + data: CreateDocRequest, + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], +) -> ResourceCreatedResponse: + doc = create_doc_query( + developer_id=x_developer_id, + owner_type="agent", + owner_id=agent_id, + data=data, + ) + + return ResourceCreatedResponse(id=doc.id, created_at=doc.created_at) diff --git a/agents-api/agents_api/routers/docs/delete_doc.py b/agents-api/agents_api/routers/docs/delete_doc.py new file mode 100644 index 000000000..d1ae4416f --- /dev/null +++ b/agents-api/agents_api/routers/docs/delete_doc.py @@ -0,0 +1,17 @@ +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 +from starlette.status import HTTP_202_ACCEPTED + +from ...autogen.openapi_model import ResourceDeletedResponse +from ...dependencies.developer_id import get_developer_id +from ...models.docs.delete_doc import delete_doc as delete_doc_query +from .router import router + + +@router.delete("/docs/{doc_id}", status_code=HTTP_202_ACCEPTED, tags=["docs"]) +async def delete_doc( + doc_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] +) -> ResourceDeletedResponse: + return delete_doc_query(developer_id=x_developer_id, doc_id=doc_id) diff --git a/agents-api/agents_api/routers/docs/get_doc.py b/agents-api/agents_api/routers/docs/get_doc.py new file mode 100644 index 000000000..febebf1bd --- /dev/null +++ b/agents-api/agents_api/routers/docs/get_doc.py @@ -0,0 +1,17 @@ +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 + +from ...autogen.openapi_model import Doc +from ...dependencies.developer_id import get_developer_id +from ...models.docs.get_doc import get_doc as get_doc_query +from .router import router + + +@router.get("/docs/{doc_id}", tags=["docs"]) +async def get_doc( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + doc_id: UUID4, +) -> Doc: + return get_doc_query(developer_id=x_developer_id, doc_id=doc_id) diff --git a/agents-api/agents_api/routers/docs/list_docs.py b/agents-api/agents_api/routers/docs/list_docs.py new file mode 100644 index 000000000..80a6ba6ae --- /dev/null +++ b/agents-api/agents_api/routers/docs/list_docs.py @@ -0,0 +1,75 @@ +import json +from json import JSONDecodeError +from typing import Annotated, Literal + +from fastapi import Depends, HTTPException, status +from pydantic import UUID4 + +from ...autogen.openapi_model import Doc, ListResponse +from ...dependencies.developer_id import get_developer_id +from ...models.docs.list_docs import list_docs as list_docs_query +from .router import router + + +@router.get("/users/{user_id}/docs", tags=["docs"]) +async def list_user_docs( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + user_id: UUID4, + limit: int = 100, + offset: int = 0, + sort_by: Literal["created_at", "updated_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", + metadata_filter: str = "{}", +) -> ListResponse[Doc]: + try: + metadata_filter = json.loads(metadata_filter) + except JSONDecodeError: + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail="metadata_filter is not a valid JSON", + ) + + docs = list_docs_query( + developer_id=x_developer_id, + owner_type="user", + owner_id=user_id, + limit=limit, + offset=offset, + sort_by=sort_by, + direction=direction, + metadata_filter=metadata_filter, + ) + + return ListResponse[Doc](items=docs) + + +@router.get("/agents/{agent_id}/docs", tags=["docs"]) +async def list_agent_docs( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + agent_id: UUID4, + limit: int = 100, + offset: int = 0, + sort_by: Literal["created_at", "updated_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", + metadata_filter: str = "{}", +) -> ListResponse[Doc]: + try: + metadata_filter = json.loads(metadata_filter) + except JSONDecodeError: + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail="metadata_filter is not a valid JSON", + ) + + docs = list_docs_query( + developer_id=x_developer_id, + owner_type="agent", + owner_id=agent_id, + limit=limit, + offset=offset, + sort_by=sort_by, + direction=direction, + metadata_filter=metadata_filter, + ) + + return ListResponse[Doc](items=docs) diff --git a/agents-api/agents_api/routers/docs/router.py b/agents-api/agents_api/routers/docs/router.py new file mode 100644 index 000000000..af9233c56 --- /dev/null +++ b/agents-api/agents_api/routers/docs/router.py @@ -0,0 +1,3 @@ +from fastapi import APIRouter + +router = APIRouter() diff --git a/agents-api/agents_api/routers/sessions/__init__.py b/agents-api/agents_api/routers/sessions/__init__.py index 24ae2d9e8..8ed3d953d 100644 --- a/agents-api/agents_api/routers/sessions/__init__.py +++ b/agents-api/agents_api/routers/sessions/__init__.py @@ -4,6 +4,7 @@ from .create_session import create_session from .delete_session import delete_session from .get_session import get_session +from .get_session_history import get_session_history from .list_sessions import list_sessions from .patch_session import patch_session from .router import router diff --git a/agents-api/agents_api/routers/sessions/get_session_history.py b/agents-api/agents_api/routers/sessions/get_session_history.py new file mode 100644 index 000000000..c960f001e --- /dev/null +++ b/agents-api/agents_api/routers/sessions/get_session_history.py @@ -0,0 +1,16 @@ +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 + +from ...autogen.openapi_model import Session +from ...dependencies.developer_id import get_developer_id +from ...models.entry.get_history import get_history as get_history_query +from .router import router + + +@router.get("/sessions/{session_id}/history", tags=["sessions"]) +async def get_session_history( + session_id: UUID4, x_developer_id: Annotated[UUID4, Depends(get_developer_id)] +) -> Session: + return get_history_query(developer_id=x_developer_id, session_id=session_id) diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index d6ccc1344..ddfee9708 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -848,13 +848,33 @@ validation = ["openapi-spec-validator (>=0.2.8,<0.7.0)", "prance (>=0.18.2)"] [[package]] name = "debugpy" -version = "1.8.3" +version = "1.8.2" description = "An implementation of the Debug Adapter Protocol for Python" optional = false python-versions = ">=3.8" files = [ - {file = "debugpy-1.8.3-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:0df2c400853150af14996b8d1a4f54d45ffa98e76c0f3de30665e89e273ea293"}, - {file = "debugpy-1.8.3.zip", hash = "sha256:0f5a6326d9fc375b864ed368d06cddf2dabe5135511e71cde3758be699847d36"}, + {file = "debugpy-1.8.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:7ee2e1afbf44b138c005e4380097d92532e1001580853a7cb40ed84e0ef1c3d2"}, + {file = "debugpy-1.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f8c3f7c53130a070f0fc845a0f2cee8ed88d220d6b04595897b66605df1edd6"}, + {file = "debugpy-1.8.2-cp310-cp310-win32.whl", hash = "sha256:f179af1e1bd4c88b0b9f0fa153569b24f6b6f3de33f94703336363ae62f4bf47"}, + {file = "debugpy-1.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:0600faef1d0b8d0e85c816b8bb0cb90ed94fc611f308d5fde28cb8b3d2ff0fe3"}, + {file = "debugpy-1.8.2-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:8a13417ccd5978a642e91fb79b871baded925d4fadd4dfafec1928196292aa0a"}, + {file = "debugpy-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acdf39855f65c48ac9667b2801234fc64d46778021efac2de7e50907ab90c634"}, + {file = "debugpy-1.8.2-cp311-cp311-win32.whl", hash = "sha256:2cbd4d9a2fc5e7f583ff9bf11f3b7d78dfda8401e8bb6856ad1ed190be4281ad"}, + {file = "debugpy-1.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:d3408fddd76414034c02880e891ea434e9a9cf3a69842098ef92f6e809d09afa"}, + {file = "debugpy-1.8.2-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:5d3ccd39e4021f2eb86b8d748a96c766058b39443c1f18b2dc52c10ac2757835"}, + {file = "debugpy-1.8.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62658aefe289598680193ff655ff3940e2a601765259b123dc7f89c0239b8cd3"}, + {file = "debugpy-1.8.2-cp312-cp312-win32.whl", hash = "sha256:bd11fe35d6fd3431f1546d94121322c0ac572e1bfb1f6be0e9b8655fb4ea941e"}, + {file = "debugpy-1.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:15bc2f4b0f5e99bf86c162c91a74c0631dbd9cef3c6a1d1329c946586255e859"}, + {file = "debugpy-1.8.2-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:5a019d4574afedc6ead1daa22736c530712465c0c4cd44f820d803d937531b2d"}, + {file = "debugpy-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40f062d6877d2e45b112c0bbade9a17aac507445fd638922b1a5434df34aed02"}, + {file = "debugpy-1.8.2-cp38-cp38-win32.whl", hash = "sha256:c78ba1680f1015c0ca7115671fe347b28b446081dada3fedf54138f44e4ba031"}, + {file = "debugpy-1.8.2-cp38-cp38-win_amd64.whl", hash = "sha256:cf327316ae0c0e7dd81eb92d24ba8b5e88bb4d1b585b5c0d32929274a66a5210"}, + {file = "debugpy-1.8.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:1523bc551e28e15147815d1397afc150ac99dbd3a8e64641d53425dba57b0ff9"}, + {file = "debugpy-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e24ccb0cd6f8bfaec68d577cb49e9c680621c336f347479b3fce060ba7c09ec1"}, + {file = "debugpy-1.8.2-cp39-cp39-win32.whl", hash = "sha256:7f8d57a98c5a486c5c7824bc0b9f2f11189d08d73635c326abef268f83950326"}, + {file = "debugpy-1.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:16c8dcab02617b75697a0a925a62943e26a0330da076e2a10437edd9f0bf3755"}, + {file = "debugpy-1.8.2-py2.py3-none-any.whl", hash = "sha256:16e16df3a98a35c63c3ab1e4d19be4cbc7fdda92d9ddc059294f18910928e0ca"}, + {file = "debugpy-1.8.2.zip", hash = "sha256:95378ed08ed2089221896b9b3a8d021e642c24edc8fef20e5d4342ca8be65c00"}, ] [[package]] @@ -4898,60 +4918,60 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.31" +version = "2.0.32" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.31-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f2a213c1b699d3f5768a7272de720387ae0122f1becf0901ed6eaa1abd1baf6c"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9fea3d0884e82d1e33226935dac990b967bef21315cbcc894605db3441347443"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3ad7f221d8a69d32d197e5968d798217a4feebe30144986af71ada8c548e9fa"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f2bee229715b6366f86a95d497c347c22ddffa2c7c96143b59a2aa5cc9eebbc"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:cd5b94d4819c0c89280b7c6109c7b788a576084bf0a480ae17c227b0bc41e109"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:750900a471d39a7eeba57580b11983030517a1f512c2cb287d5ad0fcf3aebd58"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-win32.whl", hash = "sha256:7bd112be780928c7f493c1a192cd8c5fc2a2a7b52b790bc5a84203fb4381c6be"}, - {file = "SQLAlchemy-2.0.31-cp310-cp310-win_amd64.whl", hash = "sha256:5a48ac4d359f058474fadc2115f78a5cdac9988d4f99eae44917f36aa1476327"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f68470edd70c3ac3b6cd5c2a22a8daf18415203ca1b036aaeb9b0fb6f54e8298"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2e2c38c2a4c5c634fe6c3c58a789712719fa1bf9b9d6ff5ebfce9a9e5b89c1ca"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd15026f77420eb2b324dcb93551ad9c5f22fab2c150c286ef1dc1160f110203"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2196208432deebdfe3b22185d46b08f00ac9d7b01284e168c212919891289396"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:352b2770097f41bff6029b280c0e03b217c2dcaddc40726f8f53ed58d8a85da4"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:56d51ae825d20d604583f82c9527d285e9e6d14f9a5516463d9705dab20c3740"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-win32.whl", hash = "sha256:6e2622844551945db81c26a02f27d94145b561f9d4b0c39ce7bfd2fda5776dac"}, - {file = "SQLAlchemy-2.0.31-cp311-cp311-win_amd64.whl", hash = "sha256:ccaf1b0c90435b6e430f5dd30a5aede4764942a695552eb3a4ab74ed63c5b8d3"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3b74570d99126992d4b0f91fb87c586a574a5872651185de8297c6f90055ae42"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f77c4f042ad493cb8595e2f503c7a4fe44cd7bd59c7582fd6d78d7e7b8ec52c"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd1591329333daf94467e699e11015d9c944f44c94d2091f4ac493ced0119449"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74afabeeff415e35525bf7a4ecdab015f00e06456166a2eba7590e49f8db940e"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b9c01990d9015df2c6f818aa8f4297d42ee71c9502026bb074e713d496e26b67"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:66f63278db425838b3c2b1c596654b31939427016ba030e951b292e32b99553e"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-win32.whl", hash = "sha256:0b0f658414ee4e4b8cbcd4a9bb0fd743c5eeb81fc858ca517217a8013d282c96"}, - {file = "SQLAlchemy-2.0.31-cp312-cp312-win_amd64.whl", hash = "sha256:fa4b1af3e619b5b0b435e333f3967612db06351217c58bfb50cee5f003db2a5a"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f43e93057cf52a227eda401251c72b6fbe4756f35fa6bfebb5d73b86881e59b0"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d337bf94052856d1b330d5fcad44582a30c532a2463776e1651bd3294ee7e58b"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c06fb43a51ccdff3b4006aafee9fcf15f63f23c580675f7734245ceb6b6a9e05"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:b6e22630e89f0e8c12332b2b4c282cb01cf4da0d26795b7eae16702a608e7ca1"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:79a40771363c5e9f3a77f0e28b3302801db08040928146e6808b5b7a40749c88"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-win32.whl", hash = "sha256:501ff052229cb79dd4c49c402f6cb03b5a40ae4771efc8bb2bfac9f6c3d3508f"}, - {file = "SQLAlchemy-2.0.31-cp37-cp37m-win_amd64.whl", hash = "sha256:597fec37c382a5442ffd471f66ce12d07d91b281fd474289356b1a0041bdf31d"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dc6d69f8829712a4fd799d2ac8d79bdeff651c2301b081fd5d3fe697bd5b4ab9"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:23b9fbb2f5dd9e630db70fbe47d963c7779e9c81830869bd7d137c2dc1ad05fb"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a21c97efcbb9f255d5c12a96ae14da873233597dfd00a3a0c4ce5b3e5e79704"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26a6a9837589c42b16693cf7bf836f5d42218f44d198f9343dd71d3164ceeeac"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc251477eae03c20fae8db9c1c23ea2ebc47331bcd73927cdcaecd02af98d3c3"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:2fd17e3bb8058359fa61248c52c7b09a97cf3c820e54207a50af529876451808"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-win32.whl", hash = "sha256:c76c81c52e1e08f12f4b6a07af2b96b9b15ea67ccdd40ae17019f1c373faa227"}, - {file = "SQLAlchemy-2.0.31-cp38-cp38-win_amd64.whl", hash = "sha256:4b600e9a212ed59355813becbcf282cfda5c93678e15c25a0ef896b354423238"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b6cf796d9fcc9b37011d3f9936189b3c8074a02a4ed0c0fbbc126772c31a6d4"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:78fe11dbe37d92667c2c6e74379f75746dc947ee505555a0197cfba9a6d4f1a4"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2fc47dc6185a83c8100b37acda27658fe4dbd33b7d5e7324111f6521008ab4fe"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a41514c1a779e2aa9a19f67aaadeb5cbddf0b2b508843fcd7bafdf4c6864005"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:afb6dde6c11ea4525318e279cd93c8734b795ac8bb5dda0eedd9ebaca7fa23f1"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:3f9faef422cfbb8fd53716cd14ba95e2ef655400235c3dfad1b5f467ba179c8c"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-win32.whl", hash = "sha256:fc6b14e8602f59c6ba893980bea96571dd0ed83d8ebb9c4479d9ed5425d562e9"}, - {file = "SQLAlchemy-2.0.31-cp39-cp39-win_amd64.whl", hash = "sha256:3cb8a66b167b033ec72c3812ffc8441d4e9f5f78f5e31e54dcd4c90a4ca5bebc"}, - {file = "SQLAlchemy-2.0.31-py3-none-any.whl", hash = "sha256:69f3e3c08867a8e4856e92d7afb618b95cdee18e0bc1647b77599722c9a28911"}, - {file = "SQLAlchemy-2.0.31.tar.gz", hash = "sha256:b607489dd4a54de56984a0c7656247504bd5523d9d0ba799aef59d4add009484"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0c9045ecc2e4db59bfc97b20516dfdf8e41d910ac6fb667ebd3a79ea54084619"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1467940318e4a860afd546ef61fefb98a14d935cd6817ed07a228c7f7c62f389"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5954463675cb15db8d4b521f3566a017c8789222b8316b1e6934c811018ee08b"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167e7497035c303ae50651b351c28dc22a40bb98fbdb8468cdc971821b1ae533"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b27dfb676ac02529fb6e343b3a482303f16e6bc3a4d868b73935b8792edb52d0"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bf2360a5e0f7bd75fa80431bf8ebcfb920c9f885e7956c7efde89031695cafb8"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-win32.whl", hash = "sha256:306fe44e754a91cd9d600a6b070c1f2fadbb4a1a257b8781ccf33c7067fd3e4d"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-win_amd64.whl", hash = "sha256:99db65e6f3ab42e06c318f15c98f59a436f1c78179e6a6f40f529c8cc7100b22"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:21b053be28a8a414f2ddd401f1be8361e41032d2ef5884b2f31d31cb723e559f"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b178e875a7a25b5938b53b006598ee7645172fccafe1c291a706e93f48499ff5"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723a40ee2cc7ea653645bd4cf024326dea2076673fc9d3d33f20f6c81db83e1d"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:295ff8689544f7ee7e819529633d058bd458c1fd7f7e3eebd0f9268ebc56c2a0"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:49496b68cd190a147118af585173ee624114dfb2e0297558c460ad7495f9dfe2"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:acd9b73c5c15f0ec5ce18128b1fe9157ddd0044abc373e6ecd5ba376a7e5d961"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-win32.whl", hash = "sha256:9365a3da32dabd3e69e06b972b1ffb0c89668994c7e8e75ce21d3e5e69ddef28"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-win_amd64.whl", hash = "sha256:8bd63d051f4f313b102a2af1cbc8b80f061bf78f3d5bd0843ff70b5859e27924"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bab3db192a0c35e3c9d1560eb8332463e29e5507dbd822e29a0a3c48c0a8d92"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:19d98f4f58b13900d8dec4ed09dd09ef292208ee44cc9c2fe01c1f0a2fe440e9"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cd33c61513cb1b7371fd40cf221256456d26a56284e7d19d1f0b9f1eb7dd7e8"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6ba0497c1d066dd004e0f02a92426ca2df20fac08728d03f67f6960271feec"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2b6be53e4fde0065524f1a0a7929b10e9280987b320716c1509478b712a7688c"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:916a798f62f410c0b80b63683c8061f5ebe237b0f4ad778739304253353bc1cb"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-win32.whl", hash = "sha256:31983018b74908ebc6c996a16ad3690301a23befb643093fcfe85efd292e384d"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-win_amd64.whl", hash = "sha256:4363ed245a6231f2e2957cccdda3c776265a75851f4753c60f3004b90e69bfeb"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b8afd5b26570bf41c35c0121801479958b4446751a3971fb9a480c1afd85558e"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c750987fc876813f27b60d619b987b057eb4896b81117f73bb8d9918c14f1cad"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada0102afff4890f651ed91120c1120065663506b760da4e7823913ebd3258be"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:78c03d0f8a5ab4f3034c0e8482cfcc415a3ec6193491cfa1c643ed707d476f16"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:3bd1cae7519283ff525e64645ebd7a3e0283f3c038f461ecc1c7b040a0c932a1"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-win32.whl", hash = "sha256:01438ebcdc566d58c93af0171c74ec28efe6a29184b773e378a385e6215389da"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-win_amd64.whl", hash = "sha256:4979dc80fbbc9d2ef569e71e0896990bc94df2b9fdbd878290bd129b65ab579c"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c742be912f57586ac43af38b3848f7688863a403dfb220193a882ea60e1ec3a"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:62e23d0ac103bcf1c5555b6c88c114089587bc64d048fef5bbdb58dfd26f96da"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:251f0d1108aab8ea7b9aadbd07fb47fb8e3a5838dde34aa95a3349876b5a1f1d"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ef18a84e5116340e38eca3e7f9eeaaef62738891422e7c2a0b80feab165905f"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3eb6a97a1d39976f360b10ff208c73afb6a4de86dd2a6212ddf65c4a6a2347d5"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0c1c9b673d21477cec17ab10bc4decb1322843ba35b481585facd88203754fc5"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-win32.whl", hash = "sha256:c41a2b9ca80ee555decc605bd3c4520cc6fef9abde8fd66b1cf65126a6922d65"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-win_amd64.whl", hash = "sha256:8a37e4d265033c897892279e8adf505c8b6b4075f2b40d77afb31f7185cd6ecd"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:52fec964fba2ef46476312a03ec8c425956b05c20220a1a03703537824b5e8e1"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:328429aecaba2aee3d71e11f2477c14eec5990fb6d0e884107935f7fb6001632"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85a01b5599e790e76ac3fe3aa2f26e1feba56270023d6afd5550ed63c68552b3"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaf04784797dcdf4c0aa952c8d234fa01974c4729db55c45732520ce12dd95b4"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4488120becf9b71b3ac718f4138269a6be99a42fe023ec457896ba4f80749525"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:14e09e083a5796d513918a66f3d6aedbc131e39e80875afe81d98a03312889e6"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-win32.whl", hash = "sha256:0d322cc9c9b2154ba7e82f7bf25ecc7c36fbe2d82e2933b3642fc095a52cfc78"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-win_amd64.whl", hash = "sha256:7dd8583df2f98dea28b5cd53a1beac963f4f9d087888d75f22fcc93a07cf8d84"}, + {file = "SQLAlchemy-2.0.32-py3-none-any.whl", hash = "sha256:e567a8793a692451f706b363ccf3c45e056b67d90ead58c3bc9471af5d212202"}, + {file = "SQLAlchemy-2.0.32.tar.gz", hash = "sha256:c1b88cc8b02b6a5f0efb0345a03672d4c897dc7d92585176f88c67346f565ea8"}, ] [package.dependencies] diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index e42669227..f8eb4cae5 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -2782,11 +2782,7 @@ def chat_route_generate( raise ApiError(status_code=_response.status_code, body=_response_json) def history_route_history( - self, - id: CommonUuid, - *, - limit: CommonLimit, - request_options: typing.Optional[RequestOptions] = None, + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> EntriesHistory: """ Get history of a Session @@ -2796,9 +2792,6 @@ def history_route_history( id : CommonUuid ID of parent - limit : CommonLimit - Limit the number of items returned - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2817,13 +2810,11 @@ def history_route_history( ) client.history_route_history( id="id", - limit=1, ) """ _response = self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}/history", method="GET", - params={"limit": limit}, request_options=request_options, ) try: @@ -6593,11 +6584,7 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response_json) async def history_route_history( - self, - id: CommonUuid, - *, - limit: CommonLimit, - request_options: typing.Optional[RequestOptions] = None, + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> EntriesHistory: """ Get history of a Session @@ -6607,9 +6594,6 @@ async def history_route_history( id : CommonUuid ID of parent - limit : CommonLimit - Limit the number of items returned - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6633,7 +6617,6 @@ async def history_route_history( async def main() -> None: await client.history_route_history( id="id", - limit=1, ) @@ -6642,7 +6625,6 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}/history", method="GET", - params={"limit": limit}, request_options=request_options, ) try: diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index 0e13814f2..77af661e3 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -3912,7 +3912,6 @@ client = JulepApi( ) client.history_route_history( id="id", - limit=1, ) ``` @@ -3937,14 +3936,6 @@ client.history_route_history(
-**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index 870dfac4c..545eebbe1 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -577,13 +577,33 @@ develop = ["coverage", "invoke", "path.py", "pylint", "pytest (>=3.2)", "pytest- [[package]] name = "debugpy" -version = "1.8.3" +version = "1.8.2" description = "An implementation of the Debug Adapter Protocol for Python" optional = false python-versions = ">=3.8" files = [ - {file = "debugpy-1.8.3-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:0df2c400853150af14996b8d1a4f54d45ffa98e76c0f3de30665e89e273ea293"}, - {file = "debugpy-1.8.3.zip", hash = "sha256:0f5a6326d9fc375b864ed368d06cddf2dabe5135511e71cde3758be699847d36"}, + {file = "debugpy-1.8.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:7ee2e1afbf44b138c005e4380097d92532e1001580853a7cb40ed84e0ef1c3d2"}, + {file = "debugpy-1.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f8c3f7c53130a070f0fc845a0f2cee8ed88d220d6b04595897b66605df1edd6"}, + {file = "debugpy-1.8.2-cp310-cp310-win32.whl", hash = "sha256:f179af1e1bd4c88b0b9f0fa153569b24f6b6f3de33f94703336363ae62f4bf47"}, + {file = "debugpy-1.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:0600faef1d0b8d0e85c816b8bb0cb90ed94fc611f308d5fde28cb8b3d2ff0fe3"}, + {file = "debugpy-1.8.2-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:8a13417ccd5978a642e91fb79b871baded925d4fadd4dfafec1928196292aa0a"}, + {file = "debugpy-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acdf39855f65c48ac9667b2801234fc64d46778021efac2de7e50907ab90c634"}, + {file = "debugpy-1.8.2-cp311-cp311-win32.whl", hash = "sha256:2cbd4d9a2fc5e7f583ff9bf11f3b7d78dfda8401e8bb6856ad1ed190be4281ad"}, + {file = "debugpy-1.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:d3408fddd76414034c02880e891ea434e9a9cf3a69842098ef92f6e809d09afa"}, + {file = "debugpy-1.8.2-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:5d3ccd39e4021f2eb86b8d748a96c766058b39443c1f18b2dc52c10ac2757835"}, + {file = "debugpy-1.8.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62658aefe289598680193ff655ff3940e2a601765259b123dc7f89c0239b8cd3"}, + {file = "debugpy-1.8.2-cp312-cp312-win32.whl", hash = "sha256:bd11fe35d6fd3431f1546d94121322c0ac572e1bfb1f6be0e9b8655fb4ea941e"}, + {file = "debugpy-1.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:15bc2f4b0f5e99bf86c162c91a74c0631dbd9cef3c6a1d1329c946586255e859"}, + {file = "debugpy-1.8.2-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:5a019d4574afedc6ead1daa22736c530712465c0c4cd44f820d803d937531b2d"}, + {file = "debugpy-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40f062d6877d2e45b112c0bbade9a17aac507445fd638922b1a5434df34aed02"}, + {file = "debugpy-1.8.2-cp38-cp38-win32.whl", hash = "sha256:c78ba1680f1015c0ca7115671fe347b28b446081dada3fedf54138f44e4ba031"}, + {file = "debugpy-1.8.2-cp38-cp38-win_amd64.whl", hash = "sha256:cf327316ae0c0e7dd81eb92d24ba8b5e88bb4d1b585b5c0d32929274a66a5210"}, + {file = "debugpy-1.8.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:1523bc551e28e15147815d1397afc150ac99dbd3a8e64641d53425dba57b0ff9"}, + {file = "debugpy-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e24ccb0cd6f8bfaec68d577cb49e9c680621c336f347479b3fce060ba7c09ec1"}, + {file = "debugpy-1.8.2-cp39-cp39-win32.whl", hash = "sha256:7f8d57a98c5a486c5c7824bc0b9f2f11189d08d73635c326abef268f83950326"}, + {file = "debugpy-1.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:16c8dcab02617b75697a0a925a62943e26a0330da076e2a10437edd9f0bf3755"}, + {file = "debugpy-1.8.2-py2.py3-none-any.whl", hash = "sha256:16e16df3a98a35c63c3ab1e4d19be4cbc7fdda92d9ddc059294f18910928e0ca"}, + {file = "debugpy-1.8.2.zip", hash = "sha256:95378ed08ed2089221896b9b3a8d021e642c24edc8fef20e5d4342ca8be65c00"}, ] [[package]] diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 81f17c7f2..c25ff685a 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -1404,16 +1404,11 @@ export class DefaultService { */ public historyRouteHistory({ id, - limit = 100, }: { /** * ID of parent */ id: Common_uuid; - /** - * Limit the number of items returned - */ - limit?: Common_limit; }): CancelablePromise { return this.httpRequest.request({ method: "GET", @@ -1421,9 +1416,6 @@ export class DefaultService { path: { id: id, }, - query: { - limit: limit, - }, }); } /** diff --git a/typespec/entries/endpoints.tsp b/typespec/entries/endpoints.tsp index bcb9459b6..3a4a0335b 100644 --- a/typespec/entries/endpoints.tsp +++ b/typespec/entries/endpoints.tsp @@ -23,9 +23,5 @@ interface Endpoints @path @doc("ID of parent") id: uuid, - - @query - @doc("Limit the number of items returned") - limit: limit = 100, ): History; } From 3b6e81deeae9ed0c7e30d63a971ab1d036b891a7 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 5 Aug 2024 19:25:24 -0400 Subject: [PATCH 5/5] feat(agents-api): Add doc search routes Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Docs.py | 39 ++-- .../models/docs/search_docs_hybrid.py | 3 +- .../agents_api/routers/docs/__init__.py | 1 + .../agents_api/routers/docs/search_docs.py | 111 +++++++++++ sdks/python/julep/api/__init__.py | 14 +- sdks/python/julep/api/client.py | 183 ++---------------- sdks/python/julep/api/reference.md | 96 +-------- sdks/python/julep/api/types/__init__.py | 24 +-- ...s_search_route_search_request_direction.py | 7 - ...ocs_search_route_search_request_sort_by.py | 7 - ...gents_docs_search_route_search_response.py | 43 ---- .../api/types/docs_base_doc_search_request.py | 16 +- ...esponse.py => docs_doc_search_response.py} | 12 +- .../types/docs_hybrid_doc_search_request.py | 10 + .../types/docs_vector_doc_search_request.py | 5 + ...s_search_route_search_request_direction.py | 7 - ...ocs_search_route_search_request_sort_by.py | 7 - sdks/ts/src/api/index.ts | 2 + .../api/models/Docs_BaseDocSearchRequest.ts | 13 +- .../src/api/models/Docs_DocSearchResponse.ts | 15 ++ .../api/models/Docs_HybridDocSearchRequest.ts | 8 + .../api/models/Docs_VectorDocSearchRequest.ts | 4 + .../api/schemas/$Docs_BaseDocSearchRequest.ts | 18 +- .../api/schemas/$Docs_DocSearchResponse.ts | 21 ++ .../schemas/$Docs_HybridDocSearchRequest.ts | 12 ++ .../schemas/$Docs_VectorDocSearchRequest.ts | 6 + sdks/ts/src/api/services/DefaultService.ts | 78 +------- typespec/docs/endpoints.tsp | 5 +- typespec/docs/models.tsp | 30 +-- 29 files changed, 287 insertions(+), 510 deletions(-) create mode 100644 agents-api/agents_api/routers/docs/search_docs.py delete mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py delete mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_response.py rename sdks/python/julep/api/types/{user_docs_search_route_search_response.py => docs_doc_search_response.py} (82%) delete mode 100644 sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py delete mode 100644 sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py create mode 100644 sdks/ts/src/api/models/Docs_DocSearchResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py index b9da3646d..36d0c5a95 100644 --- a/agents-api/agents_api/autogen/Docs.py +++ b/agents-api/agents_api/autogen/Docs.py @@ -13,18 +13,7 @@ class BaseDocSearchRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)] - """ - The confidence cutoff level - """ - alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)] - """ - The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; - """ - mmr: bool = False - """ - Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. - """ + limit: Annotated[int, Field(10, ge=1, le=100)] lang: Literal["en-US"] = "en-US" """ The language to be used for text-only search. Support for other languages coming soon. @@ -105,6 +94,20 @@ class DocReference(BaseModel): distance: float | None = None +class DocSearchResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + docs: list[DocReference] + """ + The documents that were found + """ + time: Annotated[float, Field(gt=0.0)] + """ + The time taken to search in seconds + """ + + class EmbedQueryRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -129,6 +132,14 @@ class HybridDocSearchRequest(BaseDocSearchRequest): model_config = ConfigDict( populate_by_name=True, ) + confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)] + """ + The confidence cutoff level + """ + alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)] + """ + The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + """ text: str """ Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. @@ -161,6 +172,10 @@ class VectorDocSearchRequest(BaseDocSearchRequest): model_config = ConfigDict( populate_by_name=True, ) + confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)] + """ + The confidence cutoff level + """ vector: list[float] """ Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. diff --git a/agents-api/agents_api/models/docs/search_docs_hybrid.py b/agents-api/agents_api/models/docs/search_docs_hybrid.py index b9d6a1ec0..82f550ac9 100644 --- a/agents-api/agents_api/models/docs/search_docs_hybrid.py +++ b/agents-api/agents_api/models/docs/search_docs_hybrid.py @@ -97,6 +97,7 @@ def search_docs_hybrid( query: str, query_embedding: list[float], k: int = 3, + alpha: float = 0.7, # Weight of the embedding search results (this is a good default) embed_search_options: dict = {}, text_search_options: dict = {}, **kwargs, @@ -122,4 +123,4 @@ def search_docs_hybrid( **kwargs, ) - return dbsf_fuse(text_results, embedding_results)[:k] + return dbsf_fuse(text_results, embedding_results, alpha)[:k] diff --git a/agents-api/agents_api/routers/docs/__init__.py b/agents-api/agents_api/routers/docs/__init__.py index 062db6a67..2db2d042a 100644 --- a/agents-api/agents_api/routers/docs/__init__.py +++ b/agents-api/agents_api/routers/docs/__init__.py @@ -4,3 +4,4 @@ from .get_doc import get_doc from .list_docs import list_agent_docs, list_user_docs from .router import router +from .search_docs import search_agent_docs, search_user_docs diff --git a/agents-api/agents_api/routers/docs/search_docs.py b/agents-api/agents_api/routers/docs/search_docs.py new file mode 100644 index 000000000..8de06dd17 --- /dev/null +++ b/agents-api/agents_api/routers/docs/search_docs.py @@ -0,0 +1,111 @@ +import time +from typing import Annotated + +from fastapi import Depends +from pydantic import UUID4 + +from ...autogen.openapi_model import ( + DocSearchResponse, + HybridDocSearchRequest, + TextOnlyDocSearchRequest, + VectorDocSearchRequest, +) +from ...dependencies.developer_id import get_developer_id +from ...models.docs.search_docs_by_embedding import search_docs_by_embedding +from ...models.docs.search_docs_by_text import search_docs_by_text +from ...models.docs.search_docs_hybrid import search_docs_hybrid +from .router import router + + +def get_search_fn_and_params(search_params): + search_fn, params = None, None + + match search_params: + case TextOnlyDocSearchRequest(text=query, limit=k): + search_fn = search_docs_by_text + params = dict( + query=query, + k=k, + ) + + case VectorDocSearchRequest( + vector=query_embedding, limit=k, confidence=confidence + ): + search_fn = search_docs_by_embedding + params = dict( + query_embedding=query_embedding, + k=k, + confidence=confidence, + ) + + case HybridDocSearchRequest( + text=query, + vector=query_embedding, + limit=k, + confidence=confidence, + alpha=alpha, + ): + search_fn = search_docs_hybrid + params = dict( + query=query, + query_embedding=query_embedding, + k=k, + embed_search_options=dict(confidence=confidence), + alpha=alpha, + ) + + return search_fn, params + + +@router.post("/users/{user_id}/search", tags=["docs"]) +async def search_user_docs( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + search_params: ( + TextOnlyDocSearchRequest | VectorDocSearchRequest | HybridDocSearchRequest + ), + user_id: UUID4, +) -> DocSearchResponse: + search_fn, params = get_search_fn_and_params(search_params) + + start = time.time() + docs = search_fn( + developer_id=x_developer_id, + owner_type="user", + owner_id=user_id, + **params, + ) + end = time.time() + + time_taken = end - start + + return DocSearchResponse( + docs=docs, + time=time_taken, + ) + + +@router.post("/agents/{agent_id}/search", tags=["docs"]) +async def search_agent_docs( + x_developer_id: Annotated[UUID4, Depends(get_developer_id)], + search_params: ( + TextOnlyDocSearchRequest | VectorDocSearchRequest | HybridDocSearchRequest + ), + agent_id: UUID4, +) -> DocSearchResponse: + search_fn, params = get_search_fn_and_params(search_params) + + start = time.time() + docs = search_fn( + developer_id=x_developer_id, + owner_type="agent", + owner_id=agent_id, + **params, + ) + end = time.time() + + time_taken = end - start + + return DocSearchResponse( + docs=docs, + time=time_taken, + ) diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index fbcacb597..30f156d29 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -14,9 +14,6 @@ AgentsCreateAgentRequestDefaultSettings, AgentsCreateAgentRequestInstructions, AgentsDocsSearchRouteSearchRequestBody, - AgentsDocsSearchRouteSearchRequestDirection, - AgentsDocsSearchRouteSearchRequestSortBy, - AgentsDocsSearchRouteSearchResponse, AgentsPatchAgentRequestDefaultSettings, AgentsPatchAgentRequestInstructions, AgentsRouteListRequestDirection, @@ -70,6 +67,7 @@ DocsDocOwner, DocsDocOwnerRole, DocsDocReference, + DocsDocSearchResponse, DocsEmbedQueryRequest, DocsEmbedQueryRequestText, DocsEmbedQueryResponse, @@ -210,9 +208,6 @@ UserDocsRouteListRequestSortBy, UserDocsRouteListResponse, UserDocsSearchRouteSearchRequestBody, - UserDocsSearchRouteSearchRequestDirection, - UserDocsSearchRouteSearchRequestSortBy, - UserDocsSearchRouteSearchResponse, UsersRouteListRequestDirection, UsersRouteListRequestSortBy, UsersRouteListResponse, @@ -235,9 +230,6 @@ "AgentsCreateAgentRequestDefaultSettings", "AgentsCreateAgentRequestInstructions", "AgentsDocsSearchRouteSearchRequestBody", - "AgentsDocsSearchRouteSearchRequestDirection", - "AgentsDocsSearchRouteSearchRequestSortBy", - "AgentsDocsSearchRouteSearchResponse", "AgentsPatchAgentRequestDefaultSettings", "AgentsPatchAgentRequestInstructions", "AgentsRouteListRequestDirection", @@ -291,6 +283,7 @@ "DocsDocOwner", "DocsDocOwnerRole", "DocsDocReference", + "DocsDocSearchResponse", "DocsEmbedQueryRequest", "DocsEmbedQueryRequestText", "DocsEmbedQueryResponse", @@ -432,9 +425,6 @@ "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", "UserDocsSearchRouteSearchRequestBody", - "UserDocsSearchRouteSearchRequestDirection", - "UserDocsSearchRouteSearchRequestSortBy", - "UserDocsSearchRouteSearchResponse", "UsersRouteListRequestDirection", "UsersRouteListRequestSortBy", "UsersRouteListResponse", diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index f8eb4cae5..207aa7c32 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -33,15 +33,6 @@ from .types.agents_docs_search_route_search_request_body import ( AgentsDocsSearchRouteSearchRequestBody, ) -from .types.agents_docs_search_route_search_request_direction import ( - AgentsDocsSearchRouteSearchRequestDirection, -) -from .types.agents_docs_search_route_search_request_sort_by import ( - AgentsDocsSearchRouteSearchRequestSortBy, -) -from .types.agents_docs_search_route_search_response import ( - AgentsDocsSearchRouteSearchResponse, -) from .types.agents_patch_agent_request_default_settings import ( AgentsPatchAgentRequestDefaultSettings, ) @@ -69,6 +60,7 @@ from .types.common_valid_python_identifier import CommonValidPythonIdentifier from .types.docs_create_doc_request_content import DocsCreateDocRequestContent from .types.docs_doc import DocsDoc +from .types.docs_doc_search_response import DocsDocSearchResponse from .types.docs_embed_query_request import DocsEmbedQueryRequest from .types.docs_embed_query_response import DocsEmbedQueryResponse from .types.entries_history import EntriesHistory @@ -116,15 +108,6 @@ from .types.user_docs_search_route_search_request_body import ( UserDocsSearchRouteSearchRequestBody, ) -from .types.user_docs_search_route_search_request_direction import ( - UserDocsSearchRouteSearchRequestDirection, -) -from .types.user_docs_search_route_search_request_sort_by import ( - UserDocsSearchRouteSearchRequestSortBy, -) -from .types.user_docs_search_route_search_response import ( - UserDocsSearchRouteSearchResponse, -) from .types.users_route_list_request_direction import UsersRouteListRequestDirection from .types.users_route_list_request_sort_by import UsersRouteListRequestSortBy from .types.users_route_list_response import UsersRouteListResponse @@ -842,14 +825,9 @@ def agents_docs_search_route_search( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, body: AgentsDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: + ) -> DocsDocSearchResponse: """ Search Docs owned by an Agent @@ -858,21 +836,6 @@ def agents_docs_search_route_search( id : CommonUuid ID of the parent - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field - - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - body : AgentsDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] @@ -880,7 +843,7 @@ def agents_docs_search_route_search( Returns ------- - AgentsDocsSearchRouteSearchResponse + DocsDocSearchResponse The request has succeeded. Examples @@ -894,15 +857,9 @@ def agents_docs_search_route_search( ) client.agents_docs_search_route_search( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", body=DocsVectorDocSearchRequest( + limit=1, confidence=1.1, - alpha=1.1, - mmr=True, vector=[1.1], ), ) @@ -910,20 +867,13 @@ def agents_docs_search_route_search( _response = self._client_wrapper.httpx_client.request( f"agents/{jsonable_encoder(id)}/search", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3552,14 +3502,9 @@ def user_docs_search_route_search( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UserDocsSearchRouteSearchRequestSortBy, - direction: UserDocsSearchRouteSearchRequestDirection, - metadata_filter: str, body: UserDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> UserDocsSearchRouteSearchResponse: + ) -> DocsDocSearchResponse: """ Search Docs owned by a User @@ -3568,21 +3513,6 @@ def user_docs_search_route_search( id : CommonUuid ID of the parent - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : UserDocsSearchRouteSearchRequestSortBy - Sort by a field - - direction : UserDocsSearchRouteSearchRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - body : UserDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] @@ -3590,7 +3520,7 @@ def user_docs_search_route_search( Returns ------- - UserDocsSearchRouteSearchResponse + DocsDocSearchResponse The request has succeeded. Examples @@ -3604,15 +3534,9 @@ def user_docs_search_route_search( ) client.user_docs_search_route_search( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", body=DocsVectorDocSearchRequest( + limit=1, confidence=1.1, - alpha=1.1, - mmr=True, vector=[1.1], ), ) @@ -3620,20 +3544,13 @@ def user_docs_search_route_search( _response = self._client_wrapper.httpx_client.request( f"users/{jsonable_encoder(id)}/search", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4420,14 +4337,9 @@ async def agents_docs_search_route_search( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, body: AgentsDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: + ) -> DocsDocSearchResponse: """ Search Docs owned by an Agent @@ -4436,21 +4348,6 @@ async def agents_docs_search_route_search( id : CommonUuid ID of the parent - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field - - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - body : AgentsDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] @@ -4458,7 +4355,7 @@ async def agents_docs_search_route_search( Returns ------- - AgentsDocsSearchRouteSearchResponse + DocsDocSearchResponse The request has succeeded. Examples @@ -4477,15 +4374,9 @@ async def agents_docs_search_route_search( async def main() -> None: await client.agents_docs_search_route_search( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", body=DocsVectorDocSearchRequest( + limit=1, confidence=1.1, - alpha=1.1, - mmr=True, vector=[1.1], ), ) @@ -4496,20 +4387,13 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"agents/{jsonable_encoder(id)}/search", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -7458,14 +7342,9 @@ async def user_docs_search_route_search( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UserDocsSearchRouteSearchRequestSortBy, - direction: UserDocsSearchRouteSearchRequestDirection, - metadata_filter: str, body: UserDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> UserDocsSearchRouteSearchResponse: + ) -> DocsDocSearchResponse: """ Search Docs owned by a User @@ -7474,21 +7353,6 @@ async def user_docs_search_route_search( id : CommonUuid ID of the parent - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : UserDocsSearchRouteSearchRequestSortBy - Sort by a field - - direction : UserDocsSearchRouteSearchRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - body : UserDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] @@ -7496,7 +7360,7 @@ async def user_docs_search_route_search( Returns ------- - UserDocsSearchRouteSearchResponse + DocsDocSearchResponse The request has succeeded. Examples @@ -7515,15 +7379,9 @@ async def user_docs_search_route_search( async def main() -> None: await client.user_docs_search_route_search( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", body=DocsVectorDocSearchRequest( + limit=1, confidence=1.1, - alpha=1.1, - mmr=True, vector=[1.1], ), ) @@ -7534,20 +7392,13 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"users/{jsonable_encoder(id)}/search", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDocSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index 77af661e3..c7b27f1a6 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -976,15 +976,9 @@ client = JulepApi( ) client.agents_docs_search_route_search( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", body=DocsVectorDocSearchRequest( + limit=1, confidence=1.1, - alpha=1.1, - mmr=True, vector=[1.1], ), ) @@ -1011,46 +1005,6 @@ client.agents_docs_search_route_search(
-**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- **body:** `AgentsDocsSearchRouteSearchRequestBody`
@@ -5098,15 +5052,9 @@ client = JulepApi( ) client.user_docs_search_route_search( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", body=DocsVectorDocSearchRequest( + limit=1, confidence=1.1, - alpha=1.1, - mmr=True, vector=[1.1], ), ) @@ -5133,46 +5081,6 @@ client.user_docs_search_route_search(
-**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `UserDocsSearchRouteSearchRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `UserDocsSearchRouteSearchRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- **body:** `UserDocsSearchRouteSearchRequestBody`
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 6da79d6ab..a2ab207d0 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -21,15 +21,6 @@ from .agents_docs_search_route_search_request_body import ( AgentsDocsSearchRouteSearchRequestBody, ) -from .agents_docs_search_route_search_request_direction import ( - AgentsDocsSearchRouteSearchRequestDirection, -) -from .agents_docs_search_route_search_request_sort_by import ( - AgentsDocsSearchRouteSearchRequestSortBy, -) -from .agents_docs_search_route_search_response import ( - AgentsDocsSearchRouteSearchResponse, -) from .agents_patch_agent_request_default_settings import ( AgentsPatchAgentRequestDefaultSettings, ) @@ -97,6 +88,7 @@ from .docs_doc_owner import DocsDocOwner from .docs_doc_owner_role import DocsDocOwnerRole from .docs_doc_reference import DocsDocReference +from .docs_doc_search_response import DocsDocSearchResponse from .docs_embed_query_request import DocsEmbedQueryRequest from .docs_embed_query_request_text import DocsEmbedQueryRequestText from .docs_embed_query_response import DocsEmbedQueryResponse @@ -274,13 +266,6 @@ from .user_docs_search_route_search_request_body import ( UserDocsSearchRouteSearchRequestBody, ) -from .user_docs_search_route_search_request_direction import ( - UserDocsSearchRouteSearchRequestDirection, -) -from .user_docs_search_route_search_request_sort_by import ( - UserDocsSearchRouteSearchRequestSortBy, -) -from .user_docs_search_route_search_response import UserDocsSearchRouteSearchResponse from .users_route_list_request_direction import UsersRouteListRequestDirection from .users_route_list_request_sort_by import UsersRouteListRequestSortBy from .users_route_list_response import UsersRouteListResponse @@ -301,9 +286,6 @@ "AgentsCreateAgentRequestDefaultSettings", "AgentsCreateAgentRequestInstructions", "AgentsDocsSearchRouteSearchRequestBody", - "AgentsDocsSearchRouteSearchRequestDirection", - "AgentsDocsSearchRouteSearchRequestSortBy", - "AgentsDocsSearchRouteSearchResponse", "AgentsPatchAgentRequestDefaultSettings", "AgentsPatchAgentRequestInstructions", "AgentsRouteListRequestDirection", @@ -357,6 +339,7 @@ "DocsDocOwner", "DocsDocOwnerRole", "DocsDocReference", + "DocsDocSearchResponse", "DocsEmbedQueryRequest", "DocsEmbedQueryRequestText", "DocsEmbedQueryResponse", @@ -497,9 +480,6 @@ "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", "UserDocsSearchRouteSearchRequestBody", - "UserDocsSearchRouteSearchRequestDirection", - "UserDocsSearchRouteSearchRequestSortBy", - "UserDocsSearchRouteSearchResponse", "UsersRouteListRequestDirection", "UsersRouteListRequestSortBy", "UsersRouteListResponse", diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py deleted file mode 100644 index 07c53fe78..000000000 --- a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsDocsSearchRouteSearchRequestDirection = typing.Union[ - typing.Literal["asc", "desc"], typing.Any -] diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py deleted file mode 100644 index a85bdee6c..000000000 --- a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsDocsSearchRouteSearchRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at"], typing.Any -] diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py b/sdks/python/julep/api/types/agents_docs_search_route_search_response.py deleted file mode 100644 index 400d1a51d..000000000 --- a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .docs_doc_reference import DocsDocReference - - -class AgentsDocsSearchRouteSearchResponse(pydantic_v1.BaseModel): - results: typing.List[DocsDocReference] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_base_doc_search_request.py b/sdks/python/julep/api/types/docs_base_doc_search_request.py index f7c1ecfa2..1b9646593 100644 --- a/sdks/python/julep/api/types/docs_base_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_base_doc_search_request.py @@ -8,21 +8,7 @@ class DocsBaseDocSearchRequest(pydantic_v1.BaseModel): - confidence: float = pydantic_v1.Field() - """ - The confidence cutoff level - """ - - alpha: float = pydantic_v1.Field() - """ - The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; - """ - - mmr: bool = pydantic_v1.Field() - """ - Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. - """ - + limit: int lang: typing.Literal["en-US"] = pydantic_v1.Field(default="en-US") """ The language to be used for text-only search. Support for other languages coming soon. diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_response.py b/sdks/python/julep/api/types/docs_doc_search_response.py similarity index 82% rename from sdks/python/julep/api/types/user_docs_search_route_search_response.py rename to sdks/python/julep/api/types/docs_doc_search_response.py index 9206fc909..59d26bdb9 100644 --- a/sdks/python/julep/api/types/user_docs_search_route_search_response.py +++ b/sdks/python/julep/api/types/docs_doc_search_response.py @@ -8,8 +8,16 @@ from .docs_doc_reference import DocsDocReference -class UserDocsSearchRouteSearchResponse(pydantic_v1.BaseModel): - results: typing.List[DocsDocReference] +class DocsDocSearchResponse(pydantic_v1.BaseModel): + docs: typing.List[DocsDocReference] = pydantic_v1.Field() + """ + The documents that were found + """ + + time: float = pydantic_v1.Field() + """ + The time taken to search in seconds + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py index 51de991e1..8e460c40f 100644 --- a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py @@ -9,6 +9,16 @@ class DocsHybridDocSearchRequest(DocsBaseDocSearchRequest): + confidence: float = pydantic_v1.Field() + """ + The confidence cutoff level + """ + + alpha: float = pydantic_v1.Field() + """ + The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + """ + text: str = pydantic_v1.Field() """ Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. diff --git a/sdks/python/julep/api/types/docs_vector_doc_search_request.py b/sdks/python/julep/api/types/docs_vector_doc_search_request.py index 4ea4e9632..f9c103ec6 100644 --- a/sdks/python/julep/api/types/docs_vector_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_vector_doc_search_request.py @@ -9,6 +9,11 @@ class DocsVectorDocSearchRequest(DocsBaseDocSearchRequest): + confidence: float = pydantic_v1.Field() + """ + The confidence cutoff level + """ + vector: typing.List[float] = pydantic_v1.Field() """ Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py deleted file mode 100644 index 3a2ef70a8..000000000 --- a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UserDocsSearchRouteSearchRequestDirection = typing.Union[ - typing.Literal["asc", "desc"], typing.Any -] diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py deleted file mode 100644 index 8cf9538a6..000000000 --- a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UserDocsSearchRouteSearchRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at"], typing.Any -] diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index f279f2bb9..b38e497f5 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -53,6 +53,7 @@ export type { Docs_CreateDocRequest } from "./models/Docs_CreateDocRequest"; export type { Docs_Doc } from "./models/Docs_Doc"; export type { Docs_DocOwner } from "./models/Docs_DocOwner"; export type { Docs_DocReference } from "./models/Docs_DocReference"; +export type { Docs_DocSearchResponse } from "./models/Docs_DocSearchResponse"; export type { Docs_EmbedQueryRequest } from "./models/Docs_EmbedQueryRequest"; export type { Docs_EmbedQueryResponse } from "./models/Docs_EmbedQueryResponse"; export type { Docs_HybridDocSearchRequest } from "./models/Docs_HybridDocSearchRequest"; @@ -167,6 +168,7 @@ export { $Docs_CreateDocRequest } from "./schemas/$Docs_CreateDocRequest"; export { $Docs_Doc } from "./schemas/$Docs_Doc"; export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner"; export { $Docs_DocReference } from "./schemas/$Docs_DocReference"; +export { $Docs_DocSearchResponse } from "./schemas/$Docs_DocSearchResponse"; export { $Docs_EmbedQueryRequest } from "./schemas/$Docs_EmbedQueryRequest"; export { $Docs_EmbedQueryResponse } from "./schemas/$Docs_EmbedQueryResponse"; export { $Docs_HybridDocSearchRequest } from "./schemas/$Docs_HybridDocSearchRequest"; diff --git a/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts index d99eefaf9..b6dd20f99 100644 --- a/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts @@ -3,18 +3,7 @@ /* tslint:disable */ /* eslint-disable */ export type Docs_BaseDocSearchRequest = { - /** - * The confidence cutoff level - */ - confidence: number; - /** - * The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; - */ - alpha: number; - /** - * Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. - */ - mmr: boolean; + limit: number; /** * The language to be used for text-only search. Support for other languages coming soon. */ diff --git a/sdks/ts/src/api/models/Docs_DocSearchResponse.ts b/sdks/ts/src/api/models/Docs_DocSearchResponse.ts new file mode 100644 index 000000000..cfb8ad225 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_DocSearchResponse.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Docs_DocReference } from "./Docs_DocReference"; +export type Docs_DocSearchResponse = { + /** + * The documents that were found + */ + docs: Array; + /** + * The time taken to search in seconds + */ + time: number; +}; diff --git a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts index 93b099294..a1ba32811 100644 --- a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts @@ -4,6 +4,14 @@ /* eslint-disable */ import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest"; export type Docs_HybridDocSearchRequest = Docs_BaseDocSearchRequest & { + /** + * The confidence cutoff level + */ + confidence: number; + /** + * The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + */ + alpha: number; /** * Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. */ diff --git a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts index 8839067b0..7a720c46a 100644 --- a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts @@ -4,6 +4,10 @@ /* eslint-disable */ import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest"; export type Docs_VectorDocSearchRequest = Docs_BaseDocSearchRequest & { + /** + * The confidence cutoff level + */ + confidence: number; /** * Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ diff --git a/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts index 00b992770..99188755e 100644 --- a/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts @@ -4,22 +4,12 @@ /* eslint-disable */ export const $Docs_BaseDocSearchRequest = { properties: { - confidence: { + limit: { type: "number", - description: `The confidence cutoff level`, - isRequired: true, - maximum: 1, - }, - alpha: { - type: "number", - description: `The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;`, - isRequired: true, - maximum: 1, - }, - mmr: { - type: "boolean", - description: `Whether to include the MMR algorithm in the search. Optimizes for diversity in search results.`, isRequired: true, + format: "uint16", + maximum: 100, + minimum: 1, }, lang: { type: "Enum", diff --git a/sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts b/sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts new file mode 100644 index 000000000..df2b37b48 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_DocSearchResponse.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_DocSearchResponse = { + properties: { + docs: { + type: "array", + contains: { + type: "Docs_DocReference", + }, + isRequired: true, + }, + time: { + type: "number", + description: `The time taken to search in seconds`, + isRequired: true, + exclusiveMinimum: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts index 14948c59a..2bc5005fb 100644 --- a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts @@ -10,6 +10,18 @@ export const $Docs_HybridDocSearchRequest = { }, { properties: { + confidence: { + type: "number", + description: `The confidence cutoff level`, + isRequired: true, + maximum: 1, + }, + alpha: { + type: "number", + description: `The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;`, + isRequired: true, + maximum: 1, + }, text: { type: "string", description: `Text to use in the search. In \`hybrid\` search mode, either \`text\` or both \`text\` and \`vector\` fields are required.`, diff --git a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts index 54ba49bf5..af6de0b12 100644 --- a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts @@ -10,6 +10,12 @@ export const $Docs_VectorDocSearchRequest = { }, { properties: { + confidence: { + type: "number", + description: `The confidence cutoff level`, + isRequired: true, + maximum: 1, + }, vector: { type: "array", contains: { diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index c25ff685a..c71a6d7e9 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -20,7 +20,7 @@ import type { Common_ResourceUpdatedResponse } from "../models/Common_ResourceUp import type { Common_uuid } from "../models/Common_uuid"; import type { Docs_CreateDocRequest } from "../models/Docs_CreateDocRequest"; import type { Docs_Doc } from "../models/Docs_Doc"; -import type { Docs_DocReference } from "../models/Docs_DocReference"; +import type { Docs_DocSearchResponse } from "../models/Docs_DocSearchResponse"; import type { Docs_EmbedQueryRequest } from "../models/Docs_EmbedQueryRequest"; import type { Docs_EmbedQueryResponse } from "../models/Docs_EmbedQueryResponse"; import type { Docs_HybridDocSearchRequest } from "../models/Docs_HybridDocSearchRequest"; @@ -315,17 +315,12 @@ export class DefaultService { } /** * Search Docs owned by an Agent - * @returns any The request has succeeded. + * @returns Docs_DocSearchResponse The request has succeeded. * @throws ApiError */ public agentsDocsSearchRouteSearch({ id, requestBody, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", }: { /** * ID of the parent @@ -337,42 +332,13 @@ export class DefaultService { | Docs_TextOnlyDocSearchRequest | Docs_HybridDocSearchRequest; }; - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/agents/{id}/search", path: { id: id, }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, body: requestBody, mediaType: "application/json", }); @@ -1758,17 +1724,12 @@ export class DefaultService { } /** * Search Docs owned by a User - * @returns any The request has succeeded. + * @returns Docs_DocSearchResponse The request has succeeded. * @throws ApiError */ public userDocsSearchRouteSearch({ id, requestBody, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", }: { /** * ID of the parent @@ -1780,42 +1741,13 @@ export class DefaultService { | Docs_TextOnlyDocSearchRequest | Docs_HybridDocSearchRequest; }; - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/users/{id}/search", path: { id: id, }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, body: requestBody, mediaType: "application/json", }); diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp index a493f9b86..143d18f33 100644 --- a/typespec/docs/endpoints.tsp +++ b/typespec/docs/endpoints.tsp @@ -37,11 +37,8 @@ interface SearchEndpoints pure BM25; 1 => pure vector; */ - @minValue(0) - @maxValue(1) - alpha: float = 0.75; - - /** Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. */ - mmr: boolean = false; + @minValue(1) + @maxValue(100) + limit: uint16 = 10; /** The language to be used for text-only search. Support for other languages coming soon. */ lang: "en-US" = "en-US"; } model VectorDocSearchRequest extends BaseDocSearchRequest { + /** The confidence cutoff level */ + @minValue(0) + @maxValue(1) + confidence: float = 0.5; + /** Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ vector: float[]; @@ -98,6 +94,16 @@ model TextOnlyDocSearchRequest extends BaseDocSearchRequest { } model HybridDocSearchRequest extends BaseDocSearchRequest { + /** The confidence cutoff level */ + @minValue(0) + @maxValue(1) + confidence: float = 0.5; + + /** The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; */ + @minValue(0) + @maxValue(1) + alpha: float = 0.75; + /** Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. */ text: string;