ragflow/agent/component
flygithub 189007e44d
Fix: PUT method does not work as expected with Invoke component (#5081)
### What problem does this PR solve?
Invoke component can be used to call third party services.
Tried GET/POST/PUT from web UI, and found PUT request failed like this:
(test api: api/v1/chats/<assistant_id>)
 ```
{"code":100,"data":null,"message":"AttributeError("'NoneType' object has
no attribute 'get'")"}
```

Root cause: Invoke PUT with a 'data=args' parameter, which is a form-encoded data, however the default content type setting of request header is application/json. The test api could not deal with such case.

Fix: use the 'json' parameter of reqeusts.put(), same as Invoke POST. Do not use the 'data' parameter.
Another way is to use 'data=json.dumps(args)'.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2025-02-18 19:34:22 +08:00
..
__init__.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
akshare.py Import akshare lazzily. (#4708) 2025-02-05 12:04:11 +08:00
answer.py Code refactor. (#4291) 2024-12-30 18:38:51 +08:00
arxiv.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
baidu.py Add iteration for agent. (#4258) 2024-12-27 11:38:33 +08:00
baidufanyi.py Fix BaiduFanyi TestRun parameter validation and debug method missing … (#4275) 2024-12-30 10:34:57 +08:00
base.py Revert the chat history for rewrite. (#4579) 2025-01-22 16:55:11 +08:00
begin.py Support debug components. (#3994) 2024-12-11 19:23:59 +08:00
bing.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
categorize.py fix categorize agent input content not format error (#4842) 2025-02-11 13:32:42 +08:00
concentrator.py Format: dos2unix (#4467) 2025-01-13 18:19:01 +08:00
crawler.py Fix potential SSRF attack vulnerability (#4334) 2025-01-02 18:45:45 +08:00
deepl.py Fix errors detected by Ruff (#3918) 2024-12-08 14:21:12 +08:00
duckduckgo.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
email.py Email sending tool (#3837) 2024-12-04 11:21:17 +08:00
exesql.py Remove <think> for exeSql component. (#5069) 2025-02-18 13:39:37 +08:00
generate.py Inner prompt parameter setting. (#4806) 2025-02-08 18:09:02 +08:00
github.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
google.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
googlescholar.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
invoke.py Fix: PUT method does not work as expected with Invoke component (#5081) 2025-02-18 19:34:22 +08:00
iteration.py Add iteration for agent. (#4258) 2024-12-27 11:38:33 +08:00
iterationitem.py Add iteration for agent. (#4258) 2024-12-27 11:38:33 +08:00
jin10.py Format: dos2unix (#4467) 2025-01-13 18:19:01 +08:00
keyword.py Component debugging funcionality. (#4012) 2024-12-13 08:50:32 +08:00
message.py Add graphrag (#1793) 2024-08-02 18:51:14 +08:00
pubmed.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
qweather.py Fix component qweather (#2240) 2024-09-04 17:53:11 +08:00
relevant.py Component debugging funcionality. (#4012) 2024-12-13 08:50:32 +08:00
retrieval.py Tagging (#4426) 2025-01-09 17:07:21 +08:00
rewrite.py Rewrite Support specified language or language according to initial question (#4990) 2025-02-17 13:33:43 +08:00
switch.py Fix errors detected by Ruff (#3918) 2024-12-08 14:21:12 +08:00
template.py Inner prompt parameter setting. (#4806) 2025-02-08 18:09:02 +08:00
tushare.py Format: dos2unix (#4467) 2025-01-13 18:19:01 +08:00
wencai.py Format: dos2unix (#4467) 2025-01-13 18:19:01 +08:00
wikipedia.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
yahoofinance.py Format: dos2unix (#4467) 2025-01-13 18:19:01 +08:00