allow custom base_url of dify api server (#6510)

This commit is contained in:
Jian Yu 2024-07-22 13:24:24 +08:00 committed by GitHub
parent a6350daa02
commit 5b89b6fe2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,9 +2,9 @@ import requests
class DifyClient: class DifyClient:
def __init__(self, api_key): def __init__(self, api_key, base_url: str = 'https://api.dify.ai/v1'):
self.api_key = api_key self.api_key = api_key
self.base_url = "https://api.dify.ai/v1" self.base_url = base_url
def _send_request(self, method, endpoint, json=None, params=None, stream=False): def _send_request(self, method, endpoint, json=None, params=None, stream=False):
headers = { headers = {