yyh
41857cf9cd
Fix retry handling for request bodies
2026-01-05 14:31:57 +08:00
yyh
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
yyh
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
yyh
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
yyh
a4495ab586
chore(nodejs-client): update pnpm-lock.yaml to remove axios
2026-01-05 13:58:25 +08:00
yyh
7c3f15c507
chore(nodejs-client): bump version to 3.1.0
2026-01-05 13:57:45 +08:00
yyh
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
Stephen Zhou and GitHub
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
wangxiaolei and GitHub
77cf8f6c27
chore: remove python sdk from dify repo ( #29318 )
2025-12-09 14:13:14 +08:00
yyh and GitHub
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 <[email protected] >
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 <[email protected] >
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 <[email protected] >
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 <[email protected] >
2025-09-12 09:37:54 +08:00
05cd7e2d8a
add type annotations for Python SDK ChatClient Class ( #24018 )
...
Co-authored-by: EchterTimo <[email protected] >
2025-09-05 18:12:46 +08:00
sheey and GitHub
9d6ce3065d
fix: files parameter in JavaScript sdk incorrectly annotated as the File type in WebAPI ( #24644 )
2025-08-27 20:01:28 +08:00
yihong and GitHub
4c1ad40f8e
docs: format all md files ( #24195 )
...
Signed-off-by: yihong0618 <[email protected] >
2025-08-20 13:49:11 +08:00
Aryan Raj and GitHub
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 <[email protected] >
2025-07-17 15:09:14 +08:00
minglu7 and GitHub
837f769960
fix: update text_to_audio method to send data as JSON ( #20663 )
2025-06-05 14:33:24 +08:00
QuantumGhost and GitHub
bd1bbfee4b
Enhance Code Consistency Across Repository with .editorconfig ( #19023 )
2025-04-29 18:04:33 +08:00
jayeeliu and GitHub
5e09ac696c
fix: add composer configuration and delete DifyClient->file_client ( #18574 )
2025-04-23 15:43:19 +08:00
+110
403e2d58b9
Introduce Plugins ( #13836 )
...
Signed-off-by: yihong0618 <[email protected] >
Signed-off-by: -LAN- <[email protected] >
Signed-off-by: xhe <[email protected] >
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: takatost <[email protected] >
Co-authored-by: kurokobo <[email protected] >
Co-authored-by: Novice Lee <[email protected] >
Co-authored-by: zxhlyh <[email protected] >
Co-authored-by: AkaraChen <[email protected] >
Co-authored-by: Yi <[email protected] >
Co-authored-by: Joel <[email protected] >
Co-authored-by: JzoNg <[email protected] >
Co-authored-by: twwu <[email protected] >
Co-authored-by: Hiroshi Fujita <[email protected] >
Co-authored-by: AkaraChen <[email protected] >
Co-authored-by: NFish <[email protected] >
Co-authored-by: Wu Tianwei <[email protected] >
Co-authored-by: 非法操作 <[email protected] >
Co-authored-by: Novice <[email protected] >
Co-authored-by: Hiroki Nagai <[email protected] >
Co-authored-by: Gen Sato <[email protected] >
Co-authored-by: eux <[email protected] >
Co-authored-by: huangzhuo1949 <[email protected] >
Co-authored-by: huangzhuo <[email protected] >
Co-authored-by: lotsik <[email protected] >
Co-authored-by: crazywoola <[email protected] >
Co-authored-by: nite-knite <[email protected] >
Co-authored-by: Jyong <[email protected] >
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: gakkiyomi <[email protected] >
Co-authored-by: CN-P5 <[email protected] >
Co-authored-by: CN-P5 <[email protected] >
Co-authored-by: Chuehnone <[email protected] >
Co-authored-by: yihong <[email protected] >
Co-authored-by: Kevin9703 <[email protected] >
Co-authored-by: -LAN- <[email protected] >
Co-authored-by: Boris Feld <[email protected] >
Co-authored-by: mbo <[email protected] >
Co-authored-by: mabo <[email protected] >
Co-authored-by: Warren Chen <[email protected] >
Co-authored-by: JzoNgKVO <[email protected] >
Co-authored-by: jiandanfeng <[email protected] >
Co-authored-by: zhu-an <[email protected] >
Co-authored-by: zhaoqingyu.1075 <[email protected] >
Co-authored-by: 海狸大師 <[email protected] >
Co-authored-by: Xu Song <[email protected] >
Co-authored-by: rayshaw001 <[email protected] >
Co-authored-by: Ding Jiatong <[email protected] >
Co-authored-by: Bowen Liang <[email protected] >
Co-authored-by: JasonVV <[email protected] >
Co-authored-by: le0zh <[email protected] >
Co-authored-by: zhuxinliang <[email protected] >
Co-authored-by: k-zaku <[email protected] >
Co-authored-by: luckylhb90 <[email protected] >
Co-authored-by: hobo.l <[email protected] >
Co-authored-by: jiangbo721 <[email protected] >
Co-authored-by: 刘江波 <[email protected] >
Co-authored-by: Shun Miyazawa <[email protected] >
Co-authored-by: EricPan <[email protected] >
Co-authored-by: crazywoola <[email protected] >
Co-authored-by: sino <[email protected] >
Co-authored-by: Jhvcc <[email protected] >
Co-authored-by: lowell <[email protected] >
Co-authored-by: Boris Polonsky <[email protected] >
Co-authored-by: Ademílson Tonato <[email protected] >
Co-authored-by: Ademílson Tonato <[email protected] >
Co-authored-by: IWAI, Masaharu <[email protected] >
Co-authored-by: Yueh-Po Peng (Yabi) <[email protected] >
Co-authored-by: Jason <[email protected] >
Co-authored-by: Xin Zhang <[email protected] >
Co-authored-by: yjc980121 <[email protected] >
Co-authored-by: heyszt <[email protected] >
Co-authored-by: Abdullah AlOsaimi <[email protected] >
Co-authored-by: Abdullah AlOsaimi <[email protected] >
Co-authored-by: Yingchun Lai <[email protected] >
Co-authored-by: Hash Brown <[email protected] >
Co-authored-by: zuodongxu <[email protected] >
Co-authored-by: Masashi Tomooka <[email protected] >
Co-authored-by: aplio <[email protected] >
Co-authored-by: Obada Khalili <[email protected] >
Co-authored-by: Nam Vu <[email protected] >
Co-authored-by: Kei YAMAZAKI <[email protected] >
Co-authored-by: TechnoHouse <[email protected] >
Co-authored-by: Riddhimaan-Senapati <[email protected] >
Co-authored-by: MaFee921 <[email protected] >
Co-authored-by: te-chan <[email protected] >
Co-authored-by: HQidea <[email protected] >
Co-authored-by: Joshbly <[email protected] >
Co-authored-by: xhe <[email protected] >
Co-authored-by: weiwenyan-dev <[email protected] >
Co-authored-by: ex_wenyan.wei <[email protected] >
Co-authored-by: engchina <[email protected] >
Co-authored-by: engchina <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 呆萌闷油瓶 <[email protected] >
Co-authored-by: Kemal <[email protected] >
Co-authored-by: Lazy_Frog <[email protected] >
Co-authored-by: Yi Xiao <[email protected] >
Co-authored-by: Steven sun <[email protected] >
Co-authored-by: steven <[email protected] >
Co-authored-by: Kalo Chin <[email protected] >
Co-authored-by: Katy Tao <[email protected] >
Co-authored-by: depy <[email protected] >
Co-authored-by: 胡春东 <[email protected] >
Co-authored-by: Junjie.M <[email protected] >
Co-authored-by: MuYu <[email protected] >
Co-authored-by: Naoki Takashima <[email protected] >
Co-authored-by: Summer-Gu <[email protected] >
Co-authored-by: Fei He <[email protected] >
Co-authored-by: ybalbert001 <[email protected] >
Co-authored-by: Yuanbo Li <[email protected] >
Co-authored-by: douxc <[email protected] >
Co-authored-by: liuzhenghua <[email protected] >
Co-authored-by: Wu Jiayang <[email protected] >
Co-authored-by: Your Name <[email protected] >
Co-authored-by: kimjion <[email protected] >
Co-authored-by: AugNSo <[email protected] >
Co-authored-by: llinvokerl <[email protected] >
Co-authored-by: liusurong.lsr <[email protected] >
Co-authored-by: Vasu Negi <[email protected] >
Co-authored-by: Hundredwz <[email protected] >
Co-authored-by: Xiyuan Chen <[email protected] >
2025-02-17 17:05:13 +08:00
Warren Chen and GitHub
03243cb422
Modify params for bedrock retrieve generate ( #13182 )
2025-02-05 12:17:42 +08:00
yihong and GitHub
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 <[email protected] >
2024-10-15 16:26:44 +08:00
zhuhao and GitHub
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 <[email protected] >
2024-09-15 17:08:52 +08:00
fa1af8e47b
add WorkflowClient.get_result, increase version number ( #8435 )
...
Co-authored-by: wangying <[email protected] >
2024-09-14 19:06:37 +08:00
Nam Vu and GitHub
2d7954c7da
Fix variable typo ( #8084 )
2024-09-08 13:14:11 +08:00
Krasus.Chen and GitHub
7d4a0a417a
add workflowClient ,fix rename bug ( #7352 )
2024-08-16 20:21:08 +08:00
Krasus.Chen and GitHub
6e7f5fae09
add some api to DifyClient ( #7314 )
2024-08-15 19:26:59 +08:00
Jian Yu and GitHub
5b89b6fe2d
allow custom base_url of dify api server ( #6510 )
2024-07-22 13:24:24 +08:00
Joel and GitHub
69190e088e
fix: update npm version to fix Incorrect argument types in createChatMessage ( #4865 )
2024-06-03 08:22:27 +08:00
Kishida Takashi and GitHub
41e536109b
fix: Incorrect argument types in createChatMessage ( #4861 )
2024-06-02 21:03:42 +08:00
Valerio Narcisi and GitHub
af026c5953
fix: node.js sdk if request is a get data must not exist ( #4618 )
2024-05-27 08:48:07 +08:00
Joel and GitHub
80e390b906
feat: add workflow api in Node.js sdk ( #3584 )
2024-04-18 11:23:18 +08:00
Onelevenvy and GitHub
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 <[email protected] >
2024-02-18 15:54:14 +08:00
Joel and GitHub
d76d1adb59
feat: Nodejs sdk support auto rename conversation api ( #2265 )
2024-01-29 12:57:39 +08:00
Bowen Liang and GitHub
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 <[email protected] >
2023-11-20 17:54:01 +08:00
5b06ded0b1
build: improve dockerfile ( #851 )
...
Co-authored-by: MatriQi <[email protected] >
2023-08-17 10:25:11 +08:00
crazywoola and GitHub
39933aeb62
feat: add readme ( #791 )
2023-08-09 20:15:24 +08:00
crazywoola and GitHub
beb8065660
fix: remove ruby from repo due to main gitignore ( #790 )
2023-08-09 19:47:50 +08:00