[fix] solution/backend: 키 미설정 문구가 엉뚱한 공급자를 가리키던 것
공급자를 openai 로 바꾼 뒤에도 호출측에 "GEMINI_API_KEY 미설정" 이 문자열로 박혀 있어서, **없는 것은 OPENAI_API_KEY 인데 화면은 Gemini 를 탓했다** (실측 2026-09-21: 로컬에서 소개문이 안 나와 Gemini 키를 한참 들여다봤다). 원인을 정확히 반대로 가리키는 종류다. - llm/provider: missing_key() 추가 — 활성 공급자에게 필요한 env 이름을 돌려준다 - copy_service·collect_service·song_service: 하드코딩 문구를 그 함수로 교체 - enums: GENERATOR_NOT_CONFIGURED 주석도 공급자 중립으로 관련 테스트 55 passed Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b1a34ba58d
commit
4dd0c604ee
5 files changed
+18
-5
No files matched your search
@@ -2,6 +2,7 @@
|
||||
from common.logger import LOG
|
||||
from services.copy_steps import CopyAborted, prepare_copy, generate_copy, save_copy, fill_faqs
|
||||
from services.external import gemini_text
|
||||
from services.llm import provider
|
||||
from services.job_progress import JobProgress
|
||||
|
||||
COPY_STEPS = ("prepare", "generate", "save", "faq_fill")
|
||||
@@ -16,7 +17,7 @@ async def run_copy(job: dict) -> dict:
|
||||
copy = None
|
||||
note = None
|
||||
if inputs.ungrounded or not gemini_text.is_configured():
|
||||
note = "근거로 쓸 확인된 fact 가 없다" if inputs.ungrounded else "GEMINI_API_KEY 미설정"
|
||||
note = "근거로 쓸 확인된 fact 가 없다" if inputs.ungrounded else f"{provider.missing_key()} 미설정"
|
||||
await progress.skip("generate", "no_facts" if inputs.ungrounded else "not_configured")
|
||||
if inputs.catalog is None and not inputs.ungrounded:
|
||||
raise CopyAborted(note)
|
||||
|
||||
Reference in new issue
Block a user