Skip to content

Commit 79abd8f

Browse files
committed
[ML-45784]Format fixes
1 parent 4fef182 commit 79abd8f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from databricks.sdk.service.serving import ServingEndpointsAPI
22

3+
34
class 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)

tests/test_open_ai_mixin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import pytest
21
from databricks.sdk.core import Config
32

3+
44
def 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"

0 commit comments

Comments
 (0)