Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazywoola/dify-extension
A template code for dify extension written in node.js
https://github.com/crazywoola/dify-extension
Last synced: 7 days ago
JSON representation
A template code for dify extension written in node.js
- Host: GitHub
- URL: https://github.com/crazywoola/dify-extension
- Owner: crazywoola
- License: mit
- Created: 2023-12-12T05:29:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-18T12:17:36.000Z (about 1 year ago)
- Last Synced: 2024-10-11T14:58:49.858Z (3 months ago)
- Language: JavaScript
- Homepage: https://dify-extension.vercel.app
- Size: 11.7 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dify NodeJs Extension Template
## Quick Start
1. Clone this repository
2. Edit `expectedApiKey` in `index.js` to match your API key
3. Run `npm install`
4. Run `npm run start`## Example payload
### Point: ping
```json
{
"point": "ping"
}
``````bash
curl --location 'http://localhost:3000/api/dify/receive' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 123456' \
--data '{
"point": "ping"
}'
```### Point: app.external_data_tool.query
```json
{
"point": "app.external_data_tool.query",
"params": {
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
"tool_variable": "menu",
"inputs": {
"choice": "foods"
},
"query": "Give me something to eat?"
}
}
``````bash
curl --location 'http://localhost:3000/api/dify/receive' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 123456' \
--data '{
"point": "app.external_data_tool.query",
"params": {
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
"tool_variable": "menu",
"inputs": {
"choice": "foods"
},
"query": "Give me something to eat?"
}
}'
```