mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +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
63
litellm/llms/openai/chat/o1_handler.py
Normal file
63
litellm/llms/openai/chat/o1_handler.py
Normal file
|
@ -0,0 +1,63 @@
|
|||
"""
|
||||
Handler file for calls to OpenAI's o1 family of models
|
||||
|
||||
Written separately to handle faking streaming for o1 models.
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
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
|
||||
|
||||
|
||||
class OpenAIO1ChatCompletion(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,
|
||||
):
|
||||
# stream: Optional[bool] = optional_params.pop("stream", False)
|
||||
response = super().completion(
|
||||
model_response,
|
||||
timeout,
|
||||
optional_params,
|
||||
logging_obj,
|
||||
model,
|
||||
messages,
|
||||
print_verbose,
|
||||
api_key,
|
||||
api_base,
|
||||
acompletion,
|
||||
litellm_params,
|
||||
logger_fn,
|
||||
headers,
|
||||
custom_prompt_dict,
|
||||
client,
|
||||
organization,
|
||||
custom_llm_provider,
|
||||
drop_params,
|
||||
)
|
||||
|
||||
return response
|
Loading…
Add table
Add a link
Reference in a new issue