Edit profile of the pluginPlugin name (press Enter to next step): hello-worldAuthor (press Enter to next step): langgeniusDescription (press Enter to next step): hello world exampleRepository URL (Optional) (press Enter to next step): Repository URL (Optional) Enable multilingual README: [✔] English is required by defaultLanguages to generate: English: [✔] (required) → 简体中文 (Simplified Chinese): [✔] 日本語 (Japanese): [✘] Português (Portuguese - Brazil): [✘]Controls: ↑/↓ Navigate • Space/Tab Toggle selection • Enter Next step
选择 python 并按 Enter 使用 Python 插件模板,然后选择要构建的插件类型:
Select the type of plugin you want to create, and press `Enter` to continueBefore starting, here's some basic knowledge about Plugin types in Dify:- Tool: Tool Providers like Google Search, Stable Diffusion, etc. Used to perform specific tasks.- Model: Model Providers like OpenAI, Anthropic, etc. Use their models to enhance AI capabilities.- Endpoint: Similar to Service API in Dify and Ingress in Kubernetes. Extend HTTP services as endpoints with custom logic.- Agent Strategy: Implement your own agent strategies like Function Calling, ReAct, ToT, CoT, etc.Based on the ability you want to extend, Plugins are divided into four types: Tool, Model, Extension, and Agent Strategy.- Tool: A tool provider that can also implement endpoints. For example, building a Discord Bot requires both sending and receiving messages.- Model: Strictly for model providers, no other extensions allowed.- Extension: For simple HTTP services that extend functionality.- Agent Strategy: Implement custom agent logic with a focused approach.We've provided templates to help you get started. Choose one of the options below:-> tool agent-strategy llm text-embedding rerank tts speech2text moderation extension
提示输入最低 Dify 版本时,留空即可使用最新版本:
Edit minimal Dify version requirement, leave it blank by defaultMinimal Dify version (press Enter to next step):
CLI 会创建一个以插件名命名的新目录,并搭建基本项目结构。进入该目录:
cd hello-world
运行插件
在 hello-world 目录下,复制示例环境文件:
cp .env.example .env
编辑 .env 文件,设置插件的环境变量,例如 API 密钥或其他配置。要获取调试凭据,请登录 Dify 环境,点击右上角的 插件,再点击调试图标。在弹出窗口中,复制 API Key 和 Host Address。