소스 검색

allow custom base_url of dify api server (#6510)

Jian Yu 9 달 전
부모
커밋
5b89b6fe2d
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      sdks/python-client/dify_client/client.py

+ 2 - 2
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 = {