- prompts/collection.md: versioned collection system prompt extracted from workflow node yQaBxfrWjbRr with source/version/porting notes - llm.py: LLMService protocol; FakeLLMService (scripted, records calls); OpenAILLMService (async, wait_for timeout with cancellation, retry only on timeout/429/connection, errors normalized) - collect.py: run_collect reference impl - one LLM call produces state prefix + body, controlled repair (max 1 retry) for missing prefix or illegal stage proposal, whitelist guard, CollectReplyError without raw model content; dialogue history + confirmed fields injected into prompt so the model skips known info (作业4-5) - fields.py / clock.py: three-state field candidates (unknown/ candidate/confirmed), per-type validation (count not inferred from description, future time rejected), injectable Clock - graph.py: welcome node - first message returns fixed 1001 greeting without LLM (mirrors workflow is_first_message -> Assigned Reply#3), route empty stage to welcome - endpoints/delete_session: backend switch - langgraph clears graph checkpoint, fastgpt path unchanged - config: AGENT_LLM_PROVIDER fake|openai with validation - untrack .env (secrets), move template to root .env.example Verified: - pytest 103 passed; smoke turns 1/2/1 - Real LLM e2e: POST /chat multi-turn context works - Golden eval collection_skip_known_info: 12/12 cases pass - Golden eval no_false: 8/10 cases pass; 4 confirm/photo cases fail at final step - model routes on short reply '对' (prompt-adherence gap, photo/confirm stages are assignment 5 scope); recorded in evals/results/20261020-144856 Known limits: field extraction from model reply not wired (stub); photo/confirm nodes still scaffold; clarify counting is approximate.
20 lines
571 B
Bash
20 lines
571 B
Bash
DATABASE_URL=sqlite:///./test.db
|
|
SECRET_KEY=your_secret_key
|
|
DEBUG=True
|
|
|
|
ANALYSIS_SERVICE_URL=http://127.0.0.1:3030
|
|
ANALYSIS_AUTH_TOKEN=replace-with-fastgpt-api-key
|
|
APP_ID=replace-with-fastgpt-app-id
|
|
|
|
# Voice demo (Pipecat /ws-product). Relative to project root, or an absolute path.
|
|
VOICE_CONFIG=config/voice.json
|
|
|
|
# LangGraph chat backend + LLM provider (作业 2/4)
|
|
# AGENT_BACKEND=langgraph
|
|
# AGENT_LLM_PROVIDER=openai
|
|
# LLM_BASE_URL=https://api.openai.com/v1
|
|
# LLM_API_KEY=replace-with-llm-api-key
|
|
# LLM_MODEL=gpt-4o-mini
|
|
# LLM_TIMEOUT_SECONDS=30
|
|
# LLM_MAX_RETRIES=2
|