Skip to content

Commit b46ae14

Browse files
committed
chore: sync byteplus plugin sources
0 parents  commit b46ae14

40 files changed

Lines changed: 1722 additions & 0 deletions
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Auto Create PR on Main Push
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
env:
8+
TARGET_REPO: drpr/dify-byteplus-plugins
9+
UPSTREAM_REPO: langgenius/dify-plugins
10+
PLUGIN_DIR: model-plugin
11+
12+
jobs:
13+
create_pr:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Download CLI tool
20+
run: |
21+
mkdir -p $RUNNER_TEMP/bin
22+
cd $RUNNER_TEMP/bin
23+
wget https://github.com/langgenius/dify-plugin-daemon/releases/download/0.0.6/dify-plugin-linux-amd64
24+
chmod +x dify-plugin-linux-amd64
25+
26+
- name: Get basic info from manifest
27+
id: get_basic_info
28+
run: |
29+
PLUGIN_NAME=$(grep "^name:" $GITHUB_WORKSPACE/${{ env.PLUGIN_DIR }}/manifest.yaml | cut -d' ' -f2)
30+
echo "plugin_name=$PLUGIN_NAME" >> $GITHUB_OUTPUT
31+
VERSION=$(grep "^version:" $GITHUB_WORKSPACE/${{ env.PLUGIN_DIR }}/manifest.yaml | cut -d' ' -f2)
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
AUTHOR=$(grep "^author:" $GITHUB_WORKSPACE/${{ env.PLUGIN_DIR }}/manifest.yaml | cut -d' ' -f2)
34+
echo "author=$AUTHOR" >> $GITHUB_OUTPUT
35+
36+
- name: Package Plugin
37+
id: package
38+
run: |
39+
cd $GITHUB_WORKSPACE/${{ env.PLUGIN_DIR }}
40+
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
41+
$RUNNER_TEMP/bin/dify-plugin-linux-amd64 plugin package . -o "$PACKAGE_NAME"
42+
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
43+
44+
- name: Checkout target repo
45+
uses: actions/checkout@v3
46+
with:
47+
repository: ${{ env.TARGET_REPO }}
48+
path: dify-plugins
49+
token: ${{ secrets.PLUGIN_ACTION }}
50+
fetch-depth: 1
51+
persist-credentials: true
52+
53+
- name: Prepare and push branch
54+
run: |
55+
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
56+
mkdir -p dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}
57+
mv $GITHUB_WORKSPACE/${{ env.PLUGIN_DIR }}/"$PACKAGE_NAME" dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}/
58+
cd dify-plugins
59+
git config user.name "GitHub Actions"
60+
git config user.email "actions@github.com"
61+
git fetch origin main
62+
git checkout main
63+
git pull origin main
64+
BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
65+
git checkout -b "$BRANCH_NAME"
66+
git add .
67+
git commit -m "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}"
68+
git push -u origin "$BRANCH_NAME" --force
69+
70+
- name: Create PR via GitHub API
71+
env:
72+
GH_TOKEN: ${{ secrets.PLUGIN_ACTION }}
73+
run: |
74+
gh pr create \
75+
--repo "${{ env.UPSTREAM_REPO }}" \
76+
--head "${{ steps.get_basic_info.outputs.author }}:bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}" \
77+
--base main \
78+
--title "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}" \
79+
--body "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin package to version ${{ steps.get_basic_info.outputs.version }}\n\nChanges:\n- Updated plugin package file" || echo "PR already exists or creation skipped."

.gitignore

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110+
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
.idea/
163+
164+
/logs
165+
/dify-marketplace-backend
166+
/.scripts
167+
168+
# macOS
169+
# can be found at https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
170+
# General
171+
.DS_Store
172+
.AppleDouble
173+
.LSOverride
174+
175+
# Thumbnails
176+
._*
177+
178+
# Files that might appear in the root of a volume
179+
.DocumentRevisions-V100
180+
.fseventsd
181+
.Spotlight-V100
182+
.TemporaryItems
183+
.Trashes
184+
.VolumeIcon.icns
185+
.com.apple.timemachine.donotpresent
186+
187+
# Directories potentially created on remote AFP share
188+
.AppleDB
189+
.AppleDesktop
190+
Network Trash Folder
191+
Temporary Items
192+
.apdisk

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# BytePlus Dify Plugins
2+
3+
## Repository Structure
4+
- model-plugin: BytePlus ModelArk model plugin
5+
- seedream-tool: BytePlus Seedream image tool plugin
6+
- seedance-tool: BytePlus Seedance video tool plugin
7+
8+
## Repository
9+
https://github.com/drpr/dify-byteplus-plugin-source

model-plugin/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# BytePlus ModelArk Dify Plugin
2+
3+
## Overview
4+
This plugin provides BytePlus ModelArk model access in Dify via OpenAI-compatible APIs. The model name is used for display only, while the API request uses the endpoint host, API key, and required Endpoint ID.
5+
6+
## Version
7+
0.0.2
8+
9+
## Setup
10+
1. Install the plugin from Dify Marketplace or upload the local .difypkg file.
11+
2. Add a new model with this provider.
12+
3. Fill in the required configuration and save.
13+
14+
## Configuration
15+
- Model display name (display only)
16+
- API Key
17+
- API Endpoint Host
18+
- SSL Verify
19+
- CA Bundle Path (optional)
20+
- Endpoint ID (required)
21+
22+
## Usage
23+
After saving the model credentials, use it in your Dify applications and validate it from the model settings page.
24+
25+
## Contact
26+
Email: alex.gao@bytedance.com
27+
28+
## Repository
29+
https://github.com/drpr/dify-byteplus-plugin-source/tree/main/model-plugin

model-plugin/_assets/icon_s_en.png

1.84 KB
Loading
10.1 KB
Binary file not shown.

model-plugin/icon_s_en.png

1.84 KB
Loading

model-plugin/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from dify_plugin import DifyPluginEnv, Plugin
2+
3+
plugin = Plugin(DifyPluginEnv(MAX_REQUEST_TIMEOUT=120))
4+
5+
if __name__ == "__main__":
6+
plugin.run()

model-plugin/manifest.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
author: drpr
2+
created_at: '2026-02-13T00:00:00Z'
3+
description:
4+
en_US: BytePlus ModelArk models.
5+
zh_Hans: BytePlus ModelArk 模型服务。
6+
icon: icon_s_en.png
7+
label:
8+
en_US: BytePlus ModelArk
9+
zh_Hans: BytePlus ModelArk
10+
meta:
11+
version: 0.0.2
12+
arch:
13+
- amd64
14+
- arm64
15+
runner:
16+
entrypoint: main
17+
language: python
18+
version: '3.12'
19+
name: byteplus_modelark
20+
privacy: ./privacy_policy.md
21+
plugins:
22+
models:
23+
- provider/byteplus_modelark.yaml
24+
resource:
25+
memory: 268435456
26+
permission:
27+
model:
28+
enabled: true
29+
llm: true
30+
tool:
31+
enabled: true
32+
type: plugin
33+
version: 0.0.2

0 commit comments

Comments
 (0)