Skip to content

Commit 26122d5

Browse files
committed
Update litellm_wrapper.py
1 parent c74902d commit 26122d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

optillm/litellm_wrapper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ class Chat:
2424
class Completions:
2525
@staticmethod
2626
def create(model: str, messages: List[Dict[str, str]], **kwargs):
27-
response = completion(model=model, messages=messages, **kwargs, safety_settings=SAFETY_SETTINGS)
27+
if model.startswith("gemini"):
28+
response = completion(model=model, messages=messages, **kwargs, safety_settings=SAFETY_SETTINGS)
29+
else:
30+
response = completion(model=model, messages=messages, **kwargs)
2831
# Convert LiteLLM response to match OpenAI response structure
2932
return response
3033

0 commit comments

Comments
 (0)