remove List imports

This commit is contained in:
Michael Poluektov
2024-08-14 13:46:31 +01:00
parent 038fc48ac0
commit 29f904db45
38 changed files with 124 additions and 124 deletions

View File

@@ -1,5 +1,5 @@
from pydantic import BaseModel, ConfigDict
from typing import List, Optional
from typing import Optional
import time
import logging
from sqlalchemy import String, Column, BigInteger, Text
@@ -45,7 +45,7 @@ class ToolModel(BaseModel):
user_id: str
name: str
content: str
specs: List[dict]
specs: list[dict]
meta: ToolMeta
updated_at: int # timestamp in epoch
created_at: int # timestamp in epoch
@@ -81,7 +81,7 @@ class ToolValves(BaseModel):
class ToolsTable:
def insert_new_tool(
self, user_id: str, form_data: ToolForm, specs: List[dict]
self, user_id: str, form_data: ToolForm, specs: list[dict]
) -> Optional[ToolModel]:
with get_db() as db:
@@ -118,7 +118,7 @@ class ToolsTable:
except Exception:
return None
def get_tools(self) -> List[ToolModel]:
def get_tools(self) -> list[ToolModel]:
with get_db() as db:
return [ToolModel.model_validate(tool) for tool in db.query(Tool).all()]