- shared/config.py: add LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY, LANGFUSE_HOST - services/chat/app/tracing.py: new module — Langfuse client singleton, create_trace(), get_langfuse_callback(), get_prompt(), link_prompt_to_trace(), score_trace(), flush/shutdown helpers. Gracefully no-ops when keys are missing. - services/chat/app/llm.py: add callbacks param to get_llm() for LangChain callback handler injection - services/chat/app/deep_agent.py: accept langfuse_handler in all run_* and _run_single_agent* functions, pipe callbacks to LLM calls, fetch managed prompts from Langfuse with fallback to hardcoded system prompts - services/chat/app/redis_consumer.py: create Langfuse trace per request (home_request/floating_request), pass callback handler to deep_agent, link prompt name to trace, attach output preview, flush after each request - services/chat/app/main.py: shutdown Langfuse client in lifespan teardown - services/chat/requirements.txt: add langfuse>=2.0.0 Langfuse prompt names: 'home_system', 'floating_system' — create these in the Langfuse dashboard to manage prompts. Without them, hardcoded defaults are used transparently.
18 lines
323 B
Plaintext
18 lines
323 B
Plaintext
fastapi>=0.115.0
|
|
uvicorn[standard]>=0.34.0
|
|
gunicorn>=22.0.0
|
|
pydantic>=2.10.0
|
|
pydantic-settings>=2.7.0
|
|
sqlalchemy>=2.0.0
|
|
asyncpg>=0.30.0
|
|
redis>=5.0.0
|
|
cryptography>=42.0.0
|
|
python-dotenv>=1.0.0
|
|
langchain-core>=0.3.0
|
|
langchain-openai>=0.3.0
|
|
langchain-litellm>=0.3.0
|
|
litellm>=1.50.0
|
|
openai>=1.50.0
|
|
httpx>=0.27.0
|
|
langfuse>=2.0.0
|