Skip to content

Commit 21d3da8

Browse files
committed
fix: Added deprecation warning
1 parent 4f4a291 commit 21d3da8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ai21/clients/studio/ai21_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
http_client=http_client,
5151
)
5252
self.completion = StudioCompletion(self._http_client)
53-
self.chat = StudioChat(self._http_client)
53+
self.chat: StudioChat = StudioChat(self._http_client)
5454
self.summarize = StudioSummarize(self._http_client)
5555
self.embed = StudioEmbed(self._http_client)
5656
self.gec = StudioGEC(self._http_client)

ai21/clients/studio/resources/studio_chat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from typing import List, Optional
23

34
from ai21.clients.common.chat_base import Chat
@@ -25,6 +26,11 @@ def create(
2526
count_penalty: Optional[Penalty] = None,
2627
**kwargs,
2728
) -> ChatResponse:
29+
warnings.warn(
30+
"This method is deprecated. Please use the `chat.completions.create` method in the client instead.",
31+
DeprecationWarning,
32+
stacklevel=2,
33+
)
2834
body = self._create_body(
2935
model=model,
3036
messages=messages,

0 commit comments

Comments
 (0)