mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
rename llms/OpenAI/
-> llms/openai/
(#7154)
* rename OpenAI -> openai * fix file rename * fix rename changes * fix organization of openai/transcription * fix import OA fine tuning API * fix openai ft handler * fix handler import
This commit is contained in:
parent
61afdab228
commit
5ad57dd54b
48 changed files with 53 additions and 59 deletions
|
@ -1134,26 +1134,26 @@ from .llms.bedrock.embed.amazon_titan_v2_transformation import (
|
||||||
)
|
)
|
||||||
from .llms.cohere.chat.transformation import CohereChatConfig
|
from .llms.cohere.chat.transformation import CohereChatConfig
|
||||||
from .llms.bedrock.embed.cohere_transformation import BedrockCohereEmbeddingConfig
|
from .llms.bedrock.embed.cohere_transformation import BedrockCohereEmbeddingConfig
|
||||||
from .llms.OpenAI.openai import (
|
from .llms.openai.openai import (
|
||||||
OpenAIConfig,
|
OpenAIConfig,
|
||||||
MistralEmbeddingConfig,
|
MistralEmbeddingConfig,
|
||||||
DeepInfraConfig,
|
DeepInfraConfig,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.completion.transformation import OpenAITextCompletionConfig
|
from litellm.llms.openai.completion.transformation import OpenAITextCompletionConfig
|
||||||
from .llms.groq.chat.transformation import GroqChatConfig
|
from .llms.groq.chat.transformation import GroqChatConfig
|
||||||
from .llms.azure_ai.chat.transformation import AzureAIStudioConfig
|
from .llms.azure_ai.chat.transformation import AzureAIStudioConfig
|
||||||
from .llms.mistral.mistral_chat_transformation import MistralConfig
|
from .llms.mistral.mistral_chat_transformation import MistralConfig
|
||||||
from .llms.OpenAI.chat.o1_transformation import (
|
from .llms.openai.chat.o1_transformation import (
|
||||||
OpenAIO1Config,
|
OpenAIO1Config,
|
||||||
)
|
)
|
||||||
|
|
||||||
openAIO1Config = OpenAIO1Config()
|
openAIO1Config = OpenAIO1Config()
|
||||||
from .llms.OpenAI.chat.gpt_transformation import (
|
from .llms.openai.chat.gpt_transformation import (
|
||||||
OpenAIGPTConfig,
|
OpenAIGPTConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
openAIGPTConfig = OpenAIGPTConfig()
|
openAIGPTConfig = OpenAIGPTConfig()
|
||||||
from .llms.OpenAI.chat.gpt_audio_transformation import (
|
from .llms.openai.chat.gpt_audio_transformation import (
|
||||||
OpenAIGPTAudioConfig,
|
OpenAIGPTAudioConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ from litellm.utils import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..llms.azure.assistants import AzureAssistantsAPI
|
from ..llms.azure.assistants import AzureAssistantsAPI
|
||||||
from ..llms.OpenAI.openai import OpenAIAssistantsAPI
|
from ..llms.openai.openai import OpenAIAssistantsAPI
|
||||||
from ..types.llms.openai import *
|
from ..types.llms.openai import *
|
||||||
from ..types.router import *
|
from ..types.router import *
|
||||||
from .utils import get_optional_params_add_message
|
from .utils import get_optional_params_add_message
|
||||||
|
|
|
@ -21,7 +21,7 @@ import httpx
|
||||||
import litellm
|
import litellm
|
||||||
from litellm import client
|
from litellm import client
|
||||||
from litellm.llms.azure.azure import AzureBatchesAPI
|
from litellm.llms.azure.azure import AzureBatchesAPI
|
||||||
from litellm.llms.OpenAI.openai import OpenAIBatchesAPI
|
from litellm.llms.openai.openai import OpenAIBatchesAPI
|
||||||
from litellm.llms.vertex_ai_and_google_ai_studio.batches.handler import (
|
from litellm.llms.vertex_ai_and_google_ai_studio.batches.handler import (
|
||||||
VertexAIBatchPrediction,
|
VertexAIBatchPrediction,
|
||||||
)
|
)
|
||||||
|
|
|
@ -40,11 +40,11 @@ from litellm.llms.databricks.cost_calculator import (
|
||||||
from litellm.llms.fireworks_ai.cost_calculator import (
|
from litellm.llms.fireworks_ai.cost_calculator import (
|
||||||
cost_per_token as fireworks_ai_cost_per_token,
|
cost_per_token as fireworks_ai_cost_per_token,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.cost_calculation import (
|
from litellm.llms.openai.cost_calculation import (
|
||||||
cost_per_second as openai_cost_per_second,
|
cost_per_second as openai_cost_per_second,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.cost_calculation import cost_per_token as openai_cost_per_token
|
from litellm.llms.openai.cost_calculation import cost_per_token as openai_cost_per_token
|
||||||
from litellm.llms.OpenAI.cost_calculation import cost_router as openai_cost_router
|
from litellm.llms.openai.cost_calculation import cost_router as openai_cost_router
|
||||||
from litellm.llms.together_ai.cost_calculator import get_model_params_and_category
|
from litellm.llms.together_ai.cost_calculator import get_model_params_and_category
|
||||||
from litellm.llms.vertex_ai_and_google_ai_studio.image_generation.cost_calculator import (
|
from litellm.llms.vertex_ai_and_google_ai_studio.image_generation.cost_calculator import (
|
||||||
cost_calculator as vertex_ai_image_cost_calculator,
|
cost_calculator as vertex_ai_image_cost_calculator,
|
||||||
|
|
|
@ -16,7 +16,7 @@ import httpx
|
||||||
import litellm
|
import litellm
|
||||||
from litellm import client, get_secret_str
|
from litellm import client, get_secret_str
|
||||||
from litellm.llms.files_apis.azure import AzureOpenAIFilesAPI
|
from litellm.llms.files_apis.azure import AzureOpenAIFilesAPI
|
||||||
from litellm.llms.OpenAI.openai import FileDeleted, FileObject, OpenAIFilesAPI
|
from litellm.llms.openai.openai import FileDeleted, FileObject, OpenAIFilesAPI
|
||||||
from litellm.llms.vertex_ai_and_google_ai_studio.files.handler import (
|
from litellm.llms.vertex_ai_and_google_ai_studio.files.handler import (
|
||||||
VertexAIFilesHandler,
|
VertexAIFilesHandler,
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,11 +19,7 @@ import httpx
|
||||||
import litellm
|
import litellm
|
||||||
from litellm._logging import verbose_logger
|
from litellm._logging import verbose_logger
|
||||||
from litellm.llms.fine_tuning_apis.azure import AzureOpenAIFineTuningAPI
|
from litellm.llms.fine_tuning_apis.azure import AzureOpenAIFineTuningAPI
|
||||||
from litellm.llms.fine_tuning_apis.openai import (
|
from litellm.llms.openai.fine_tuning.handler import OpenAIFineTuningAPI, FineTuningJob, FineTuningJobCreate
|
||||||
FineTuningJob,
|
|
||||||
FineTuningJobCreate,
|
|
||||||
OpenAIFineTuningAPI,
|
|
||||||
)
|
|
||||||
from litellm.llms.fine_tuning_apis.vertex_ai import VertexFineTuningAPI
|
from litellm.llms.fine_tuning_apis.vertex_ai import VertexFineTuningAPI
|
||||||
from litellm.secret_managers.main import get_secret_str
|
from litellm.secret_managers.main import get_secret_str
|
||||||
from litellm.types.llms.openai import Hyperparameters
|
from litellm.types.llms.openai import Hyperparameters
|
||||||
|
|
|
@ -476,7 +476,7 @@ class AzureAssistantsAPI(BaseLLM):
|
||||||
"""
|
"""
|
||||||
Here's an example:
|
Here's an example:
|
||||||
```
|
```
|
||||||
from litellm.llms.OpenAI.openai import OpenAIAssistantsAPI, MessageData
|
from litellm.llms.openai.openai import OpenAIAssistantsAPI, MessageData
|
||||||
|
|
||||||
# create thread
|
# create thread
|
||||||
message: MessageData = {"role": "user", "content": "Hey, how's it going?"}
|
message: MessageData = {"role": "user", "content": "Hey, how's it going?"}
|
||||||
|
|
|
@ -18,7 +18,7 @@ from typing import Any, List, Optional, Union
|
||||||
import litellm
|
import litellm
|
||||||
from litellm.types.llms.openai import AllMessageValues, ChatCompletionUserMessage
|
from litellm.types.llms.openai import AllMessageValues, ChatCompletionUserMessage
|
||||||
|
|
||||||
from ...OpenAI.chat.o1_transformation import OpenAIO1Config
|
from ...openai.chat.o1_transformation import OpenAIO1Config
|
||||||
|
|
||||||
|
|
||||||
class AzureOpenAIO1Config(OpenAIO1Config):
|
class AzureOpenAIO1Config(OpenAIO1Config):
|
||||||
|
|
|
@ -3,7 +3,7 @@ from typing import Any, Callable, List, Optional, Union
|
||||||
from httpx._config import Timeout
|
from httpx._config import Timeout
|
||||||
|
|
||||||
from litellm.llms.bedrock.chat.invoke_handler import MockResponseIterator
|
from litellm.llms.bedrock.chat.invoke_handler import MockResponseIterator
|
||||||
from litellm.llms.OpenAI.openai import OpenAIChatCompletion
|
from litellm.llms.openai.openai import OpenAIChatCompletion
|
||||||
from litellm.types.utils import ModelResponse
|
from litellm.types.utils import ModelResponse
|
||||||
from litellm.utils import CustomStreamWrapper
|
from litellm.utils import CustomStreamWrapper
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ from typing import List, Optional, Tuple
|
||||||
|
|
||||||
import litellm
|
import litellm
|
||||||
from litellm._logging import verbose_logger
|
from litellm._logging import verbose_logger
|
||||||
from litellm.llms.OpenAI.openai import OpenAIConfig
|
from litellm.llms.openai.openai import OpenAIConfig
|
||||||
from litellm.llms.prompt_templates.common_utils import (
|
from litellm.llms.prompt_templates.common_utils import (
|
||||||
_audio_or_image_in_message_content,
|
_audio_or_image_in_message_content,
|
||||||
convert_content_list_to_str,
|
convert_content_list_to_str,
|
||||||
|
|
|
@ -16,7 +16,7 @@ from litellm.llms.custom_httpx.http_handler import (
|
||||||
_get_httpx_client,
|
_get_httpx_client,
|
||||||
get_async_httpx_client,
|
get_async_httpx_client,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.openai import OpenAIChatCompletion
|
from litellm.llms.openai.openai import OpenAIChatCompletion
|
||||||
from litellm.types.llms.azure_ai import ImageEmbeddingRequest
|
from litellm.types.llms.azure_ai import ImageEmbeddingRequest
|
||||||
from litellm.types.utils import Embedding, EmbeddingResponse
|
from litellm.types.utils import Embedding, EmbeddingResponse
|
||||||
from litellm.utils import convert_to_model_response_object, is_base64_encoded
|
from litellm.utils import convert_to_model_response_object, is_base64_encoded
|
||||||
|
|
|
@ -20,8 +20,8 @@ from litellm.utils import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from .base import BaseLLM
|
from .base import BaseLLM
|
||||||
from .OpenAI.completion.handler import OpenAITextCompletion
|
from .openai.completion.handler import OpenAITextCompletion
|
||||||
from .OpenAI.completion.transformation import OpenAITextCompletionConfig
|
from .openai.completion.transformation import OpenAITextCompletionConfig
|
||||||
from .prompt_templates.factory import custom_prompt, prompt_factory
|
from .prompt_templates.factory import custom_prompt, prompt_factory
|
||||||
|
|
||||||
openai_text_completion_config = OpenAITextCompletionConfig()
|
openai_text_completion_config = OpenAITextCompletionConfig()
|
||||||
|
|
|
@ -10,7 +10,7 @@ from pydantic import BaseModel
|
||||||
from litellm.types.llms.openai import AllMessageValues
|
from litellm.types.llms.openai import AllMessageValues
|
||||||
from litellm.types.utils import ProviderField
|
from litellm.types.utils import ProviderField
|
||||||
|
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
from ...prompt_templates.common_utils import (
|
from ...prompt_templates.common_utils import (
|
||||||
handle_messages_with_content_list_to_str_conversion,
|
handle_messages_with_content_list_to_str_conversion,
|
||||||
strip_name_from_messages,
|
strip_name_from_messages,
|
||||||
|
|
|
@ -12,7 +12,7 @@ from litellm.secret_managers.main import get_secret_str
|
||||||
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
||||||
|
|
||||||
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
from ...prompt_templates.common_utils import (
|
from ...prompt_templates.common_utils import (
|
||||||
handle_messages_with_content_list_to_str_conversion,
|
handle_messages_with_content_list_to_str_conversion,
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@ from typing import Literal, Optional, Tuple, Union
|
||||||
|
|
||||||
from litellm.secret_managers.main import get_secret_str
|
from litellm.secret_managers.main import get_secret_str
|
||||||
|
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
from ..embed.fireworks_ai_transformation import FireworksAIEmbeddingConfig
|
from ..embed.fireworks_ai_transformation import FireworksAIEmbeddingConfig
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ from litellm.types.llms.openai import (
|
||||||
ChatCompletionToolParamFunctionChunk,
|
ChatCompletionToolParamFunctionChunk,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class GroqChatConfig(OpenAIGPTConfig):
|
class GroqChatConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -12,7 +12,7 @@ from litellm.secret_managers.main import get_secret_str
|
||||||
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
||||||
|
|
||||||
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class HostedVLLMChatConfig(OpenAIGPTConfig):
|
class HostedVLLMChatConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -12,7 +12,7 @@ from litellm.secret_managers.main import get_secret_str
|
||||||
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
||||||
|
|
||||||
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class LMStudioChatConfig(OpenAIGPTConfig):
|
class LMStudioChatConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -10,7 +10,7 @@ from typing import Any, Callable, List, Optional, Union
|
||||||
from httpx._config import Timeout
|
from httpx._config import Timeout
|
||||||
|
|
||||||
from litellm.llms.bedrock.chat.invoke_handler import MockResponseIterator
|
from litellm.llms.bedrock.chat.invoke_handler import MockResponseIterator
|
||||||
from litellm.llms.OpenAI.openai import OpenAIChatCompletion
|
from litellm.llms.openai.openai import OpenAIChatCompletion
|
||||||
from litellm.types.utils import ModelResponse
|
from litellm.types.utils import ModelResponse
|
||||||
from litellm.utils import CustomStreamWrapper
|
from litellm.utils import CustomStreamWrapper
|
||||||
|
|
|
@ -6,11 +6,10 @@ from openai.pagination import AsyncCursorPage
|
||||||
from openai.types.fine_tuning import FineTuningJob
|
from openai.types.fine_tuning import FineTuningJob
|
||||||
|
|
||||||
from litellm._logging import verbose_logger
|
from litellm._logging import verbose_logger
|
||||||
from litellm.llms.base import BaseLLM
|
|
||||||
from litellm.types.llms.openai import FineTuningJobCreate
|
from litellm.types.llms.openai import FineTuningJobCreate
|
||||||
|
|
||||||
|
|
||||||
class OpenAIFineTuningAPI(BaseLLM):
|
class OpenAIFineTuningAPI:
|
||||||
"""
|
"""
|
||||||
OpenAI methods to support for batches
|
OpenAI methods to support for batches
|
||||||
"""
|
"""
|
|
@ -9,8 +9,7 @@ from litellm.litellm_core_utils.audio_utils.utils import get_audio_file_name
|
||||||
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
|
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
|
||||||
from litellm.types.utils import FileTypes
|
from litellm.types.utils import FileTypes
|
||||||
from litellm.utils import TranscriptionResponse, convert_to_model_response_object
|
from litellm.utils import TranscriptionResponse, convert_to_model_response_object
|
||||||
|
from ..openai import OpenAIChatCompletion
|
||||||
from .openai import OpenAIChatCompletion
|
|
||||||
|
|
||||||
|
|
||||||
class OpenAIAudioTranscription(OpenAIChatCompletion):
|
class OpenAIAudioTranscription(OpenAIChatCompletion):
|
|
@ -14,7 +14,7 @@ from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantM
|
||||||
from litellm.types.utils import ModelResponse
|
from litellm.types.utils import ModelResponse
|
||||||
|
|
||||||
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class OpenAILikeChatConfig(OpenAIGPTConfig):
|
class OpenAILikeChatConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -12,7 +12,7 @@ from litellm.secret_managers.main import get_secret_str
|
||||||
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
||||||
|
|
||||||
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class PerplexityChatConfig(OpenAIGPTConfig):
|
class PerplexityChatConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -10,7 +10,7 @@ from typing import Optional
|
||||||
|
|
||||||
from litellm import get_model_info, verbose_logger
|
from litellm import get_model_info, verbose_logger
|
||||||
|
|
||||||
from ..OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ..openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class TogetherAIConfig(OpenAIGPTConfig):
|
class TogetherAIConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -12,7 +12,7 @@ from litellm.litellm_core_utils.litellm_logging import Logging
|
||||||
from litellm.types.llms.openai import AllMessageValues, OpenAITextCompletionUserMessage
|
from litellm.types.llms.openai import AllMessageValues, OpenAITextCompletionUserMessage
|
||||||
from litellm.utils import ModelResponse
|
from litellm.utils import ModelResponse
|
||||||
|
|
||||||
from ...OpenAI.completion.handler import OpenAITextCompletion
|
from ...openai.completion.handler import OpenAITextCompletion
|
||||||
from .transformation import TogetherAITextCompletionConfig
|
from .transformation import TogetherAITextCompletionConfig
|
||||||
|
|
||||||
together_ai_text_completion_global_config = TogetherAITextCompletionConfig()
|
together_ai_text_completion_global_config = TogetherAITextCompletionConfig()
|
||||||
|
|
|
@ -8,14 +8,14 @@ Docs: https://docs.together.ai/reference/completions-1
|
||||||
|
|
||||||
from typing import List, Union, cast
|
from typing import List, Union, cast
|
||||||
|
|
||||||
from litellm.llms.OpenAI.completion.utils import is_tokens_or_list_of_tokens
|
from litellm.llms.openai.completion.utils import is_tokens_or_list_of_tokens
|
||||||
from litellm.types.llms.openai import (
|
from litellm.types.llms.openai import (
|
||||||
AllMessageValues,
|
AllMessageValues,
|
||||||
AllPromptValues,
|
AllPromptValues,
|
||||||
OpenAITextCompletionUserMessage,
|
OpenAITextCompletionUserMessage,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ...OpenAI.completion.transformation import OpenAITextCompletionConfig
|
from ...openai.completion.transformation import OpenAITextCompletionConfig
|
||||||
|
|
||||||
|
|
||||||
class TogetherAITextCompletionConfig(OpenAITextCompletionConfig):
|
class TogetherAITextCompletionConfig(OpenAITextCompletionConfig):
|
||||||
|
|
|
@ -11,7 +11,7 @@ from litellm.llms.custom_httpx.http_handler import (
|
||||||
HTTPHandler,
|
HTTPHandler,
|
||||||
get_async_httpx_client,
|
get_async_httpx_client,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.openai import AllMessageValues
|
from litellm.llms.openai.openai import AllMessageValues
|
||||||
from litellm.types.llms.vertex_ai import (
|
from litellm.types.llms.vertex_ai import (
|
||||||
CachedContentListAllResponseBody,
|
CachedContentListAllResponseBody,
|
||||||
RequestBody,
|
RequestBody,
|
||||||
|
|
|
@ -13,7 +13,7 @@ from litellm.llms.custom_httpx.http_handler import (
|
||||||
_get_httpx_client,
|
_get_httpx_client,
|
||||||
get_async_httpx_client,
|
get_async_httpx_client,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.openai import HttpxBinaryResponseContent
|
from litellm.llms.openai.openai import HttpxBinaryResponseContent
|
||||||
from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_studio_gemini import (
|
from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_studio_gemini import (
|
||||||
VertexLLM,
|
VertexLLM,
|
||||||
)
|
)
|
||||||
|
|
|
@ -91,7 +91,7 @@ class VertexAIPartnerModels(VertexBase):
|
||||||
from google.cloud import aiplatform
|
from google.cloud import aiplatform
|
||||||
|
|
||||||
from litellm.llms.anthropic.chat import AnthropicChatCompletion
|
from litellm.llms.anthropic.chat import AnthropicChatCompletion
|
||||||
from litellm.llms.OpenAI.openai import OpenAIChatCompletion
|
from litellm.llms.openai.openai import OpenAIChatCompletion
|
||||||
from litellm.llms.openai_like.chat.handler import OpenAILikeChatHandler
|
from litellm.llms.openai_like.chat.handler import OpenAILikeChatHandler
|
||||||
from litellm.llms.text_completion_codestral import CodestralTextCompletion
|
from litellm.llms.text_completion_codestral import CodestralTextCompletion
|
||||||
from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_studio_gemini import (
|
from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_studio_gemini import (
|
||||||
|
|
|
@ -76,7 +76,7 @@ class VertexAIModelGardenModels(VertexBase):
|
||||||
from google.cloud import aiplatform
|
from google.cloud import aiplatform
|
||||||
|
|
||||||
from litellm.llms.anthropic.chat import AnthropicChatCompletion
|
from litellm.llms.anthropic.chat import AnthropicChatCompletion
|
||||||
from litellm.llms.OpenAI.openai import OpenAIChatCompletion
|
from litellm.llms.openai.openai import OpenAIChatCompletion
|
||||||
from litellm.llms.openai_like.chat.handler import OpenAILikeChatHandler
|
from litellm.llms.openai_like.chat.handler import OpenAILikeChatHandler
|
||||||
from litellm.llms.text_completion_codestral import CodestralTextCompletion
|
from litellm.llms.text_completion_codestral import CodestralTextCompletion
|
||||||
from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_studio_gemini import (
|
from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_studio_gemini import (
|
||||||
|
|
|
@ -14,7 +14,7 @@ from litellm.secret_managers.main import get_secret_str
|
||||||
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMessage
|
||||||
|
|
||||||
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
from ....utils import _remove_additional_properties, _remove_strict_from_schema
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
|
|
||||||
class IBMWatsonXChatConfig(OpenAIGPTConfig):
|
class IBMWatsonXChatConfig(OpenAIGPTConfig):
|
||||||
|
|
|
@ -3,7 +3,7 @@ from typing import Literal, Optional, Tuple, Union
|
||||||
|
|
||||||
from litellm.secret_managers.main import get_secret_str
|
from litellm.secret_managers.main import get_secret_str
|
||||||
|
|
||||||
from ...OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
XAI_API_BASE = "https://api.x.ai/v1"
|
XAI_API_BASE = "https://api.x.ai/v1"
|
||||||
|
|
||||||
|
|
|
@ -115,10 +115,10 @@ from .llms.databricks.chat.handler import DatabricksChatCompletion
|
||||||
from .llms.databricks.embed.handler import DatabricksEmbeddingHandler
|
from .llms.databricks.embed.handler import DatabricksEmbeddingHandler
|
||||||
from .llms.groq.chat.handler import GroqChatCompletion
|
from .llms.groq.chat.handler import GroqChatCompletion
|
||||||
from .llms.huggingface_restapi import Huggingface
|
from .llms.huggingface_restapi import Huggingface
|
||||||
from .llms.OpenAI.audio_transcriptions import OpenAIAudioTranscription
|
from .llms.openai.transcriptions.handler import OpenAIAudioTranscription
|
||||||
from .llms.OpenAI.chat.o1_handler import OpenAIO1ChatCompletion
|
from .llms.openai.chat.o1_handler import OpenAIO1ChatCompletion
|
||||||
from .llms.OpenAI.completion.handler import OpenAITextCompletion
|
from .llms.openai.completion.handler import OpenAITextCompletion
|
||||||
from .llms.OpenAI.openai import OpenAIChatCompletion
|
from .llms.openai.openai import OpenAIChatCompletion
|
||||||
from .llms.openai_like.embedding.handler import OpenAILikeEmbeddingHandler
|
from .llms.openai_like.embedding.handler import OpenAILikeEmbeddingHandler
|
||||||
from .llms.predibase import PredibaseChatCompletion
|
from .llms.predibase import PredibaseChatCompletion
|
||||||
from .llms.prompt_templates.common_utils import get_completion_messages
|
from .llms.prompt_templates.common_utils import get_completion_messages
|
||||||
|
|
|
@ -10,7 +10,7 @@ from litellm.types.router import GenericLiteLLMParams
|
||||||
|
|
||||||
from ..litellm_core_utils.litellm_logging import Logging as LiteLLMLogging
|
from ..litellm_core_utils.litellm_logging import Logging as LiteLLMLogging
|
||||||
from ..llms.azure.realtime.handler import AzureOpenAIRealtime
|
from ..llms.azure.realtime.handler import AzureOpenAIRealtime
|
||||||
from ..llms.OpenAI.realtime.handler import OpenAIRealtime
|
from ..llms.openai.realtime.handler import OpenAIRealtime
|
||||||
from ..utils import client as wrapper_client
|
from ..utils import client as wrapper_client
|
||||||
|
|
||||||
azure_realtime = AzureOpenAIRealtime()
|
azure_realtime = AzureOpenAIRealtime()
|
||||||
|
|
|
@ -20,15 +20,15 @@ from typing_extensions import override
|
||||||
|
|
||||||
import litellm
|
import litellm
|
||||||
from litellm import create_thread, get_thread
|
from litellm import create_thread, get_thread
|
||||||
from litellm.llms.OpenAI.openai import (
|
from litellm.llms.openai.openai import (
|
||||||
AssistantEventHandler,
|
AssistantEventHandler,
|
||||||
AsyncAssistantEventHandler,
|
AsyncAssistantEventHandler,
|
||||||
AsyncCursorPage,
|
AsyncCursorPage,
|
||||||
MessageData,
|
MessageData,
|
||||||
OpenAIAssistantsAPI,
|
OpenAIAssistantsAPI,
|
||||||
)
|
)
|
||||||
from litellm.llms.OpenAI.openai import OpenAIMessage as Message
|
from litellm.llms.openai.openai import OpenAIMessage as Message
|
||||||
from litellm.llms.OpenAI.openai import SyncCursorPage, Thread
|
from litellm.llms.openai.openai import SyncCursorPage, Thread
|
||||||
|
|
||||||
"""
|
"""
|
||||||
V0 Scope:
|
V0 Scope:
|
||||||
|
|
|
@ -60,7 +60,7 @@ async def test_audio_speech_litellm(sync_mode, model, api_base, api_key):
|
||||||
optional_params={},
|
optional_params={},
|
||||||
)
|
)
|
||||||
|
|
||||||
from litellm.llms.OpenAI.openai import HttpxBinaryResponseContent
|
from litellm.llms.openai.openai import HttpxBinaryResponseContent
|
||||||
|
|
||||||
assert isinstance(response, HttpxBinaryResponseContent)
|
assert isinstance(response, HttpxBinaryResponseContent)
|
||||||
else:
|
else:
|
||||||
|
@ -78,7 +78,7 @@ async def test_audio_speech_litellm(sync_mode, model, api_base, api_key):
|
||||||
optional_params={},
|
optional_params={},
|
||||||
)
|
)
|
||||||
|
|
||||||
from litellm.llms.OpenAI.openai import HttpxBinaryResponseContent
|
from litellm.llms.openai.openai import HttpxBinaryResponseContent
|
||||||
|
|
||||||
assert isinstance(response, HttpxBinaryResponseContent)
|
assert isinstance(response, HttpxBinaryResponseContent)
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ async def test_audio_speech_litellm_vertex(sync_mode):
|
||||||
|
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
from litellm.llms.OpenAI.openai import HttpxBinaryResponseContent
|
from litellm.llms.openai.openai import HttpxBinaryResponseContent
|
||||||
|
|
||||||
response.stream_to_file(speech_file_path)
|
response.stream_to_file(speech_file_path)
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ def test_provider_config_manager():
|
||||||
from litellm import LITELLM_CHAT_PROVIDERS, LlmProviders
|
from litellm import LITELLM_CHAT_PROVIDERS, LlmProviders
|
||||||
from litellm.utils import ProviderConfigManager
|
from litellm.utils import ProviderConfigManager
|
||||||
from litellm.llms.base_llm.transformation import BaseConfig
|
from litellm.llms.base_llm.transformation import BaseConfig
|
||||||
from litellm.llms.OpenAI.chat.gpt_transformation import OpenAIGPTConfig
|
from litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfig
|
||||||
|
|
||||||
for provider in LITELLM_CHAT_PROVIDERS:
|
for provider in LITELLM_CHAT_PROVIDERS:
|
||||||
if provider == LlmProviders.TRITON or provider == LlmProviders.PREDIBASE:
|
if provider == LlmProviders.TRITON or provider == LlmProviders.PREDIBASE:
|
||||||
|
|
|
@ -178,7 +178,7 @@ async def test_audio_speech_router(mode):
|
||||||
optional_params={},
|
optional_params={},
|
||||||
)
|
)
|
||||||
|
|
||||||
from litellm.llms.OpenAI.openai import HttpxBinaryResponseContent
|
from litellm.llms.openai.openai import HttpxBinaryResponseContent
|
||||||
|
|
||||||
assert isinstance(response, HttpxBinaryResponseContent)
|
assert isinstance(response, HttpxBinaryResponseContent)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue