refac: re-use utils.misc

This commit is contained in:
Michael Poluektov committed 2024-08-06 11:31:45 +01:00
1 parent 44c781f414
commit fc31267a54
4 files changed
+85 -229

No files matched your search

+5 -2
View File
@@ -17,7 +17,10 @@ from utils.utils import (
get_verified_user,
get_admin_user,
)
from utils.misc import apply_model_params_to_body, apply_model_system_prompt_to_body
from utils.misc import (
apply_model_params_to_body_openai,
apply_model_system_prompt_to_body,
)
from config import (
SRC_LOG_LEVELS,
@@ -366,7 +369,7 @@ async def generate_chat_completion(
payload["model"] = model_info.base_model_id
params = model_info.params.model_dump()
payload = apply_model_params_to_body(params, payload)
payload = apply_model_params_to_body_openai(params, payload)
payload = apply_model_system_prompt_to_body(params, payload, user)
model = app.state.MODELS[payload.get("model")]