Skip to content

Commit

Permalink
litellm settings (including temperature)
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Apr 2, 2024
1 parent 3e1c701 commit 5647344
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.12
v0.1.13
14 changes: 13 additions & 1 deletion impl/services/inference_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
from typing import Any, Dict, List, Optional, Union, AsyncGenerator
from typing import Any, Dict, List, Optional, Union, AsyncGenerator, get_type_hints


import litellm
from litellm import (
Expand Down Expand Up @@ -91,6 +92,17 @@ async def get_async_chat_completion_response(
if model is None:
model = deployment_id

type_hints = get_type_hints(acompletion)

for key, value in litellm_kwargs.items():
if value is not None and key in type_hints:
type_hint = type_hints[key]
# handle optional
if hasattr(type_hint, "__origin__") and type_hint.__origin__ == Union:
litellm_kwargs[key] = type_hint.__args__[0](value)
else:
litellm_kwargs[key] = type_hints[key](value)

completion = await acompletion(
model=model,
messages=messages,
Expand Down

0 comments on commit 5647344

Please sign in to comment.