diff --git a/agents-api/agents_api/models/tools/__init__.py b/agents-api/agents_api/queries/tools/__init__.py similarity index 100% rename from agents-api/agents_api/models/tools/__init__.py rename to agents-api/agents_api/queries/tools/__init__.py diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/queries/tools/create_tools.py similarity index 89% rename from agents-api/agents_api/models/tools/create_tools.py rename to agents-api/agents_api/queries/tools/create_tools.py index 578a1268d..0d2e0984c 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/queries/tools/create_tools.py @@ -1,18 +1,18 @@ """This module contains functions for creating tools in the CozoDB database.""" +import sqlvalidator from typing import Any, TypeVar from uuid import UUID from beartype import beartype from fastapi import HTTPException -from pycozo.client import QueryException from pydantic import ValidationError from uuid_extensions import uuid7 from ...autogen.openapi_model import CreateToolRequest, Tool from ...metrics.counters import increase_counter from ..utils import ( - cozo_query, + pg_query, partialclass, rewrap_exceptions, verify_developer_id_query, @@ -24,14 +24,13 @@ T = TypeVar("T") -@rewrap_exceptions( - { - QueryException: partialclass(HTTPException, status_code=400), - ValidationError: partialclass(HTTPException, status_code=400), - TypeError: partialclass(HTTPException, status_code=400), - AssertionError: partialclass(HTTPException, status_code=400), - } -) +# @rewrap_exceptions( +# { +# ValidationError: partialclass(HTTPException, status_code=400), +# TypeError: partialclass(HTTPException, status_code=400), +# AssertionError: partialclass(HTTPException, status_code=400), +# } +# ) @wrap_in_class( Tool, transform=lambda d: { @@ -41,7 +40,7 @@ }, _kind="inserted", ) -@cozo_query +@pg_query @increase_counter("create_tools") @beartype def create_tools( diff --git a/agents-api/agents_api/models/tools/delete_tool.py b/agents-api/agents_api/queries/tools/delete_tool.py similarity index 100% rename from agents-api/agents_api/models/tools/delete_tool.py rename to agents-api/agents_api/queries/tools/delete_tool.py diff --git a/agents-api/agents_api/models/tools/get_tool.py b/agents-api/agents_api/queries/tools/get_tool.py similarity index 100% rename from agents-api/agents_api/models/tools/get_tool.py rename to agents-api/agents_api/queries/tools/get_tool.py diff --git a/agents-api/agents_api/models/tools/get_tool_args_from_metadata.py b/agents-api/agents_api/queries/tools/get_tool_args_from_metadata.py similarity index 100% rename from agents-api/agents_api/models/tools/get_tool_args_from_metadata.py rename to agents-api/agents_api/queries/tools/get_tool_args_from_metadata.py diff --git a/agents-api/agents_api/models/tools/list_tools.py b/agents-api/agents_api/queries/tools/list_tools.py similarity index 100% rename from agents-api/agents_api/models/tools/list_tools.py rename to agents-api/agents_api/queries/tools/list_tools.py diff --git a/agents-api/agents_api/models/tools/patch_tool.py b/agents-api/agents_api/queries/tools/patch_tool.py similarity index 100% rename from agents-api/agents_api/models/tools/patch_tool.py rename to agents-api/agents_api/queries/tools/patch_tool.py diff --git a/agents-api/agents_api/models/tools/update_tool.py b/agents-api/agents_api/queries/tools/update_tool.py similarity index 100% rename from agents-api/agents_api/models/tools/update_tool.py rename to agents-api/agents_api/queries/tools/update_tool.py