mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 16:26:02 +00:00
refactor: move entities
This commit is contained in:
35
pkg/api/http/service/model.py
Normal file
35
pkg/api/http/service/model.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
from ....core import app
|
||||
from ....entity.persistence import model
|
||||
|
||||
|
||||
class ModelsService:
|
||||
|
||||
ap: app.Application
|
||||
|
||||
def __init__(self, ap: app.Application) -> None:
|
||||
self.ap = ap
|
||||
|
||||
async def get_llm_models(self) -> list[model.LLMModel]:
|
||||
result = await self.ap.persistence_mgr.execute_async(
|
||||
sqlalchemy.select(model.LLMModel)
|
||||
)
|
||||
|
||||
result_list = result.all()
|
||||
|
||||
return result_list
|
||||
|
||||
async def create_llm_model(self, model: model.LLMModel) -> None:
|
||||
pass
|
||||
|
||||
async def get_llm_model(self, model_uuid: str) -> model.LLMModel:
|
||||
pass
|
||||
|
||||
async def update_llm_model(self, model: model.LLMModel) -> None:
|
||||
pass
|
||||
|
||||
async def delete_llm_model(self, model_uuid: str) -> None:
|
||||
pass
|
||||
@@ -6,7 +6,7 @@ import jwt
|
||||
import datetime
|
||||
|
||||
from ....core import app
|
||||
from ....persistence.entities import user
|
||||
from ....entity.persistence import user
|
||||
from ....utils import constants
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user