fix: test custom tool already exists without decrypting credentials (#2668)

This commit is contained in:
Yeuoly
2024-03-04 14:16:47 +08:00
committed by GitHub
parent 34387ec0f1
commit 36686d7425
4 changed files with 41 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
import json
from json import dumps
from typing import Any, Union
from urllib.parse import urlencode
import httpx
import requests
@@ -203,6 +204,8 @@ class ApiTool(Tool):
if 'Content-Type' in headers:
if headers['Content-Type'] == 'application/json':
body = dumps(body)
elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
body = urlencode(body)
else:
body = body