Skip to content

Commit e7cfd26

Browse files
exiaohuliyuxuan-bd
authored andcommitted
fix: use batch.chat instead of batch_chat
1 parent e49a69a commit e7cfd26

File tree

6 files changed

+498
-0
lines changed

6 files changed

+498
-0
lines changed

volcenginesdkarkruntime/_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
from . import resources
3131
from .resources.beta import beta
32+
from .resources.batch import batch
3233
from ._base_client import SyncAPIClient, AsyncAPIClient
3334
from ._constants import (
3435
DEFAULT_MAX_RETRIES,
@@ -60,6 +61,8 @@ class Ark(SyncAPIClient):
6061
batch_chat: resources.BatchChat
6162
responses: resources.Responses
6263
input_items: resources.InputItems
64+
""" `batch_chat` is deprecated, use `batch.chat` instead """
65+
batch: batch.Batch
6366
model_breaker_map: dict[str, ModelBreaker]
6467
model_breaker_lock: threading.Lock
6568

@@ -128,6 +131,7 @@ def __init__(
128131
self.batch_chat = resources.BatchChat(self)
129132
self.responses = resources.Responses(self)
130133
self.input_items = resources.InputItems(self)
134+
self.batch = batch.Batch(self)
131135
self.model_breaker_map = defaultdict(ModelBreaker)
132136
self.model_breaker_lock = threading.Lock()
133137
# self.classification = resources.Classification(self)
@@ -186,6 +190,8 @@ class AsyncArk(AsyncAPIClient):
186190
batch_chat: resources.AsyncBatchChat
187191
responses: resources.AsyncResponses
188192
input_items: resources.AsyncInputItems
193+
""" `batch_chat` is deprecated, use `batch.chat` instead """
194+
batch: batch.AsyncBatch
189195
model_breaker_map: dict[str, ModelBreaker]
190196
model_breaker_lock: asyncio.Lock
191197

@@ -254,6 +260,7 @@ def __init__(
254260
self.batch_chat = resources.AsyncBatchChat(self)
255261
self.responses = resources.AsyncResponses(self)
256262
self.input_items = resources.AsyncInputItems(self)
263+
self.batch = batch.AsyncBatch(self)
257264
self.model_breaker_map = defaultdict(ModelBreaker)
258265
self.model_breaker_lock = asyncio.Lock()
259266
# self.classification = resources.AsyncClassification(self)

volcenginesdkarkruntime/resources/batch/__init__.py

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
from ..._compat import cached_property
4+
from .chat.chat import Chat, AsyncChat
5+
from ..._resource import SyncAPIResource, AsyncAPIResource
6+
7+
__all__ = ["Batch", "AsyncBatch"]
8+
9+
10+
class Batch(SyncAPIResource):
11+
@cached_property
12+
def chat(self) -> Chat:
13+
return Chat(self._client)
14+
15+
16+
class AsyncBatch(AsyncAPIResource):
17+
@cached_property
18+
def chat(self) -> AsyncChat:
19+
return AsyncChat(self._client)

volcenginesdkarkruntime/resources/batch/chat/__init__.py

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
from ...._compat import cached_property
4+
from .completions import Completions, AsyncCompletions
5+
from ...._resource import SyncAPIResource, AsyncAPIResource
6+
7+
__all__ = ["Chat", "AsyncChat"]
8+
9+
10+
class Chat(SyncAPIResource):
11+
@cached_property
12+
def completions(self) -> Completions:
13+
return Completions(self._client)
14+
15+
16+
class AsyncChat(AsyncAPIResource):
17+
@cached_property
18+
def completions(self) -> AsyncCompletions:
19+
return AsyncCompletions(self._client)

0 commit comments

Comments
 (0)