File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 11from databricks .sdk .service .serving import ServingEndpointsAPI
22
3+
34class ServingEndpointsExt (ServingEndpointsAPI ):
5+
46 def get_open_api_client (self ):
57 auth_headers = self ._api ._cfg .authenticate ()
68
@@ -10,7 +12,4 @@ def get_open_api_client(self):
1012 raise ValueError ("Unable to extract authorization token for OpenAI Client" )
1113
1214 from openai import OpenAI
13- return OpenAI (
14- base_url = self ._api ._cfg .host + "/serving-endpoints" ,
15- api_key = token
16- )
15+ return OpenAI (base_url = self ._api ._cfg .host + "/serving-endpoints" , api_key = token )
Original file line number Diff line number Diff line change 1- import pytest
21from databricks .sdk .core import Config
32
3+
44def test_open_ai_client (monkeypatch ):
55 from databricks .sdk import WorkspaceClient
66
@@ -10,4 +10,4 @@ def test_open_ai_client(monkeypatch):
1010 client = w .serving_endpoints .get_open_api_client ()
1111
1212 assert client .base_url == "https://test_host/serving-endpoints/"
13- assert client .api_key == "test_token"
13+ assert client .api_key == "test_token"
You can’t perform that action at this time.
0 commit comments