mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
* LiteLLM Minor Fixes & Improvements (09/23/2024) (#5842) * feat(auth_utils.py): enable admin to allow client-side credentials to be passed Makes it easier for devs to experiment with finetuned fireworks ai models * feat(router.py): allow setting configurable_clientside_auth_params for a model Closes https://github.com/BerriAI/litellm/issues/5843 * build(model_prices_and_context_window.json): fix anthropic claude-3-5-sonnet max output token limit Fixes https://github.com/BerriAI/litellm/issues/5850 * fix(azure_ai/): support content list for azure ai Fixes https://github.com/BerriAI/litellm/issues/4237 * fix(litellm_logging.py): always set saved_cache_cost Set to 0 by default * fix(fireworks_ai/cost_calculator.py): add fireworks ai default pricing handles calling 405b+ size models * fix(slack_alerting.py): fix error alerting for failed spend tracking Fixes regression with slack alerting error monitoring * fix(vertex_and_google_ai_studio_gemini.py): handle gemini no candidates in streaming chunk error * docs(bedrock.md): add llama3-1 models * test: fix tests * fix(azure_ai/chat): fix transformation for azure ai calls
59 lines
1.7 KiB
Python
59 lines
1.7 KiB
Python
from typing import Any, Callable, List, Optional, Union
|
|
|
|
from httpx._config import Timeout
|
|
|
|
from litellm.llms.bedrock.chat.invoke_handler import MockResponseIterator
|
|
from litellm.llms.OpenAI.openai import OpenAIChatCompletion
|
|
from litellm.types.utils import ModelResponse
|
|
from litellm.utils import CustomStreamWrapper
|
|
|
|
from .transformation import AzureAIStudioConfig
|
|
|
|
|
|
class AzureAIChatCompletion(OpenAIChatCompletion):
|
|
def completion(
|
|
self,
|
|
model_response: ModelResponse,
|
|
timeout: Union[float, Timeout],
|
|
optional_params: dict,
|
|
logging_obj: Any,
|
|
model: Optional[str] = None,
|
|
messages: Optional[list] = None,
|
|
print_verbose: Optional[Callable[..., Any]] = None,
|
|
api_key: Optional[str] = None,
|
|
api_base: Optional[str] = None,
|
|
acompletion: bool = False,
|
|
litellm_params=None,
|
|
logger_fn=None,
|
|
headers: Optional[dict] = None,
|
|
custom_prompt_dict: dict = {},
|
|
client=None,
|
|
organization: Optional[str] = None,
|
|
custom_llm_provider: Optional[str] = None,
|
|
drop_params: Optional[bool] = None,
|
|
):
|
|
|
|
transformed_messages = AzureAIStudioConfig()._transform_messages(
|
|
messages=messages # type: ignore
|
|
)
|
|
|
|
return super().completion(
|
|
model_response,
|
|
timeout,
|
|
optional_params,
|
|
logging_obj,
|
|
model,
|
|
transformed_messages,
|
|
print_verbose,
|
|
api_key,
|
|
api_base,
|
|
acompletion,
|
|
litellm_params,
|
|
logger_fn,
|
|
headers,
|
|
custom_prompt_dict,
|
|
client,
|
|
organization,
|
|
custom_llm_provider,
|
|
drop_params,
|
|
)
|