Skip to content

Commit 682fe5d

Browse files
authored
Merge pull request #60 from jaguarliuu/main
优化异常处理 优化用户提示信息
2 parents a3d2d66 + cb14b71 commit 682fe5d

File tree

9 files changed

+32
-16
lines changed

9 files changed

+32
-16
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Sync to CNB
2+
on: [push]
3+
4+
jobs:
5+
sync:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
12+
- name: Sync to CNB Repository
13+
run: |
14+
docker run --rm \
15+
-v ${{ github.workspace }}:${{ github.workspace }} \
16+
-w ${{ github.workspace }} \
17+
-e PLUGIN_TARGET_URL="https://cnb.cool/jaguarliu.cool/dify-tool/rookie_text2data.git" \
18+
-e PLUGIN_AUTH_TYPE="https" \
19+
-e PLUGIN_USERNAME="cnb" \
20+
-e PLUGIN_PASSWORD=${{ secrets.CNB_TOKEN }} \
21+
-e PLUGIN_BRANCH="main" \
22+
-e PLUGIN_GIT_USER="cnb" \
23+
-e PLUGIN_GIT_EMAIL="cnb@cnb.cool" \
24+
-e PLUGIN_FORCE="true" \
25+
tencentcom/git-sync

.ide/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM python:3.13.0
33
# RUN apt-get update && apt-get install -y git
44

55
# 下载插件并设置权限,重命名后复制到系统路径
6-
RUN wget https://github.com/langgenius/dify-plugin-daemon/releases/download/0.0.6/dify-plugin-linux-amd64 -O /tmp/dify-plugin-linux-amd64 && \
6+
RUN wget https://github.com/langgenius/dify-plugin-daemon/releases/download/0.0.7/dify-plugin-linux-amd64 -O /tmp/dify-plugin-linux-amd64 && \
77
chmod +x /tmp/dify-plugin-linux-amd64 && \
88
mv /tmp/dify-plugin-linux-amd64 /usr/local/bin/dify
99

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## rookie_text2data
22

33
**Author:** jaguarliuu
4-
**Version:** 0.3.0
4+
**Version:** 0.3.1
55
**Type:** tool
66

77
### Description

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## rookie_text2data
22

33
**Author:** jaguarliuu
4-
**Version:** 0.3.0
4+
**Version:** 0.3.1
55
**Type:** tool
66

77
### Description

manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.3.0
1+
version: 0.3.1
22
type: plugin
33
author: jaguarliuu
44
name: rookie_text2data

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# 核心依赖
2-
dify_plugin~=0.0.1b67
2+
dify_plugin~=0.0.1b72
33
sqlalchemy>=2.0.0
44

55
# 数据库驱动
6-
# pyodbc>=4.0.39 # SQL Server新驱动
6+
pyodbc>=4.0.39 # SQL Server新驱动
77
pymysql>=1.1.1 # MySQL驱动
88
psycopg2-binary>=2.9.10 # PostgreSQL驱动
99

tools/rookie_text2data.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
from dify_plugin import Tool
55
from dify_plugin.entities.tool import ToolInvokeMessage
66
from dify_plugin.entities.model.llm import LLMModelConfig
7-
from dify_plugin.entities.tool import ToolInvokeMessage
87
from dify_plugin.entities.model.message import SystemPromptMessage, UserPromptMessage
98
from utils.prompt_loader import PromptLoader
10-
# from utils.alchemy_db_client import format_schema_dsl
11-
# from utils.alchemy_db_client import get_db_schema
129
from database_schema.connector import get_db_schema
1310
from database_schema.formatter import format_schema_dsl
1411

utils/alchemy_db_client.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,10 @@ def _build_connection_uri(
219219
database: str,
220220
) -> str:
221221
"""构建数据库连接字符串"""
222-
<<<<<<< HEAD
223-
separator = ':' if db_type != 'sqlserver' else ','
224-
db_type = db_type if db_type != 'sqlserver' else 'mssql'
225-
extra_info = '' if driver_info == None else f'?driver={driver_info}'
226222

227-
return f"{db_type}+{driver}://{username}:{password}@{host}{separator}{port}/{database}{extra_info}"
228-
=======
229223
db_type = db_type if db_type != 'sqlserver' else 'mssql'
230224
return f"{db_type}+{driver}://{username}:{password}@{host}:{port}/{database}"
231-
>>>>>>> debug
225+
232226

233227
def _process_result(result_proxy) -> Union[list[dict], dict, None]:
234228
"""处理执行结果"""

0 commit comments

Comments
 (0)