恢复GE版本为0.18,生成SNIPPET后自动生成rag_text流程

This commit is contained in:
zhaoawd
2025-12-10 00:20:14 +08:00
parent 248492d68e
commit daf951d81f
6 changed files with 100 additions and 13 deletions

View File

@ -24,7 +24,6 @@ from app.services import LLMGateway
from app.settings import DEFAULT_IMPORT_MODEL
from app.services.import_analysis import (
IMPORT_GATEWAY_BASE_URL,
build_import_gateway_headers,
resolve_provider_from_model,
)
from app.utils.llm_usage import extract_usage as extract_llm_usage
@ -533,7 +532,6 @@ async def _call_chat_completions(
temperature: float = 0.2,
timeout_seconds: Optional[float] = None,
) -> Any:
# Normalize model spec to provider+model and issue the unified chat call.
provider, model_name = resolve_provider_from_model(model_spec)
payload = {
"provider": provider.value,
@ -547,17 +545,16 @@ async def _call_chat_completions(
payload_size_bytes = len(json.dumps(payload, ensure_ascii=False).encode("utf-8"))
url = f"{IMPORT_GATEWAY_BASE_URL.rstrip('/')}/v1/chat/completions"
headers = build_import_gateway_headers()
try:
# log the request whole info
logger.info(
"Calling chat completions API %s with model=%s payload_size=%sB",
"Calling chat completions API %s with model %s and size %s and payload %s",
url,
model_name,
payload_size_bytes,
payload,
)
response = await client.post(
url, json=payload, timeout=timeout_seconds, headers=headers
)
response = await client.post(url, json=payload, timeout=timeout_seconds)
response.raise_for_status()
except httpx.HTTPError as exc:
@ -706,7 +703,6 @@ async def _run_action_with_callback(
input_payload: Any = None,
model_spec: Optional[str] = None,
) -> Any:
# Execute a pipeline action and always emit a callback capturing success/failure.
if input_payload is not None:
logger.info(
"Pipeline action %s input: %s",
@ -789,6 +785,8 @@ async def process_table_profiling_job(
"table_schema_version_id": request.table_schema_version_id,
"llm_model": request.llm_model,
"llm_timeout_seconds": timeout_seconds,
"workspace_id": request.workspace_id,
"rag_item_type": request.rag_item_type,
}
logging_request_payload = _profiling_request_for_log(request)