From 3f41c12bd36e13eba37d2bd7fd4f3f595bda4602 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:33:29 +0000 Subject: [PATCH] chore(internal): updated imports (#156) --- src/groq/_client.py | 81 +++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/src/groq/_client.py b/src/groq/_client.py index 87f6486..f8d0c19 100644 --- a/src/groq/_client.py +++ b/src/groq/_client.py @@ -8,7 +8,7 @@ import httpx -from . import resources, _exceptions +from . import _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -24,6 +24,7 @@ get_async_library, ) from ._version import __version__ +from .resources import models, embeddings from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import GroqError, APIStatusError from ._base_client import ( @@ -31,25 +32,17 @@ SyncAPIClient, AsyncAPIClient, ) +from .resources.chat import chat +from .resources.audio import audio -__all__ = [ - "Timeout", - "Transport", - "ProxiesTypes", - "RequestOptions", - "resources", - "Groq", - "AsyncGroq", - "Client", - "AsyncClient", -] +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Groq", "AsyncGroq", "Client", "AsyncClient"] class Groq(SyncAPIClient): - chat: resources.Chat - embeddings: resources.Embeddings - audio: resources.Audio - models: resources.Models + chat: chat.Chat + embeddings: embeddings.Embeddings + audio: audio.Audio + models: models.Models with_raw_response: GroqWithRawResponse with_streaming_response: GroqWithStreamedResponse @@ -107,10 +100,10 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.chat = resources.Chat(self) - self.embeddings = resources.Embeddings(self) - self.audio = resources.Audio(self) - self.models = resources.Models(self) + self.chat = chat.Chat(self) + self.embeddings = embeddings.Embeddings(self) + self.audio = audio.Audio(self) + self.models = models.Models(self) self.with_raw_response = GroqWithRawResponse(self) self.with_streaming_response = GroqWithStreamedResponse(self) @@ -220,10 +213,10 @@ def _make_status_error( class AsyncGroq(AsyncAPIClient): - chat: resources.AsyncChat - embeddings: resources.AsyncEmbeddings - audio: resources.AsyncAudio - models: resources.AsyncModels + chat: chat.AsyncChat + embeddings: embeddings.AsyncEmbeddings + audio: audio.AsyncAudio + models: models.AsyncModels with_raw_response: AsyncGroqWithRawResponse with_streaming_response: AsyncGroqWithStreamedResponse @@ -281,10 +274,10 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.chat = resources.AsyncChat(self) - self.embeddings = resources.AsyncEmbeddings(self) - self.audio = resources.AsyncAudio(self) - self.models = resources.AsyncModels(self) + self.chat = chat.AsyncChat(self) + self.embeddings = embeddings.AsyncEmbeddings(self) + self.audio = audio.AsyncAudio(self) + self.models = models.AsyncModels(self) self.with_raw_response = AsyncGroqWithRawResponse(self) self.with_streaming_response = AsyncGroqWithStreamedResponse(self) @@ -395,34 +388,34 @@ def _make_status_error( class GroqWithRawResponse: def __init__(self, client: Groq) -> None: - self.chat = resources.ChatWithRawResponse(client.chat) - self.embeddings = resources.EmbeddingsWithRawResponse(client.embeddings) - self.audio = resources.AudioWithRawResponse(client.audio) - self.models = resources.ModelsWithRawResponse(client.models) + self.chat = chat.ChatWithRawResponse(client.chat) + self.embeddings = embeddings.EmbeddingsWithRawResponse(client.embeddings) + self.audio = audio.AudioWithRawResponse(client.audio) + self.models = models.ModelsWithRawResponse(client.models) class AsyncGroqWithRawResponse: def __init__(self, client: AsyncGroq) -> None: - self.chat = resources.AsyncChatWithRawResponse(client.chat) - self.embeddings = resources.AsyncEmbeddingsWithRawResponse(client.embeddings) - self.audio = resources.AsyncAudioWithRawResponse(client.audio) - self.models = resources.AsyncModelsWithRawResponse(client.models) + self.chat = chat.AsyncChatWithRawResponse(client.chat) + self.embeddings = embeddings.AsyncEmbeddingsWithRawResponse(client.embeddings) + self.audio = audio.AsyncAudioWithRawResponse(client.audio) + self.models = models.AsyncModelsWithRawResponse(client.models) class GroqWithStreamedResponse: def __init__(self, client: Groq) -> None: - self.chat = resources.ChatWithStreamingResponse(client.chat) - self.embeddings = resources.EmbeddingsWithStreamingResponse(client.embeddings) - self.audio = resources.AudioWithStreamingResponse(client.audio) - self.models = resources.ModelsWithStreamingResponse(client.models) + self.chat = chat.ChatWithStreamingResponse(client.chat) + self.embeddings = embeddings.EmbeddingsWithStreamingResponse(client.embeddings) + self.audio = audio.AudioWithStreamingResponse(client.audio) + self.models = models.ModelsWithStreamingResponse(client.models) class AsyncGroqWithStreamedResponse: def __init__(self, client: AsyncGroq) -> None: - self.chat = resources.AsyncChatWithStreamingResponse(client.chat) - self.embeddings = resources.AsyncEmbeddingsWithStreamingResponse(client.embeddings) - self.audio = resources.AsyncAudioWithStreamingResponse(client.audio) - self.models = resources.AsyncModelsWithStreamingResponse(client.models) + self.chat = chat.AsyncChatWithStreamingResponse(client.chat) + self.embeddings = embeddings.AsyncEmbeddingsWithStreamingResponse(client.embeddings) + self.audio = audio.AsyncAudioWithStreamingResponse(client.audio) + self.models = models.AsyncModelsWithStreamingResponse(client.models) Client = Groq