当前位置:   article > 正文

dify_004

dify_004

总结

  • LangChain是一个工具箱(toolboxes)、Dify是脚手架(scaffold)
  • Dify的意思是define加modify
  • 部署dify作为llm网关
  • dify提供大模型接口、Web应用模板、一堆API;
  • 开场白的英文是opening remarks;
  • 统计数据:消息、用户、交互、响应时间、满意度、令牌;

Quickstart

In Dify, an "application" refers to a real-world scenario application built on large language models such as GPT.

By creating an application, you can apply intelligent AI technology to specific needs.

It encompasses both the engineering paradigms for developing AI applications and the specific deliverables.

在Dify中,"应用"指的是基于大型语言模型(如GPT)构建的现实场景应用

通过创建应用,您可以将智能AI技术应用于特定需求

涵盖了开发AI应用的工程范式具体交付成果

In short, an application delivers to developers:

  • A user-friendly, encapsulated LLM API that can be called directly by backend or frontend applications with token authentication
  • A ready-to-use, beautiful, and hosted Web App that you can develop further using the Web App templates
  • A set of easy-to-use interfaces for Prompt Engineering, context management, log analysis, and annotation

You can choose one or all of them to support your AI application development.

简而言之,一个应用向开发者提供:

  • 一个用户友好封装的LLM API,可以通过token身份验证直接被后端前端应用调用。
  • 一个现成、美观且托管的Web App,您可以使用Web App模板进一步开发。
  • 一组用于Prompt工程上下文管理日志分析注释易于使用的接口

您可以选择其中一个或全部来支持您的AI应用开发

大模型API
web应用模板
一堆接口
  • 1
  • 2
  • 3

Application Types

Dify offers two types of applications: text generation and conversational.

Dify提供两种类型的应用程序:文本生成对话

More application paradigms may appear in the future (we should keep up-to-date), and the ultimate goal of Dify is to cover more than 80% of typical LLM application scenarios.

未来可能会出现更多的应用程序范式(我们应该保持最新),而Dify的终极目标是覆盖超过80%的典型LLM应用场景

The differences between text generation and conversational applications are shown in the table below:

文本生成对话应用程序之间的区别如下表所示:

Text GeneratorChat App
WebApp Interface
WebApp界面
Form + Results
表单 + 结果
Chat style
聊天风格
API Endpoint
API端点
completion-messages
完成消息
chat-messages
聊天消息
Interaction Mode
交互模式
One question and one answer
一个问题和一个答案
Multi-turn dialogue
多轮对话
Streaming results return
流式结果返回
Supported
支持
Supported
支持
Context Preservation
上下文保留
Current time
当前时间
Continuous
连续的
User input form
用户输入表单
Supported
支持
Supported
支持
Knowledge&Plugins
知识和插件
Supported
支持
Supported
支持
AI opening remarks
AI开场白
Not supported
不支持
Supported
支持
Scenario example
场景示例
Translation, judgment, indexing
翻译、判断、索引
Chat or everything
聊天或一切

Steps to Create an Application

创建应用程序的步骤

After logging in as an administrator in Dify, go to the main navigation application page Click “Create New Application” Choose a conversational or text generation application and give it a name (modifiable later)

登录Dify作为管理员后,转到主导航应用页面

点击“创建新应用程序”,选择一个对话文本生成应用程序,并为其指定一个名称(稍后可修改)。

image-20240527235430225

We provide some templates in the application creation interface, and you can click to create from a template in the popup when creating an application.

These templates will provide inspiration and reference for the application you want to develop.

我们在应用程序创建界面中提供了一些模板,您可以在创建应用程序时点击弹出窗口中的模板来创建。

这些模板将为您要开发的应用程序提供灵感参考

Creating from a Configuration File

If you have obtained a template from the community or someone else, you can click to create from an application configuration file.

Uploading the file will load most of the settings from the other party's application (but not the knowledge at present).

如果您从社区或其他人那里获取了一个模板,您可以点击从应用配置文件创建。

上传文件将从对方的应用程序中加载大部分设置(当前不包括知识)。

Your Application

If you are using it for the first time, you will be prompted to enter your OpenAI API key.

A properly functioning LLM key is a prerequisite for using Dify.

If you don’t have one yet, please apply for one.

如果你首次使用,系统会提示你输入你的OpenAI API密钥

一个正常工作的LLM密钥是使用Dify的先决条件

如果你还没有一个,请申请一个。

After creating an application or selecting an existing one, you will arrive at an application overview page showing the application's profile.

创建一个应用程序或选择现有的应用程序之后,您将进入一个显示应用程序概况的页面。

You can directly access your WebApp or check the API status here, as well as enable or disable them.

您可以在这里直接访问您的WebApp或检查API状态,并且还可以启用或禁用它们。

Statistics show the usage, active user count, and LLM call consumption of the application over a period of time—enabling you to continually improve the cost-effectiveness of application operations.

统计数据显示了应用程序在一段时间内的使用情况、活跃用户数量以及LLM调用的消耗—使您能够持续改进应用程序运作的成本效益

We will gradually provide more useful visualization capabilities; please let us know what you want.

我们会逐步提供更多有用的可视化功能;请告诉我们您需要什么。

  • Total Messages: Daily AI interactions count; prompt engineering/debugging excluded.

    • 总消息数:每天的 AI 交互次数;排除提示工程/调试
  • Active Users: Unique users engaging in Q&A with AI; prompt engineering/debugging excluded.

    • 活跃用户数:与AI进行问答的独立用户数;排除提示工程/调试
  • Avg. Session Interactions: Continuous user-AI communication count; for conversation-based apps.

    • 平均会话交互数:针对基于对话的应用,用户与AI之间的连续交流次数。
  • User Satisfaction Rate: Likes per 1,000 messages; indicates satisfaction with AI answers.

    • 用户满意度比率:每1,000条消息的点赞数;表明对AI答复的满意程度。
  • Avg. Response Time: Time (ms) for AI to process/respond; for text-based apps.

    • 平均响应时间:AI处理/响应的时间(毫秒);针对基于文本的应用。
  • Token Usage: Daily language model token usage; for cost control.

    • 令牌使用量:每天的语言模型令牌使用量;用于成本控制

What’s Next

  • Try your WebApp

  • Take a tour of the Configuration, Development, and Logs pages on the left

  • Try configuring an application using a reference case

  • If you have the ability to develop frontend applications, please consult the API documentation

  • 尝试您的WebApp

  • 在左侧浏览配置开发日志页面

  • 尝试使用参考案例配置一个应用程序

  • 如果您有开发前端应用程序能力,请参阅API文档

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/941326
推荐阅读
相关标签
  

闽ICP备14008679号