统一声明:
1.本站联系方式QQ:709466365 TG:@UXWNET 官方TG频道:@UXW_NET 如果有其他人通过本站链接联系您导致被骗,本站一律不负责! 2.需要付费搭建请联系站长QQ:709466365 TG:@UXWNET 3.免实名域名注册购买- 游侠云域名 4.免实名国外服务器购买- 游侠网云服务Search Powered by Algolia Search Log in Create account DEV Community Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More… Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via… Report Abuse kanta13jp1 Posted on Apr 28
When you decide to build an AI agent, the first question is “what do I use?” I’ve run all three in production. Here’s the honest breakdown.
Dify: No-code/low-code / prototypes / non-engineer teams LangChain: Python / complex chains / OSS ecosystem needed Raw API: Production / full control / Flutter + Supabase integration Enter fullscreen mode Exit fullscreen mode My project landed on raw API (Anthropic SDK + Deno Edge Function).
# Dify workflow design view [Input] → [LLM Node] → [Condition Branch] → [Tool Node] → [Output] Enter fullscreen mode Exit fullscreen mode Dify lets you build flows in a GUI. Its biggest strength: working prototype in 3 days.
✅ Use Dify when: – Non-engineers need to edit workflows – You want to test a RAG pipeline fast – You don’t want to manage hosting/infra ❌ Not Dify when: – You need tight integration with existing code – Custom logic is complex – Dify’s execution cost is climbing Enter fullscreen mode Exit fullscreen mode When LangChain Wins from langchain.agents import initialize_agent, Tool from langchain.chat_models import ChatAnthropic tools = [ Tool(name=”search”, func=search_fn, description=”Web search”), Tool(name=”calculator”, func=calc_fn, description=”Math”), ] agent = initialize_agent(tools, ChatAnthropic(model=”claude-haiku-4-5″), …) result = agent.run(“What’s the weather in Tokyo today?”) Enter fullscreen mode Exit fullscreen mode LangChain’s Python ecosystem is powerful. Rich integrations for Vector Store / Retriever / Memory.
✅ Use LangChain when: – Building a serious RAG pipeline – Need to swap between multiple LLMs – Python-based data pipelines already exist ❌ Not LangChain when: – Flutter/Dart/Deno is your main stack — bindings are thin – Simple API calls — overhead is disproportionate Enter fullscreen mode Exit fullscreen mode When Raw API Wins (My Choice) // Deno Edge Function implementation const response = await fetch(‘https://api.anthropic.com/v1/messages’, { method: ‘POST’, headers: { ‘x-api-key’: Deno.env.get(‘ANTHROPIC_API_KEY’)!, ‘anthropic-version’: ‘2023-06-01’, ‘content-type’: ‘application/json’, }, body: JSON.stringify({ model: ‘claude-haiku-4-5-20251001’, max_tokens: 1024, messages: [{ role: ‘user’, content: userMessage }], }), }); const data = await response.json(); return data.content[0].text; Enter fullscreen mode Exit fullscreen mode Why I chose raw API:
Want to build an AI agent? ↓ Non-engineers editing workflows? Yes → Dify No ↓ Python is your main stack? Yes → LangChain No ↓ Tight integration with existing stack needed? Yes → Raw API No → Dify (as prototype) Enter fullscreen mode Exit fullscreen mode Tool Use (Function Calling) Pattern Using Tool Use with raw API:
const tools = [ { name: “get_race_data”, description: “Fetch horse racing data”, input_schema: { type: “object”, properties: { race_id: { type: “string”, description: “Race ID” }, date: { type: “string”, description: “Date in YYYY-MM-DD” }, }, required: [“race_id”], }, }, ]; const response = await fetch(‘https://api.anthropic.com/v1/messages’, { method: ‘POST’, headers: { ‘x-api-key’: API_KEY, ‘anthropic-version’: ‘2023-06-01’, ‘content-type’: ‘application/json’ }, body: JSON.stringify({ model: ‘claude-sonnet-4-6’, max_tokens: 2048, tools, messages: [{ role: ‘user’, content: ‘Predict tomorrow\’s Nakayama races’ }], }), }); Enter fullscreen mode Exit fullscreen mode When Claude decides it should call get_race_data, it returns a tool_use block. Your code handles the dispatch.
function selectModel(taskType: string): string { switch (taskType) { case ‘simple_qa’: return ‘claude-haiku-4-5-20251001’; // $0.00025/1K case ‘analysis’: return ‘claude-sonnet-4-6’; // $0.003/
🔗 原文链接:点击查看原文全文
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
8. 精力有限,不少源码未能详细测试(解密),不能分辨部分源码是病毒还是误报,所以没有进行任何修改,大家使用前请进行甄别!
站长QQ:709466365 站长邮箱:709466365@qq.com



