From 5b89b6fe2d902e2738a369b11e9f4361ee2101ef Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Mon, 22 Jul 2024 13:24:24 +0800 Subject: [PATCH] allow custom base_url of dify api server (#6510) --- sdks/python-client/dify_client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/python-client/dify_client/client.py b/sdks/python-client/dify_client/client.py index 53880c100..22d4e6189 100644 --- a/sdks/python-client/dify_client/client.py +++ b/sdks/python-client/dify_client/client.py @@ -2,9 +2,9 @@ import requests 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.base_url = "https://api.dify.ai/v1" + self.base_url = base_url def _send_request(self, method, endpoint, json=None, params=None, stream=False): headers = {