|
8 | 8 |
|
9 | 9 | import httpx |
10 | 10 |
|
11 | | -from . import resources, _exceptions |
| 11 | +from . import _exceptions |
12 | 12 | from ._qs import Querystring |
13 | 13 | from ._types import ( |
14 | 14 | NOT_GIVEN, |
|
24 | 24 | get_async_library, |
25 | 25 | ) |
26 | 26 | from ._version import __version__ |
| 27 | +from .resources import models, embeddings |
27 | 28 | from ._streaming import Stream as Stream, AsyncStream as AsyncStream |
28 | 29 | from ._exceptions import GroqError, APIStatusError |
29 | 30 | from ._base_client import ( |
30 | 31 | DEFAULT_MAX_RETRIES, |
31 | 32 | SyncAPIClient, |
32 | 33 | AsyncAPIClient, |
33 | 34 | ) |
| 35 | +from .resources.chat import chat |
| 36 | +from .resources.audio import audio |
34 | 37 |
|
35 | | -__all__ = [ |
36 | | - "Timeout", |
37 | | - "Transport", |
38 | | - "ProxiesTypes", |
39 | | - "RequestOptions", |
40 | | - "resources", |
41 | | - "Groq", |
42 | | - "AsyncGroq", |
43 | | - "Client", |
44 | | - "AsyncClient", |
45 | | -] |
| 38 | +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Groq", "AsyncGroq", "Client", "AsyncClient"] |
46 | 39 |
|
47 | 40 |
|
48 | 41 | class Groq(SyncAPIClient): |
49 | | - chat: resources.Chat |
50 | | - embeddings: resources.Embeddings |
51 | | - audio: resources.Audio |
52 | | - models: resources.Models |
| 42 | + chat: chat.Chat |
| 43 | + embeddings: embeddings.Embeddings |
| 44 | + audio: audio.Audio |
| 45 | + models: models.Models |
53 | 46 | with_raw_response: GroqWithRawResponse |
54 | 47 | with_streaming_response: GroqWithStreamedResponse |
55 | 48 |
|
@@ -107,10 +100,10 @@ def __init__( |
107 | 100 | _strict_response_validation=_strict_response_validation, |
108 | 101 | ) |
109 | 102 |
|
110 | | - self.chat = resources.Chat(self) |
111 | | - self.embeddings = resources.Embeddings(self) |
112 | | - self.audio = resources.Audio(self) |
113 | | - self.models = resources.Models(self) |
| 103 | + self.chat = chat.Chat(self) |
| 104 | + self.embeddings = embeddings.Embeddings(self) |
| 105 | + self.audio = audio.Audio(self) |
| 106 | + self.models = models.Models(self) |
114 | 107 | self.with_raw_response = GroqWithRawResponse(self) |
115 | 108 | self.with_streaming_response = GroqWithStreamedResponse(self) |
116 | 109 |
|
@@ -220,10 +213,10 @@ def _make_status_error( |
220 | 213 |
|
221 | 214 |
|
222 | 215 | class AsyncGroq(AsyncAPIClient): |
223 | | - chat: resources.AsyncChat |
224 | | - embeddings: resources.AsyncEmbeddings |
225 | | - audio: resources.AsyncAudio |
226 | | - models: resources.AsyncModels |
| 216 | + chat: chat.AsyncChat |
| 217 | + embeddings: embeddings.AsyncEmbeddings |
| 218 | + audio: audio.AsyncAudio |
| 219 | + models: models.AsyncModels |
227 | 220 | with_raw_response: AsyncGroqWithRawResponse |
228 | 221 | with_streaming_response: AsyncGroqWithStreamedResponse |
229 | 222 |
|
@@ -281,10 +274,10 @@ def __init__( |
281 | 274 | _strict_response_validation=_strict_response_validation, |
282 | 275 | ) |
283 | 276 |
|
284 | | - self.chat = resources.AsyncChat(self) |
285 | | - self.embeddings = resources.AsyncEmbeddings(self) |
286 | | - self.audio = resources.AsyncAudio(self) |
287 | | - self.models = resources.AsyncModels(self) |
| 277 | + self.chat = chat.AsyncChat(self) |
| 278 | + self.embeddings = embeddings.AsyncEmbeddings(self) |
| 279 | + self.audio = audio.AsyncAudio(self) |
| 280 | + self.models = models.AsyncModels(self) |
288 | 281 | self.with_raw_response = AsyncGroqWithRawResponse(self) |
289 | 282 | self.with_streaming_response = AsyncGroqWithStreamedResponse(self) |
290 | 283 |
|
@@ -395,34 +388,34 @@ def _make_status_error( |
395 | 388 |
|
396 | 389 | class GroqWithRawResponse: |
397 | 390 | def __init__(self, client: Groq) -> None: |
398 | | - self.chat = resources.ChatWithRawResponse(client.chat) |
399 | | - self.embeddings = resources.EmbeddingsWithRawResponse(client.embeddings) |
400 | | - self.audio = resources.AudioWithRawResponse(client.audio) |
401 | | - self.models = resources.ModelsWithRawResponse(client.models) |
| 391 | + self.chat = chat.ChatWithRawResponse(client.chat) |
| 392 | + self.embeddings = embeddings.EmbeddingsWithRawResponse(client.embeddings) |
| 393 | + self.audio = audio.AudioWithRawResponse(client.audio) |
| 394 | + self.models = models.ModelsWithRawResponse(client.models) |
402 | 395 |
|
403 | 396 |
|
404 | 397 | class AsyncGroqWithRawResponse: |
405 | 398 | def __init__(self, client: AsyncGroq) -> None: |
406 | | - self.chat = resources.AsyncChatWithRawResponse(client.chat) |
407 | | - self.embeddings = resources.AsyncEmbeddingsWithRawResponse(client.embeddings) |
408 | | - self.audio = resources.AsyncAudioWithRawResponse(client.audio) |
409 | | - self.models = resources.AsyncModelsWithRawResponse(client.models) |
| 399 | + self.chat = chat.AsyncChatWithRawResponse(client.chat) |
| 400 | + self.embeddings = embeddings.AsyncEmbeddingsWithRawResponse(client.embeddings) |
| 401 | + self.audio = audio.AsyncAudioWithRawResponse(client.audio) |
| 402 | + self.models = models.AsyncModelsWithRawResponse(client.models) |
410 | 403 |
|
411 | 404 |
|
412 | 405 | class GroqWithStreamedResponse: |
413 | 406 | def __init__(self, client: Groq) -> None: |
414 | | - self.chat = resources.ChatWithStreamingResponse(client.chat) |
415 | | - self.embeddings = resources.EmbeddingsWithStreamingResponse(client.embeddings) |
416 | | - self.audio = resources.AudioWithStreamingResponse(client.audio) |
417 | | - self.models = resources.ModelsWithStreamingResponse(client.models) |
| 407 | + self.chat = chat.ChatWithStreamingResponse(client.chat) |
| 408 | + self.embeddings = embeddings.EmbeddingsWithStreamingResponse(client.embeddings) |
| 409 | + self.audio = audio.AudioWithStreamingResponse(client.audio) |
| 410 | + self.models = models.ModelsWithStreamingResponse(client.models) |
418 | 411 |
|
419 | 412 |
|
420 | 413 | class AsyncGroqWithStreamedResponse: |
421 | 414 | def __init__(self, client: AsyncGroq) -> None: |
422 | | - self.chat = resources.AsyncChatWithStreamingResponse(client.chat) |
423 | | - self.embeddings = resources.AsyncEmbeddingsWithStreamingResponse(client.embeddings) |
424 | | - self.audio = resources.AsyncAudioWithStreamingResponse(client.audio) |
425 | | - self.models = resources.AsyncModelsWithStreamingResponse(client.models) |
| 415 | + self.chat = chat.AsyncChatWithStreamingResponse(client.chat) |
| 416 | + self.embeddings = embeddings.AsyncEmbeddingsWithStreamingResponse(client.embeddings) |
| 417 | + self.audio = audio.AsyncAudioWithStreamingResponse(client.audio) |
| 418 | + self.models = models.AsyncModelsWithStreamingResponse(client.models) |
426 | 419 |
|
427 | 420 |
|
428 | 421 | Client = Groq |
|
0 commit comments