mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-27 04:37:13 +00:00
2.1 KiB
2.1 KiB
Dify AgentRunner
Use this reference when validating langbot-team/DifyAgent through LangBot WebUI.
Prepare Dify
- Use a Dify Service API key from the target Dify app. Do not print the key in reports.
- For Dify Agent Chat apps, configure LangBot
app-typeasagent. - Dify Agent Chat Service API may reject direct
blockingmode withAgent Chat App does not support blocking mode; use streaming for direct diagnostics.
LangBot Configuration
- Open
LANGBOT_FRONTEND_URL. - Navigate to
Pipelinesand open the target pipeline. - Open
Configuration > AI. - Select runner
Dify. - Configure:
Base URL: usuallyhttps://api.dify.ai/v1App Type:Agentfor Dify Agent Chat appsAPI Key: Dify Service API keyBase Prompt: short neutral prompt unless the case needs a specific promptTimeout: at least60when testing through proxies
- Save before using Debug Chat.
Debug Chat Check
Send a prompt with a unique sentinel:
Reply exactly with LANGBOT_DIFY_<date_or_random> and nothing else.
Pass only when:
- UI shows a
Botmessage containing the sentinel. - WebSocket history or DOM inspection confirms the sentinel is in an assistant/bot message, not only in the user message.
- Backend logs show the request completed, for example
HTTP Request: POST https://api.dify.ai/v1/chat-messages "HTTP/1.1 200 OK"andConversation(0) Streaming completed.
Diagnostics
GET /api/v1/pipelines/{uuid}can confirm the saved runner id isplugin:langbot-team/DifyAgent/defaultand runner config containsapp-type,base-url, andapi-key.- Direct Dify streaming API calls are useful only to distinguish invalid Dify credentials from LangBot runner issues.
- If Debug Chat returns
Agent runner execution failed, inspect backend logs before changing UI settings.
Known Failure Signatures
AttributeError: 'ActorContext' object has no attribute 'type': runner code is reading old actor fields; see troubleshootingagent-runner-actor-context-fields.- Multiple runner options display as
默认: component labels are ambiguous; see troubleshootingambiguous-runner-default-label.