From 0b6256028e585728197c52748d81eb974580bda7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 17:41:01 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#46) --- src/groq/_client.py | 64 ++++++------ src/groq/resources/__init__.py | 96 +++++++++--------- src/groq/resources/audio/__init__.py | 72 +++++++------- src/groq/resources/audio/audio.py | 110 ++++++++++----------- src/groq/resources/audio/transcriptions.py | 38 +++---- src/groq/resources/audio/translations.py | 38 +++---- src/groq/resources/chat/__init__.py | 48 ++++----- src/groq/resources/chat/chat.py | 74 +++++++------- src/groq/resources/chat/completions.py | 38 +++---- src/groq/resources/embeddings.py | 38 +++---- src/groq/resources/models.py | 38 +++---- 11 files changed, 327 insertions(+), 327 deletions(-) diff --git a/src/groq/_client.py b/src/groq/_client.py index ebef538..1a5b0fa 100644 --- a/src/groq/_client.py +++ b/src/groq/_client.py @@ -46,10 +46,10 @@ class Groq(SyncAPIClient): - embeddings: resources.EmbeddingsResource - chat: resources.ChatResource - audio: resources.AudioResource - models: resources.ModelsResource + embeddings: resources.Embeddings + chat: resources.Chat + audio: resources.Audio + models: resources.Models with_raw_response: GroqWithRawResponse with_streaming_response: GroqWithStreamedResponse @@ -107,10 +107,10 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.embeddings = resources.EmbeddingsResource(self) - self.chat = resources.ChatResource(self) - self.audio = resources.AudioResource(self) - self.models = resources.ModelsResource(self) + self.embeddings = resources.Embeddings(self) + self.chat = resources.Chat(self) + self.audio = resources.Audio(self) + self.models = resources.Models(self) self.with_raw_response = GroqWithRawResponse(self) self.with_streaming_response = GroqWithStreamedResponse(self) @@ -220,10 +220,10 @@ def _make_status_error( class AsyncGroq(AsyncAPIClient): - embeddings: resources.AsyncEmbeddingsResource - chat: resources.AsyncChatResource - audio: resources.AsyncAudioResource - models: resources.AsyncModelsResource + embeddings: resources.AsyncEmbeddings + chat: resources.AsyncChat + audio: resources.AsyncAudio + models: resources.AsyncModels with_raw_response: AsyncGroqWithRawResponse with_streaming_response: AsyncGroqWithStreamedResponse @@ -281,10 +281,10 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.embeddings = resources.AsyncEmbeddingsResource(self) - self.chat = resources.AsyncChatResource(self) - self.audio = resources.AsyncAudioResource(self) - self.models = resources.AsyncModelsResource(self) + self.embeddings = resources.AsyncEmbeddings(self) + self.chat = resources.AsyncChat(self) + self.audio = resources.AsyncAudio(self) + self.models = resources.AsyncModels(self) self.with_raw_response = AsyncGroqWithRawResponse(self) self.with_streaming_response = AsyncGroqWithStreamedResponse(self) @@ -395,34 +395,34 @@ def _make_status_error( class GroqWithRawResponse: def __init__(self, client: Groq) -> None: - self.embeddings = resources.EmbeddingsResourceWithRawResponse(client.embeddings) - self.chat = resources.ChatResourceWithRawResponse(client.chat) - self.audio = resources.AudioResourceWithRawResponse(client.audio) - self.models = resources.ModelsResourceWithRawResponse(client.models) + self.embeddings = resources.EmbeddingsWithRawResponse(client.embeddings) + self.chat = resources.ChatWithRawResponse(client.chat) + self.audio = resources.AudioWithRawResponse(client.audio) + self.models = resources.ModelsWithRawResponse(client.models) class AsyncGroqWithRawResponse: def __init__(self, client: AsyncGroq) -> None: - self.embeddings = resources.AsyncEmbeddingsResourceWithRawResponse(client.embeddings) - self.chat = resources.AsyncChatResourceWithRawResponse(client.chat) - self.audio = resources.AsyncAudioResourceWithRawResponse(client.audio) - self.models = resources.AsyncModelsResourceWithRawResponse(client.models) + self.embeddings = resources.AsyncEmbeddingsWithRawResponse(client.embeddings) + self.chat = resources.AsyncChatWithRawResponse(client.chat) + self.audio = resources.AsyncAudioWithRawResponse(client.audio) + self.models = resources.AsyncModelsWithRawResponse(client.models) class GroqWithStreamedResponse: def __init__(self, client: Groq) -> None: - self.embeddings = resources.EmbeddingsResourceWithStreamingResponse(client.embeddings) - self.chat = resources.ChatResourceWithStreamingResponse(client.chat) - self.audio = resources.AudioResourceWithStreamingResponse(client.audio) - self.models = resources.ModelsResourceWithStreamingResponse(client.models) + self.embeddings = resources.EmbeddingsWithStreamingResponse(client.embeddings) + self.chat = resources.ChatWithStreamingResponse(client.chat) + self.audio = resources.AudioWithStreamingResponse(client.audio) + self.models = resources.ModelsWithStreamingResponse(client.models) class AsyncGroqWithStreamedResponse: def __init__(self, client: AsyncGroq) -> None: - self.embeddings = resources.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings) - self.chat = resources.AsyncChatResourceWithStreamingResponse(client.chat) - self.audio = resources.AsyncAudioResourceWithStreamingResponse(client.audio) - self.models = resources.AsyncModelsResourceWithStreamingResponse(client.models) + self.embeddings = resources.AsyncEmbeddingsWithStreamingResponse(client.embeddings) + self.chat = resources.AsyncChatWithStreamingResponse(client.chat) + self.audio = resources.AsyncAudioWithStreamingResponse(client.audio) + self.models = resources.AsyncModelsWithStreamingResponse(client.models) Client = Groq diff --git a/src/groq/resources/__init__.py b/src/groq/resources/__init__.py index 818b5d3..9fe7790 100644 --- a/src/groq/resources/__init__.py +++ b/src/groq/resources/__init__.py @@ -1,61 +1,61 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .chat import ( - ChatResource, - AsyncChatResource, - ChatResourceWithRawResponse, - AsyncChatResourceWithRawResponse, - ChatResourceWithStreamingResponse, - AsyncChatResourceWithStreamingResponse, + Chat, + AsyncChat, + ChatWithRawResponse, + AsyncChatWithRawResponse, + ChatWithStreamingResponse, + AsyncChatWithStreamingResponse, ) from .audio import ( - AudioResource, - AsyncAudioResource, - AudioResourceWithRawResponse, - AsyncAudioResourceWithRawResponse, - AudioResourceWithStreamingResponse, - AsyncAudioResourceWithStreamingResponse, + Audio, + AsyncAudio, + AudioWithRawResponse, + AsyncAudioWithRawResponse, + AudioWithStreamingResponse, + AsyncAudioWithStreamingResponse, ) from .models import ( - ModelsResource, - AsyncModelsResource, - ModelsResourceWithRawResponse, - AsyncModelsResourceWithRawResponse, - ModelsResourceWithStreamingResponse, - AsyncModelsResourceWithStreamingResponse, + Models, + AsyncModels, + ModelsWithRawResponse, + AsyncModelsWithRawResponse, + ModelsWithStreamingResponse, + AsyncModelsWithStreamingResponse, ) from .embeddings import ( - EmbeddingsResource, - AsyncEmbeddingsResource, - EmbeddingsResourceWithRawResponse, - AsyncEmbeddingsResourceWithRawResponse, - EmbeddingsResourceWithStreamingResponse, - AsyncEmbeddingsResourceWithStreamingResponse, + Embeddings, + AsyncEmbeddings, + EmbeddingsWithRawResponse, + AsyncEmbeddingsWithRawResponse, + EmbeddingsWithStreamingResponse, + AsyncEmbeddingsWithStreamingResponse, ) __all__ = [ - "EmbeddingsResource", - "AsyncEmbeddingsResource", - "EmbeddingsResourceWithRawResponse", - "AsyncEmbeddingsResourceWithRawResponse", - "EmbeddingsResourceWithStreamingResponse", - "AsyncEmbeddingsResourceWithStreamingResponse", - "ChatResource", - "AsyncChatResource", - "ChatResourceWithRawResponse", - "AsyncChatResourceWithRawResponse", - "ChatResourceWithStreamingResponse", - "AsyncChatResourceWithStreamingResponse", - "AudioResource", - "AsyncAudioResource", - "AudioResourceWithRawResponse", - "AsyncAudioResourceWithRawResponse", - "AudioResourceWithStreamingResponse", - "AsyncAudioResourceWithStreamingResponse", - "ModelsResource", - "AsyncModelsResource", - "ModelsResourceWithRawResponse", - "AsyncModelsResourceWithRawResponse", - "ModelsResourceWithStreamingResponse", - "AsyncModelsResourceWithStreamingResponse", + "Embeddings", + "AsyncEmbeddings", + "EmbeddingsWithRawResponse", + "AsyncEmbeddingsWithRawResponse", + "EmbeddingsWithStreamingResponse", + "AsyncEmbeddingsWithStreamingResponse", + "Chat", + "AsyncChat", + "ChatWithRawResponse", + "AsyncChatWithRawResponse", + "ChatWithStreamingResponse", + "AsyncChatWithStreamingResponse", + "Audio", + "AsyncAudio", + "AudioWithRawResponse", + "AsyncAudioWithRawResponse", + "AudioWithStreamingResponse", + "AsyncAudioWithStreamingResponse", + "Models", + "AsyncModels", + "ModelsWithRawResponse", + "AsyncModelsWithRawResponse", + "ModelsWithStreamingResponse", + "AsyncModelsWithStreamingResponse", ] diff --git a/src/groq/resources/audio/__init__.py b/src/groq/resources/audio/__init__.py index 934f87d..40e9ab2 100644 --- a/src/groq/resources/audio/__init__.py +++ b/src/groq/resources/audio/__init__.py @@ -1,47 +1,47 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .audio import ( - AudioResource, - AsyncAudioResource, - AudioResourceWithRawResponse, - AsyncAudioResourceWithRawResponse, - AudioResourceWithStreamingResponse, - AsyncAudioResourceWithStreamingResponse, + Audio, + AsyncAudio, + AudioWithRawResponse, + AsyncAudioWithRawResponse, + AudioWithStreamingResponse, + AsyncAudioWithStreamingResponse, ) from .translations import ( - TranslationsResource, - AsyncTranslationsResource, - TranslationsResourceWithRawResponse, - AsyncTranslationsResourceWithRawResponse, - TranslationsResourceWithStreamingResponse, - AsyncTranslationsResourceWithStreamingResponse, + Translations, + AsyncTranslations, + TranslationsWithRawResponse, + AsyncTranslationsWithRawResponse, + TranslationsWithStreamingResponse, + AsyncTranslationsWithStreamingResponse, ) from .transcriptions import ( - TranscriptionsResource, - AsyncTranscriptionsResource, - TranscriptionsResourceWithRawResponse, - AsyncTranscriptionsResourceWithRawResponse, - TranscriptionsResourceWithStreamingResponse, - AsyncTranscriptionsResourceWithStreamingResponse, + Transcriptions, + AsyncTranscriptions, + TranscriptionsWithRawResponse, + AsyncTranscriptionsWithRawResponse, + TranscriptionsWithStreamingResponse, + AsyncTranscriptionsWithStreamingResponse, ) __all__ = [ - "TranscriptionsResource", - "AsyncTranscriptionsResource", - "TranscriptionsResourceWithRawResponse", - "AsyncTranscriptionsResourceWithRawResponse", - "TranscriptionsResourceWithStreamingResponse", - "AsyncTranscriptionsResourceWithStreamingResponse", - "TranslationsResource", - "AsyncTranslationsResource", - "TranslationsResourceWithRawResponse", - "AsyncTranslationsResourceWithRawResponse", - "TranslationsResourceWithStreamingResponse", - "AsyncTranslationsResourceWithStreamingResponse", - "AudioResource", - "AsyncAudioResource", - "AudioResourceWithRawResponse", - "AsyncAudioResourceWithRawResponse", - "AudioResourceWithStreamingResponse", - "AsyncAudioResourceWithStreamingResponse", + "Transcriptions", + "AsyncTranscriptions", + "TranscriptionsWithRawResponse", + "AsyncTranscriptionsWithRawResponse", + "TranscriptionsWithStreamingResponse", + "AsyncTranscriptionsWithStreamingResponse", + "Translations", + "AsyncTranslations", + "TranslationsWithRawResponse", + "AsyncTranslationsWithRawResponse", + "TranslationsWithStreamingResponse", + "AsyncTranslationsWithStreamingResponse", + "Audio", + "AsyncAudio", + "AudioWithRawResponse", + "AsyncAudioWithRawResponse", + "AudioWithStreamingResponse", + "AsyncAudioWithStreamingResponse", ] diff --git a/src/groq/resources/audio/audio.py b/src/groq/resources/audio/audio.py index 003dc19..728ba29 100644 --- a/src/groq/resources/audio/audio.py +++ b/src/groq/resources/audio/audio.py @@ -5,108 +5,108 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from .translations import ( - TranslationsResource, - AsyncTranslationsResource, - TranslationsResourceWithRawResponse, - AsyncTranslationsResourceWithRawResponse, - TranslationsResourceWithStreamingResponse, - AsyncTranslationsResourceWithStreamingResponse, + Translations, + AsyncTranslations, + TranslationsWithRawResponse, + AsyncTranslationsWithRawResponse, + TranslationsWithStreamingResponse, + AsyncTranslationsWithStreamingResponse, ) from .transcriptions import ( - TranscriptionsResource, - AsyncTranscriptionsResource, - TranscriptionsResourceWithRawResponse, - AsyncTranscriptionsResourceWithRawResponse, - TranscriptionsResourceWithStreamingResponse, - AsyncTranscriptionsResourceWithStreamingResponse, + Transcriptions, + AsyncTranscriptions, + TranscriptionsWithRawResponse, + AsyncTranscriptionsWithRawResponse, + TranscriptionsWithStreamingResponse, + AsyncTranscriptionsWithStreamingResponse, ) -__all__ = ["AudioResource", "AsyncAudioResource"] +__all__ = ["Audio", "AsyncAudio"] -class AudioResource(SyncAPIResource): +class Audio(SyncAPIResource): @cached_property - def transcriptions(self) -> TranscriptionsResource: - return TranscriptionsResource(self._client) + def transcriptions(self) -> Transcriptions: + return Transcriptions(self._client) @cached_property - def translations(self) -> TranslationsResource: - return TranslationsResource(self._client) + def translations(self) -> Translations: + return Translations(self._client) @cached_property - def with_raw_response(self) -> AudioResourceWithRawResponse: - return AudioResourceWithRawResponse(self) + def with_raw_response(self) -> AudioWithRawResponse: + return AudioWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AudioResourceWithStreamingResponse: - return AudioResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AudioWithStreamingResponse: + return AudioWithStreamingResponse(self) -class AsyncAudioResource(AsyncAPIResource): +class AsyncAudio(AsyncAPIResource): @cached_property - def transcriptions(self) -> AsyncTranscriptionsResource: - return AsyncTranscriptionsResource(self._client) + def transcriptions(self) -> AsyncTranscriptions: + return AsyncTranscriptions(self._client) @cached_property - def translations(self) -> AsyncTranslationsResource: - return AsyncTranslationsResource(self._client) + def translations(self) -> AsyncTranslations: + return AsyncTranslations(self._client) @cached_property - def with_raw_response(self) -> AsyncAudioResourceWithRawResponse: - return AsyncAudioResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncAudioWithRawResponse: + return AsyncAudioWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncAudioResourceWithStreamingResponse: - return AsyncAudioResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncAudioWithStreamingResponse: + return AsyncAudioWithStreamingResponse(self) -class AudioResourceWithRawResponse: - def __init__(self, audio: AudioResource) -> None: +class AudioWithRawResponse: + def __init__(self, audio: Audio) -> None: self._audio = audio @cached_property - def transcriptions(self) -> TranscriptionsResourceWithRawResponse: - return TranscriptionsResourceWithRawResponse(self._audio.transcriptions) + def transcriptions(self) -> TranscriptionsWithRawResponse: + return TranscriptionsWithRawResponse(self._audio.transcriptions) @cached_property - def translations(self) -> TranslationsResourceWithRawResponse: - return TranslationsResourceWithRawResponse(self._audio.translations) + def translations(self) -> TranslationsWithRawResponse: + return TranslationsWithRawResponse(self._audio.translations) -class AsyncAudioResourceWithRawResponse: - def __init__(self, audio: AsyncAudioResource) -> None: +class AsyncAudioWithRawResponse: + def __init__(self, audio: AsyncAudio) -> None: self._audio = audio @cached_property - def transcriptions(self) -> AsyncTranscriptionsResourceWithRawResponse: - return AsyncTranscriptionsResourceWithRawResponse(self._audio.transcriptions) + def transcriptions(self) -> AsyncTranscriptionsWithRawResponse: + return AsyncTranscriptionsWithRawResponse(self._audio.transcriptions) @cached_property - def translations(self) -> AsyncTranslationsResourceWithRawResponse: - return AsyncTranslationsResourceWithRawResponse(self._audio.translations) + def translations(self) -> AsyncTranslationsWithRawResponse: + return AsyncTranslationsWithRawResponse(self._audio.translations) -class AudioResourceWithStreamingResponse: - def __init__(self, audio: AudioResource) -> None: +class AudioWithStreamingResponse: + def __init__(self, audio: Audio) -> None: self._audio = audio @cached_property - def transcriptions(self) -> TranscriptionsResourceWithStreamingResponse: - return TranscriptionsResourceWithStreamingResponse(self._audio.transcriptions) + def transcriptions(self) -> TranscriptionsWithStreamingResponse: + return TranscriptionsWithStreamingResponse(self._audio.transcriptions) @cached_property - def translations(self) -> TranslationsResourceWithStreamingResponse: - return TranslationsResourceWithStreamingResponse(self._audio.translations) + def translations(self) -> TranslationsWithStreamingResponse: + return TranslationsWithStreamingResponse(self._audio.translations) -class AsyncAudioResourceWithStreamingResponse: - def __init__(self, audio: AsyncAudioResource) -> None: +class AsyncAudioWithStreamingResponse: + def __init__(self, audio: AsyncAudio) -> None: self._audio = audio @cached_property - def transcriptions(self) -> AsyncTranscriptionsResourceWithStreamingResponse: - return AsyncTranscriptionsResourceWithStreamingResponse(self._audio.transcriptions) + def transcriptions(self) -> AsyncTranscriptionsWithStreamingResponse: + return AsyncTranscriptionsWithStreamingResponse(self._audio.transcriptions) @cached_property - def translations(self) -> AsyncTranslationsResourceWithStreamingResponse: - return AsyncTranslationsResourceWithStreamingResponse(self._audio.translations) + def translations(self) -> AsyncTranslationsWithStreamingResponse: + return AsyncTranslationsWithStreamingResponse(self._audio.translations) diff --git a/src/groq/resources/audio/transcriptions.py b/src/groq/resources/audio/transcriptions.py index c235030..6855273 100644 --- a/src/groq/resources/audio/transcriptions.py +++ b/src/groq/resources/audio/transcriptions.py @@ -28,17 +28,17 @@ ) from ...types.audio.transcription_create_response import TranscriptionCreateResponse -__all__ = ["TranscriptionsResource", "AsyncTranscriptionsResource"] +__all__ = ["Transcriptions", "AsyncTranscriptions"] -class TranscriptionsResource(SyncAPIResource): +class Transcriptions(SyncAPIResource): @cached_property - def with_raw_response(self) -> TranscriptionsResourceWithRawResponse: - return TranscriptionsResourceWithRawResponse(self) + def with_raw_response(self) -> TranscriptionsWithRawResponse: + return TranscriptionsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> TranscriptionsResourceWithStreamingResponse: - return TranscriptionsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> TranscriptionsWithStreamingResponse: + return TranscriptionsWithStreamingResponse(self) def create( self, @@ -131,14 +131,14 @@ def create( ) -class AsyncTranscriptionsResource(AsyncAPIResource): +class AsyncTranscriptions(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncTranscriptionsResourceWithRawResponse: - return AsyncTranscriptionsResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncTranscriptionsWithRawResponse: + return AsyncTranscriptionsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncTranscriptionsResourceWithStreamingResponse: - return AsyncTranscriptionsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncTranscriptionsWithStreamingResponse: + return AsyncTranscriptionsWithStreamingResponse(self) async def create( self, @@ -231,8 +231,8 @@ async def create( ) -class TranscriptionsResourceWithRawResponse: - def __init__(self, transcriptions: TranscriptionsResource) -> None: +class TranscriptionsWithRawResponse: + def __init__(self, transcriptions: Transcriptions) -> None: self._transcriptions = transcriptions self.create = to_raw_response_wrapper( @@ -240,8 +240,8 @@ def __init__(self, transcriptions: TranscriptionsResource) -> None: ) -class AsyncTranscriptionsResourceWithRawResponse: - def __init__(self, transcriptions: AsyncTranscriptionsResource) -> None: +class AsyncTranscriptionsWithRawResponse: + def __init__(self, transcriptions: AsyncTranscriptions) -> None: self._transcriptions = transcriptions self.create = async_to_raw_response_wrapper( @@ -249,8 +249,8 @@ def __init__(self, transcriptions: AsyncTranscriptionsResource) -> None: ) -class TranscriptionsResourceWithStreamingResponse: - def __init__(self, transcriptions: TranscriptionsResource) -> None: +class TranscriptionsWithStreamingResponse: + def __init__(self, transcriptions: Transcriptions) -> None: self._transcriptions = transcriptions self.create = to_streamed_response_wrapper( @@ -258,8 +258,8 @@ def __init__(self, transcriptions: TranscriptionsResource) -> None: ) -class AsyncTranscriptionsResourceWithStreamingResponse: - def __init__(self, transcriptions: AsyncTranscriptionsResource) -> None: +class AsyncTranscriptionsWithStreamingResponse: + def __init__(self, transcriptions: AsyncTranscriptions) -> None: self._transcriptions = transcriptions self.create = async_to_streamed_response_wrapper( diff --git a/src/groq/resources/audio/translations.py b/src/groq/resources/audio/translations.py index da09ad0..b1529e2 100644 --- a/src/groq/resources/audio/translations.py +++ b/src/groq/resources/audio/translations.py @@ -28,17 +28,17 @@ ) from ...types.audio.translation_create_response import TranslationCreateResponse -__all__ = ["TranslationsResource", "AsyncTranslationsResource"] +__all__ = ["Translations", "AsyncTranslations"] -class TranslationsResource(SyncAPIResource): +class Translations(SyncAPIResource): @cached_property - def with_raw_response(self) -> TranslationsResourceWithRawResponse: - return TranslationsResourceWithRawResponse(self) + def with_raw_response(self) -> TranslationsWithRawResponse: + return TranslationsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> TranslationsResourceWithStreamingResponse: - return TranslationsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> TranslationsWithStreamingResponse: + return TranslationsWithStreamingResponse(self) def create( self, @@ -116,14 +116,14 @@ def create( ) -class AsyncTranslationsResource(AsyncAPIResource): +class AsyncTranslations(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncTranslationsResourceWithRawResponse: - return AsyncTranslationsResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncTranslationsWithRawResponse: + return AsyncTranslationsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncTranslationsResourceWithStreamingResponse: - return AsyncTranslationsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncTranslationsWithStreamingResponse: + return AsyncTranslationsWithStreamingResponse(self) async def create( self, @@ -201,8 +201,8 @@ async def create( ) -class TranslationsResourceWithRawResponse: - def __init__(self, translations: TranslationsResource) -> None: +class TranslationsWithRawResponse: + def __init__(self, translations: Translations) -> None: self._translations = translations self.create = to_raw_response_wrapper( @@ -210,8 +210,8 @@ def __init__(self, translations: TranslationsResource) -> None: ) -class AsyncTranslationsResourceWithRawResponse: - def __init__(self, translations: AsyncTranslationsResource) -> None: +class AsyncTranslationsWithRawResponse: + def __init__(self, translations: AsyncTranslations) -> None: self._translations = translations self.create = async_to_raw_response_wrapper( @@ -219,8 +219,8 @@ def __init__(self, translations: AsyncTranslationsResource) -> None: ) -class TranslationsResourceWithStreamingResponse: - def __init__(self, translations: TranslationsResource) -> None: +class TranslationsWithStreamingResponse: + def __init__(self, translations: Translations) -> None: self._translations = translations self.create = to_streamed_response_wrapper( @@ -228,8 +228,8 @@ def __init__(self, translations: TranslationsResource) -> None: ) -class AsyncTranslationsResourceWithStreamingResponse: - def __init__(self, translations: AsyncTranslationsResource) -> None: +class AsyncTranslationsWithStreamingResponse: + def __init__(self, translations: AsyncTranslations) -> None: self._translations = translations self.create = async_to_streamed_response_wrapper( diff --git a/src/groq/resources/chat/__init__.py b/src/groq/resources/chat/__init__.py index ec960eb..52dfdce 100644 --- a/src/groq/resources/chat/__init__.py +++ b/src/groq/resources/chat/__init__.py @@ -1,33 +1,33 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .chat import ( - ChatResource, - AsyncChatResource, - ChatResourceWithRawResponse, - AsyncChatResourceWithRawResponse, - ChatResourceWithStreamingResponse, - AsyncChatResourceWithStreamingResponse, + Chat, + AsyncChat, + ChatWithRawResponse, + AsyncChatWithRawResponse, + ChatWithStreamingResponse, + AsyncChatWithStreamingResponse, ) from .completions import ( - CompletionsResource, - AsyncCompletionsResource, - CompletionsResourceWithRawResponse, - AsyncCompletionsResourceWithRawResponse, - CompletionsResourceWithStreamingResponse, - AsyncCompletionsResourceWithStreamingResponse, + Completions, + AsyncCompletions, + CompletionsWithRawResponse, + AsyncCompletionsWithRawResponse, + CompletionsWithStreamingResponse, + AsyncCompletionsWithStreamingResponse, ) __all__ = [ - "CompletionsResource", - "AsyncCompletionsResource", - "CompletionsResourceWithRawResponse", - "AsyncCompletionsResourceWithRawResponse", - "CompletionsResourceWithStreamingResponse", - "AsyncCompletionsResourceWithStreamingResponse", - "ChatResource", - "AsyncChatResource", - "ChatResourceWithRawResponse", - "AsyncChatResourceWithRawResponse", - "ChatResourceWithStreamingResponse", - "AsyncChatResourceWithStreamingResponse", + "Completions", + "AsyncCompletions", + "CompletionsWithRawResponse", + "AsyncCompletionsWithRawResponse", + "CompletionsWithStreamingResponse", + "AsyncCompletionsWithStreamingResponse", + "Chat", + "AsyncChat", + "ChatWithRawResponse", + "AsyncChatWithRawResponse", + "ChatWithStreamingResponse", + "AsyncChatWithStreamingResponse", ] diff --git a/src/groq/resources/chat/chat.py b/src/groq/resources/chat/chat.py index 3a74254..d14d055 100644 --- a/src/groq/resources/chat/chat.py +++ b/src/groq/resources/chat/chat.py @@ -5,76 +5,76 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from .completions import ( - CompletionsResource, - AsyncCompletionsResource, - CompletionsResourceWithRawResponse, - AsyncCompletionsResourceWithRawResponse, - CompletionsResourceWithStreamingResponse, - AsyncCompletionsResourceWithStreamingResponse, + Completions, + AsyncCompletions, + CompletionsWithRawResponse, + AsyncCompletionsWithRawResponse, + CompletionsWithStreamingResponse, + AsyncCompletionsWithStreamingResponse, ) -__all__ = ["ChatResource", "AsyncChatResource"] +__all__ = ["Chat", "AsyncChat"] -class ChatResource(SyncAPIResource): +class Chat(SyncAPIResource): @cached_property - def completions(self) -> CompletionsResource: - return CompletionsResource(self._client) + def completions(self) -> Completions: + return Completions(self._client) @cached_property - def with_raw_response(self) -> ChatResourceWithRawResponse: - return ChatResourceWithRawResponse(self) + def with_raw_response(self) -> ChatWithRawResponse: + return ChatWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ChatResourceWithStreamingResponse: - return ChatResourceWithStreamingResponse(self) + def with_streaming_response(self) -> ChatWithStreamingResponse: + return ChatWithStreamingResponse(self) -class AsyncChatResource(AsyncAPIResource): +class AsyncChat(AsyncAPIResource): @cached_property - def completions(self) -> AsyncCompletionsResource: - return AsyncCompletionsResource(self._client) + def completions(self) -> AsyncCompletions: + return AsyncCompletions(self._client) @cached_property - def with_raw_response(self) -> AsyncChatResourceWithRawResponse: - return AsyncChatResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncChatWithRawResponse: + return AsyncChatWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncChatResourceWithStreamingResponse: - return AsyncChatResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncChatWithStreamingResponse: + return AsyncChatWithStreamingResponse(self) -class ChatResourceWithRawResponse: - def __init__(self, chat: ChatResource) -> None: +class ChatWithRawResponse: + def __init__(self, chat: Chat) -> None: self._chat = chat @cached_property - def completions(self) -> CompletionsResourceWithRawResponse: - return CompletionsResourceWithRawResponse(self._chat.completions) + def completions(self) -> CompletionsWithRawResponse: + return CompletionsWithRawResponse(self._chat.completions) -class AsyncChatResourceWithRawResponse: - def __init__(self, chat: AsyncChatResource) -> None: +class AsyncChatWithRawResponse: + def __init__(self, chat: AsyncChat) -> None: self._chat = chat @cached_property - def completions(self) -> AsyncCompletionsResourceWithRawResponse: - return AsyncCompletionsResourceWithRawResponse(self._chat.completions) + def completions(self) -> AsyncCompletionsWithRawResponse: + return AsyncCompletionsWithRawResponse(self._chat.completions) -class ChatResourceWithStreamingResponse: - def __init__(self, chat: ChatResource) -> None: +class ChatWithStreamingResponse: + def __init__(self, chat: Chat) -> None: self._chat = chat @cached_property - def completions(self) -> CompletionsResourceWithStreamingResponse: - return CompletionsResourceWithStreamingResponse(self._chat.completions) + def completions(self) -> CompletionsWithStreamingResponse: + return CompletionsWithStreamingResponse(self._chat.completions) -class AsyncChatResourceWithStreamingResponse: - def __init__(self, chat: AsyncChatResource) -> None: +class AsyncChatWithStreamingResponse: + def __init__(self, chat: AsyncChat) -> None: self._chat = chat @cached_property - def completions(self) -> AsyncCompletionsResourceWithStreamingResponse: - return AsyncCompletionsResourceWithStreamingResponse(self._chat.completions) + def completions(self) -> AsyncCompletionsWithStreamingResponse: + return AsyncCompletionsWithStreamingResponse(self._chat.completions) diff --git a/src/groq/resources/chat/completions.py b/src/groq/resources/chat/completions.py index eac3816..28bba01 100644 --- a/src/groq/resources/chat/completions.py +++ b/src/groq/resources/chat/completions.py @@ -28,17 +28,17 @@ from ...lib.chat_completion_chunk import ChatCompletionChunk from ...types.chat.chat_completion import ChatCompletion -__all__ = ["CompletionsResource", "AsyncCompletionsResource"] +__all__ = ["Completions", "AsyncCompletions"] -class CompletionsResource(SyncAPIResource): +class Completions(SyncAPIResource): @cached_property - def with_raw_response(self) -> CompletionsResourceWithRawResponse: - return CompletionsResourceWithRawResponse(self) + def with_raw_response(self) -> CompletionsWithRawResponse: + return CompletionsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse: - return CompletionsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> CompletionsWithStreamingResponse: + return CompletionsWithStreamingResponse(self) @overload def create( @@ -210,14 +210,14 @@ def create( ) -class AsyncCompletionsResource(AsyncAPIResource): +class AsyncCompletions(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse: - return AsyncCompletionsResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncCompletionsWithRawResponse: + return AsyncCompletionsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingResponse: - return AsyncCompletionsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncCompletionsWithStreamingResponse: + return AsyncCompletionsWithStreamingResponse(self) @overload async def create( @@ -389,8 +389,8 @@ async def create( ) -class CompletionsResourceWithRawResponse: - def __init__(self, completions: CompletionsResource) -> None: +class CompletionsWithRawResponse: + def __init__(self, completions: Completions) -> None: self._completions = completions self.create = to_raw_response_wrapper( @@ -398,8 +398,8 @@ def __init__(self, completions: CompletionsResource) -> None: ) -class AsyncCompletionsResourceWithRawResponse: - def __init__(self, completions: AsyncCompletionsResource) -> None: +class AsyncCompletionsWithRawResponse: + def __init__(self, completions: AsyncCompletions) -> None: self._completions = completions self.create = async_to_raw_response_wrapper( @@ -407,8 +407,8 @@ def __init__(self, completions: AsyncCompletionsResource) -> None: ) -class CompletionsResourceWithStreamingResponse: - def __init__(self, completions: CompletionsResource) -> None: +class CompletionsWithStreamingResponse: + def __init__(self, completions: Completions) -> None: self._completions = completions self.create = to_streamed_response_wrapper( @@ -416,8 +416,8 @@ def __init__(self, completions: CompletionsResource) -> None: ) -class AsyncCompletionsResourceWithStreamingResponse: - def __init__(self, completions: AsyncCompletionsResource) -> None: +class AsyncCompletionsWithStreamingResponse: + def __init__(self, completions: AsyncCompletions) -> None: self._completions = completions self.create = async_to_streamed_response_wrapper( diff --git a/src/groq/resources/embeddings.py b/src/groq/resources/embeddings.py index 41dd458..157eddb 100644 --- a/src/groq/resources/embeddings.py +++ b/src/groq/resources/embeddings.py @@ -26,17 +26,17 @@ ) from ..types.create_embedding_response import CreateEmbeddingResponse -__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"] +__all__ = ["Embeddings", "AsyncEmbeddings"] -class EmbeddingsResource(SyncAPIResource): +class Embeddings(SyncAPIResource): @cached_property - def with_raw_response(self) -> EmbeddingsResourceWithRawResponse: - return EmbeddingsResourceWithRawResponse(self) + def with_raw_response(self) -> EmbeddingsWithRawResponse: + return EmbeddingsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> EmbeddingsResourceWithStreamingResponse: - return EmbeddingsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> EmbeddingsWithStreamingResponse: + return EmbeddingsWithStreamingResponse(self) def create( self, @@ -98,14 +98,14 @@ def create( ) -class AsyncEmbeddingsResource(AsyncAPIResource): +class AsyncEmbeddings(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncEmbeddingsResourceWithRawResponse: - return AsyncEmbeddingsResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncEmbeddingsWithRawResponse: + return AsyncEmbeddingsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncEmbeddingsResourceWithStreamingResponse: - return AsyncEmbeddingsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncEmbeddingsWithStreamingResponse: + return AsyncEmbeddingsWithStreamingResponse(self) async def create( self, @@ -167,8 +167,8 @@ async def create( ) -class EmbeddingsResourceWithRawResponse: - def __init__(self, embeddings: EmbeddingsResource) -> None: +class EmbeddingsWithRawResponse: + def __init__(self, embeddings: Embeddings) -> None: self._embeddings = embeddings self.create = to_raw_response_wrapper( @@ -176,8 +176,8 @@ def __init__(self, embeddings: EmbeddingsResource) -> None: ) -class AsyncEmbeddingsResourceWithRawResponse: - def __init__(self, embeddings: AsyncEmbeddingsResource) -> None: +class AsyncEmbeddingsWithRawResponse: + def __init__(self, embeddings: AsyncEmbeddings) -> None: self._embeddings = embeddings self.create = async_to_raw_response_wrapper( @@ -185,8 +185,8 @@ def __init__(self, embeddings: AsyncEmbeddingsResource) -> None: ) -class EmbeddingsResourceWithStreamingResponse: - def __init__(self, embeddings: EmbeddingsResource) -> None: +class EmbeddingsWithStreamingResponse: + def __init__(self, embeddings: Embeddings) -> None: self._embeddings = embeddings self.create = to_streamed_response_wrapper( @@ -194,8 +194,8 @@ def __init__(self, embeddings: EmbeddingsResource) -> None: ) -class AsyncEmbeddingsResourceWithStreamingResponse: - def __init__(self, embeddings: AsyncEmbeddingsResource) -> None: +class AsyncEmbeddingsWithStreamingResponse: + def __init__(self, embeddings: AsyncEmbeddings) -> None: self._embeddings = embeddings self.create = async_to_streamed_response_wrapper( diff --git a/src/groq/resources/models.py b/src/groq/resources/models.py index 3fdb482..c5fff9b 100644 --- a/src/groq/resources/models.py +++ b/src/groq/resources/models.py @@ -19,17 +19,17 @@ ) from ..types.model_list import ModelList -__all__ = ["ModelsResource", "AsyncModelsResource"] +__all__ = ["Models", "AsyncModels"] -class ModelsResource(SyncAPIResource): +class Models(SyncAPIResource): @cached_property - def with_raw_response(self) -> ModelsResourceWithRawResponse: - return ModelsResourceWithRawResponse(self) + def with_raw_response(self) -> ModelsWithRawResponse: + return ModelsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: - return ModelsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> ModelsWithStreamingResponse: + return ModelsWithStreamingResponse(self) def retrieve( self, @@ -118,14 +118,14 @@ def delete( ) -class AsyncModelsResource(AsyncAPIResource): +class AsyncModels(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: - return AsyncModelsResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncModelsWithRawResponse: + return AsyncModelsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: - return AsyncModelsResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncModelsWithStreamingResponse: + return AsyncModelsWithStreamingResponse(self) async def retrieve( self, @@ -214,8 +214,8 @@ async def delete( ) -class ModelsResourceWithRawResponse: - def __init__(self, models: ModelsResource) -> None: +class ModelsWithRawResponse: + def __init__(self, models: Models) -> None: self._models = models self.retrieve = to_raw_response_wrapper( @@ -229,8 +229,8 @@ def __init__(self, models: ModelsResource) -> None: ) -class AsyncModelsResourceWithRawResponse: - def __init__(self, models: AsyncModelsResource) -> None: +class AsyncModelsWithRawResponse: + def __init__(self, models: AsyncModels) -> None: self._models = models self.retrieve = async_to_raw_response_wrapper( @@ -244,8 +244,8 @@ def __init__(self, models: AsyncModelsResource) -> None: ) -class ModelsResourceWithStreamingResponse: - def __init__(self, models: ModelsResource) -> None: +class ModelsWithStreamingResponse: + def __init__(self, models: Models) -> None: self._models = models self.retrieve = to_streamed_response_wrapper( @@ -259,8 +259,8 @@ def __init__(self, models: ModelsResource) -> None: ) -class AsyncModelsResourceWithStreamingResponse: - def __init__(self, models: AsyncModelsResource) -> None: +class AsyncModelsWithStreamingResponse: + def __init__(self, models: AsyncModels) -> None: self._models = models self.retrieve = async_to_streamed_response_wrapper(