mirror of
https://github.com/hoshikawa2/compass_backoffice.git
synced 2026-07-09 22:04:20 +00:00
bugfixes
This commit is contained in:
@@ -71,7 +71,7 @@ class _SettingsProxy:
|
||||
# OpenAI-compatible implementation.
|
||||
if self.LLM_PROVIDER == "oci":
|
||||
self.LLM_PROVIDER = "oci_openai"
|
||||
self.OCI_GENAI_MODEL = str(llm.eligibleModel_name)
|
||||
self.OCI_GENAI_MODEL = _framework_model_name(llm.eligibleModel_name)
|
||||
self.LLM_TEMPERATURE = float(llm.temperature)
|
||||
self.LLM_MAX_TOKENS = int(llm.max_tokens)
|
||||
|
||||
@@ -81,8 +81,24 @@ class _SettingsProxy:
|
||||
|
||||
LLM_ENDPOINT: str = getattr(fw_settings, "OCI_GENAI_BASE_URL", "")
|
||||
|
||||
|
||||
def _framework_model_name(candidate: str | None = None) -> str:
|
||||
"""Resolve any legacy backoffice model alias to the framework model.
|
||||
|
||||
Old develop configs used internal model aliases. In the migrated project those aliases must never be sent to OCI/OpenAI directly.
|
||||
"""
|
||||
model = str(candidate or "").strip()
|
||||
if not model or model.startswith("bo_") or "gptoss" in model.lower():
|
||||
model = (
|
||||
getattr(fw_settings, "OCI_GENAI_MODEL", None)
|
||||
or getattr(fw_settings, "LLM_MODEL", None)
|
||||
or getattr(settings, "LLM_MODEL", None)
|
||||
or "openai.gpt-4.1"
|
||||
)
|
||||
return str(model)
|
||||
|
||||
classification_llm = BackofficeLLMDescriptor(
|
||||
eligibleModel_name=settings.CLASSIFICATION_LLM_MODEL,
|
||||
eligibleModel_name=_framework_model_name(settings.CLASSIFICATION_LLM_MODEL),
|
||||
temperature=settings.CLASSIFICATION_LLM_TEMPERATURE,
|
||||
max_tokens=settings.CLASSIFICATION_LLM_MAX_TOKENS,
|
||||
top_p=settings.CLASSIFICATION_LLM_TOP_P,
|
||||
@@ -90,7 +106,7 @@ classification_llm = BackofficeLLMDescriptor(
|
||||
)
|
||||
|
||||
classification_large_llm = BackofficeLLMDescriptor(
|
||||
eligibleModel_name=settings.CLASSIFICATION_LARGE_LLM_MODEL,
|
||||
eligibleModel_name=_framework_model_name(settings.CLASSIFICATION_LARGE_LLM_MODEL),
|
||||
temperature=settings.CLASSIFICATION_LARGE_LLM_TEMPERATURE,
|
||||
max_tokens=settings.CLASSIFICATION_LARGE_LLM_MAX_TOKENS,
|
||||
top_p=settings.CLASSIFICATION_LARGE_LLM_TOP_P,
|
||||
@@ -98,7 +114,7 @@ classification_large_llm = BackofficeLLMDescriptor(
|
||||
)
|
||||
|
||||
tais_kb_llm = BackofficeLLMDescriptor(
|
||||
eligibleModel_name=settings.TAIS_KB_LLM_MODEL,
|
||||
eligibleModel_name=_framework_model_name(settings.TAIS_KB_LLM_MODEL),
|
||||
temperature=settings.TAIS_KB_LLM_TEMPERATURE,
|
||||
max_tokens=settings.TAIS_KB_LLM_MAX_TOKENS,
|
||||
top_p=settings.TAIS_KB_LLM_TOP_P,
|
||||
|
||||
Reference in New Issue
Block a user