41857cf9cd
Fix retry handling for request bodies
2026-01-05 14:31:57 +08:00
78ab09b521
fix(nodejs-client): handle malformed JSON responses gracefully
...
Fix critical bugs in response body parsing:
1. Error responses (non-OK status):
- Response body can only be read once
- Previous code: response.json() fails → response.text() throws 'Body already read'
- Fix: Read as text first, then parse JSON with fallback to raw text
2. Success responses (OK status):
- Malformed JSON was not caught, causing NetworkError misclassification
- Fix: Wrap JSON.parse in try-catch, fallback to raw text
These fixes prevent unhandled promise rejections and provide better error
messages when servers return malformed JSON responses.
Reported-by: gemini-code-assist
Severity: Critical (issue 1), High (issue 2)
2026-01-05 14:23:20 +08:00
249a491743
fix(nodejs-client): fix timeout handling in retry loop
...
Fix critical bug in retry loop timeout control:
- Move AbortController creation inside while loop to ensure each retry uses a fresh controller
- Previous implementation caused retries to use an already-aborted controller, making retries fail immediately
- Add eslint-disable comments to explain necessary type assertions
- Improve code comments explaining DOM ReadableStream type conversion
This fix ensures the retry mechanism works correctly with independent timeout control for each attempt.
2026-01-05 14:13:22 +08:00
df67842fae
fix(nodejs-client): fix all test mocks for fetch API
...
- Add createMockResponse helper to properly mock fetch responses
- Update all test cases to use the mock helper with all required methods
- Fix timeout error test to use AbortError instead of fake timers
- Ensure beforeEach restores real timers to avoid test interference
- All 85 tests now passing
2026-01-05 14:04:57 +08:00
a4495ab586
chore(nodejs-client): update pnpm-lock.yaml to remove axios
2026-01-05 13:58:25 +08:00
7c3f15c507
chore(nodejs-client): bump version to 3.1.0
2026-01-05 13:57:45 +08:00
5db66ad033
refactor(nodejs-client): replace axios with native fetch API
...
- Replace axios with Node.js native fetch API for HTTP requests
- Update HttpClient to use fetch instead of axios instance
- Convert axios-specific error handling to fetch-based error mapping
- Update response type handling for streams, JSON, text, etc.
- Remove axios from package.json dependencies
- Update all test files to mock fetch instead of axios
This change reduces external dependencies and uses the built-in
fetch API available in Node.js 18+, which is already the minimum
required version for this SDK.
2026-01-05 13:57:22 +08:00
a46dc2f37e
chore(sdk/nodejs): update deps ( #30291 )
2025-12-29 10:13:19 +08:00
4d48791f3c
refactor: nodejs sdk ( #30036 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-23 23:24:38 +08:00
77cf8f6c27
chore: remove python sdk from dify repo ( #29318 )
2025-12-09 14:13:14 +08:00
034e3e85e9
Fix Node.js SDK routes and multipart handling ( #28573 )
2025-11-24 21:00:40 +08:00
99e9fc751b
refactor: refactor python sdk ( #28118 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-20 11:10:53 +08:00
a9b3539b90
feat: migrate Python SDK to httpx with async/await support ( #26726 )
...
Signed-off-by: lyzno1 <yuanyouhuilyz@gmail.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-11 17:45:42 +08:00
f60aa36fa0
feat(sdk): enhance Python SDK with 27 new Service API endpoints ( #26401 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-29 19:22:58 +08:00
70bc5ca7f4
Add missing import "IO" in client.py ( #26389 )
...
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-09-29 13:50:53 +08:00
0e4f19eee0
Fix ChatClient.audio_to_text files keyword to make it work ( #26317 )
...
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com >
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-09-27 21:03:05 +08:00
bdd85b36a4
ruff check preview ( #25653 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-16 12:58:12 +08:00
9234a2293d
improve type hints using typing.Literal and add type annotations ( #25641 )
...
Co-authored-by: EchterTimo <EchterTimo@users.noreply.github.com >
2025-09-14 18:44:23 +08:00
77ba3e8f26
add autofix pnpm ( #25557 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-09-12 09:37:54 +08:00
05cd7e2d8a
add type annotations for Python SDK ChatClient Class ( #24018 )
...
Co-authored-by: EchterTimo <EchterTimo@users.noreply.github.com >
2025-09-05 18:12:46 +08:00
9d6ce3065d
fix: files parameter in JavaScript sdk incorrectly annotated as the File type in WebAPI ( #24644 )
2025-08-27 20:01:28 +08:00
4c1ad40f8e
docs: format all md files ( #24195 )
...
Signed-off-by: yihong0618 <zouzou0208@gmail.com >
2025-08-20 13:49:11 +08:00
ce794335e9
Fix/replace datetime patterns with naive utc now ( #22654 )
2025-07-20 11:05:53 +08:00
4b604bd79a
fix: Python SDK WorkflowClient and KnowledgeBase client imports fixed. Added documentation for WorkflowClient. ( #22476 )
...
Co-authored-by: crazywoola <427733928@qq.com >
2025-07-17 15:09:14 +08:00
837f769960
fix: update text_to_audio method to send data as JSON ( #20663 )
2025-06-05 14:33:24 +08:00
bd1bbfee4b
Enhance Code Consistency Across Repository with .editorconfig ( #19023 )
2025-04-29 18:04:33 +08:00
5e09ac696c
fix: add composer configuration and delete DifyClient->file_client ( #18574 )
2025-04-23 15:43:19 +08:00
403e2d58b9
Introduce Plugins ( #13836 )
...
Signed-off-by: yihong0618 <zouzou0208@gmail.com >
Signed-off-by: -LAN- <laipz8200@outlook.com >
Signed-off-by: xhe <xw897002528@gmail.com >
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: takatost <takatost@gmail.com >
Co-authored-by: kurokobo <kuro664@gmail.com >
Co-authored-by: Novice Lee <novicelee@NoviPro.local >
Co-authored-by: zxhlyh <jasonapring2015@outlook.com >
Co-authored-by: AkaraChen <akarachen@outlook.com >
Co-authored-by: Yi <yxiaoisme@gmail.com >
Co-authored-by: Joel <iamjoel007@gmail.com >
Co-authored-by: JzoNg <jzongcode@gmail.com >
Co-authored-by: twwu <twwu@dify.ai >
Co-authored-by: Hiroshi Fujita <fujita-h@users.noreply.github.com >
Co-authored-by: AkaraChen <85140972+AkaraChen@users.noreply.github.com >
Co-authored-by: NFish <douxc512@gmail.com >
Co-authored-by: Wu Tianwei <30284043+WTW0313@users.noreply.github.com >
Co-authored-by: 非法操作 <hjlarry@163.com >
Co-authored-by: Novice <857526207@qq.com >
Co-authored-by: Hiroki Nagai <82458324+nagaihiroki-git@users.noreply.github.com >
Co-authored-by: Gen Sato <52241300+halogen22@users.noreply.github.com >
Co-authored-by: eux <euxuuu@gmail.com >
Co-authored-by: huangzhuo1949 <167434202+huangzhuo1949@users.noreply.github.com >
Co-authored-by: huangzhuo <huangzhuo1@xiaomi.com >
Co-authored-by: lotsik <lotsik@mail.ru >
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com >
Co-authored-by: nite-knite <nkCoding@gmail.com >
Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com >
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: gakkiyomi <gakkiyomi@aliyun.com >
Co-authored-by: CN-P5 <heibai2006@gmail.com >
Co-authored-by: CN-P5 <heibai2006@qq.com >
Co-authored-by: Chuehnone <1897025+chuehnone@users.noreply.github.com >
Co-authored-by: yihong <zouzou0208@gmail.com >
Co-authored-by: Kevin9703 <51311316+Kevin9703@users.noreply.github.com >
Co-authored-by: -LAN- <laipz8200@outlook.com >
Co-authored-by: Boris Feld <lothiraldan@gmail.com >
Co-authored-by: mbo <himabo@gmail.com >
Co-authored-by: mabo <mabo@aeyes.ai >
Co-authored-by: Warren Chen <warren.chen830@gmail.com >
Co-authored-by: JzoNgKVO <27049666+JzoNgKVO@users.noreply.github.com >
Co-authored-by: jiandanfeng <chenjh3@wangsu.com >
Co-authored-by: zhu-an <70234959+xhdd123321@users.noreply.github.com >
Co-authored-by: zhaoqingyu.1075 <zhaoqingyu.1075@bytedance.com >
Co-authored-by: 海狸大師 <86974027+yenslife@users.noreply.github.com >
Co-authored-by: Xu Song <xusong.vip@gmail.com >
Co-authored-by: rayshaw001 <396301947@163.com >
Co-authored-by: Ding Jiatong <dingjiatong@gmail.com >
Co-authored-by: Bowen Liang <liangbowen@gf.com.cn >
Co-authored-by: JasonVV <jasonwangiii@outlook.com >
Co-authored-by: le0zh <newlight@qq.com >
Co-authored-by: zhuxinliang <zhuxinliang@didiglobal.com >
Co-authored-by: k-zaku <zaku99@outlook.jp >
Co-authored-by: luckylhb90 <luckylhb90@gmail.com >
Co-authored-by: hobo.l <hobo.l@binance.com >
Co-authored-by: jiangbo721 <365065261@qq.com >
Co-authored-by: 刘江波 <jiangbo721@163.com >
Co-authored-by: Shun Miyazawa <34241526+miya@users.noreply.github.com >
Co-authored-by: EricPan <30651140+Egfly@users.noreply.github.com >
Co-authored-by: crazywoola <427733928@qq.com >
Co-authored-by: sino <sino2322@gmail.com >
Co-authored-by: Jhvcc <37662342+Jhvcc@users.noreply.github.com >
Co-authored-by: lowell <lowell.hu@zkteco.in >
Co-authored-by: Boris Polonsky <BorisPolonsky@users.noreply.github.com >
Co-authored-by: Ademílson Tonato <ademilsonft@outlook.com >
Co-authored-by: Ademílson Tonato <ademilson.tonato@refurbed.com >
Co-authored-by: IWAI, Masaharu <iwaim.sub@gmail.com >
Co-authored-by: Yueh-Po Peng (Yabi) <94939112+y10ab1@users.noreply.github.com >
Co-authored-by: Jason <ggbbddjm@gmail.com >
Co-authored-by: Xin Zhang <sjhpzx@gmail.com >
Co-authored-by: yjc980121 <3898524+yjc980121@users.noreply.github.com >
Co-authored-by: heyszt <36215648+hieheihei@users.noreply.github.com >
Co-authored-by: Abdullah AlOsaimi <osaimiacc@gmail.com >
Co-authored-by: Abdullah AlOsaimi <189027247+osaimi@users.noreply.github.com >
Co-authored-by: Yingchun Lai <laiyingchun@apache.org >
Co-authored-by: Hash Brown <hi@xzd.me >
Co-authored-by: zuodongxu <192560071+zuodongxu@users.noreply.github.com >
Co-authored-by: Masashi Tomooka <tmokmss@users.noreply.github.com >
Co-authored-by: aplio <ryo.091219@gmail.com >
Co-authored-by: Obada Khalili <54270856+obadakhalili@users.noreply.github.com >
Co-authored-by: Nam Vu <zuzoovn@gmail.com >
Co-authored-by: Kei YAMAZAKI <1715090+kei-yamazaki@users.noreply.github.com >
Co-authored-by: TechnoHouse <13776377+deephbz@users.noreply.github.com >
Co-authored-by: Riddhimaan-Senapati <114703025+Riddhimaan-Senapati@users.noreply.github.com >
Co-authored-by: MaFee921 <31881301+2284730142@users.noreply.github.com >
Co-authored-by: te-chan <t-nakanome@sakura-is.co.jp >
Co-authored-by: HQidea <HQidea@users.noreply.github.com >
Co-authored-by: Joshbly <36315710+Joshbly@users.noreply.github.com >
Co-authored-by: xhe <xw897002528@gmail.com >
Co-authored-by: weiwenyan-dev <154779315+weiwenyan-dev@users.noreply.github.com >
Co-authored-by: ex_wenyan.wei <ex_wenyan.wei@tcl.com >
Co-authored-by: engchina <12236799+engchina@users.noreply.github.com >
Co-authored-by: engchina <atjapan2015@gmail.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 呆萌闷油瓶 <253605712@qq.com >
Co-authored-by: Kemal <kemalmeler@outlook.com >
Co-authored-by: Lazy_Frog <4590648+lazyFrogLOL@users.noreply.github.com >
Co-authored-by: Yi Xiao <54782454+YIXIAO0@users.noreply.github.com >
Co-authored-by: Steven sun <98230804+Tuyohai@users.noreply.github.com >
Co-authored-by: steven <sunzwj@digitalchina.com >
Co-authored-by: Kalo Chin <91766386+fdb02983rhy@users.noreply.github.com >
Co-authored-by: Katy Tao <34019945+KatyTao@users.noreply.github.com >
Co-authored-by: depy <42985524+h4ckdepy@users.noreply.github.com >
Co-authored-by: 胡春东 <gycm520@gmail.com >
Co-authored-by: Junjie.M <118170653@qq.com >
Co-authored-by: MuYu <mr.muzea@gmail.com >
Co-authored-by: Naoki Takashima <39912547+takatea@users.noreply.github.com >
Co-authored-by: Summer-Gu <37869445+gubinjie@users.noreply.github.com >
Co-authored-by: Fei He <droxer.he@gmail.com >
Co-authored-by: ybalbert001 <120714773+ybalbert001@users.noreply.github.com >
Co-authored-by: Yuanbo Li <ybalbert@amazon.com >
Co-authored-by: douxc <7553076+douxc@users.noreply.github.com >
Co-authored-by: liuzhenghua <1090179900@qq.com >
Co-authored-by: Wu Jiayang <62842862+Wu-Jiayang@users.noreply.github.com >
Co-authored-by: Your Name <you@example.com >
Co-authored-by: kimjion <45935338+kimjion@users.noreply.github.com >
Co-authored-by: AugNSo <song.tiankai@icloud.com >
Co-authored-by: llinvokerl <38915183+llinvokerl@users.noreply.github.com >
Co-authored-by: liusurong.lsr <liusurong.lsr@alibaba-inc.com >
Co-authored-by: Vasu Negi <vasu-negi@users.noreply.github.com >
Co-authored-by: Hundredwz <1808096180@qq.com >
Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com >
2025-02-17 17:05:13 +08:00
03243cb422
Modify params for bedrock retrieve generate ( #13182 )
2025-02-05 12:17:42 +08:00
56e15d09a9
feat: mypy for all type check ( #10921 )
2024-12-24 18:38:51 +08:00
b597a0d31c
fix: Azure OpenAI o1 max_completion_token and get_num_token_from_messages error ( #9326 )
...
Co-authored-by: wwwc <wwwc@outlook.com >
2024-10-15 16:26:44 +08:00
2328944987
chore: apply ruff reformat for python-client sdk ( #8752 )
2024-09-25 14:48:06 +08:00
4788e1c8c8
[Python SDK] Add KnowledgeBaseClient and the corresponding test cases. ( #8465 )
...
Co-authored-by: Wang Ying <wangying@xkool.org >
2024-09-15 17:08:52 +08:00
fa1af8e47b
add WorkflowClient.get_result, increase version number ( #8435 )
...
Co-authored-by: wangying <wangying@xkool.org >
2024-09-14 19:06:37 +08:00
2d7954c7da
Fix variable typo ( #8084 )
2024-09-08 13:14:11 +08:00
7d4a0a417a
add workflowClient ,fix rename bug ( #7352 )
2024-08-16 20:21:08 +08:00
6e7f5fae09
add some api to DifyClient ( #7314 )
2024-08-15 19:26:59 +08:00
5b89b6fe2d
allow custom base_url of dify api server ( #6510 )
2024-07-22 13:24:24 +08:00
69190e088e
fix: update npm version to fix Incorrect argument types in createChatMessage ( #4865 )
2024-06-03 08:22:27 +08:00
41e536109b
fix: Incorrect argument types in createChatMessage ( #4861 )
2024-06-02 21:03:42 +08:00
af026c5953
fix: node.js sdk if request is a get data must not exist ( #4618 )
2024-05-27 08:48:07 +08:00
80e390b906
feat: add workflow api in Node.js sdk ( #3584 )
2024-04-18 11:23:18 +08:00
cb79a90031
feat: Add tools for open weather search and image generation using the Spark API. ( #2845 )
2024-03-18 16:22:48 +08:00
0b8dcaba8f
Chore: Add type files and unit test ci for Node.js SDK ( #2268 )
...
Co-authored-by: xieweicheng <xieweicheng@bytedance.com >
2024-02-18 15:54:14 +08:00
d76d1adb59
feat: Nodejs sdk support auto rename conversation api ( #2265 )
2024-01-29 12:57:39 +08:00
cc9e74123c
improve: introduce isort for linting Python imports ( #1983 )
2024-01-12 12:34:01 +08:00
5b7071e4b0
Feat/sdk vision support ( #1531 )
...
Co-authored-by: Joel <iamjoel007@gmail.com >
2023-11-20 17:54:01 +08:00
5b06ded0b1
build: improve dockerfile ( #851 )
...
Co-authored-by: MatriQi <matri@aifi.io >
2023-08-17 10:25:11 +08:00
39933aeb62
feat: add readme ( #791 )
2023-08-09 20:15:24 +08:00
beb8065660
fix: remove ruby from repo due to main gitignore ( #790 )
2023-08-09 19:47:50 +08:00