From 0ca08b154561ea7649fa37d3a09e40993c3ab587 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 19 Sep 2023 21:57:35 -0700 Subject: [PATCH] bump v --- litellm/main.py | 3 ++- litellm/tests/test_completion.py | 2 ++ pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index 57d596bf87..97d0331e35 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -1272,7 +1272,6 @@ def moderation(*args, **kwargs): api_key = None if "api_key" in kwargs: api_key = kwargs["api_key"] - api_key = ( api_key or litellm.api_key or @@ -1280,6 +1279,8 @@ def moderation(*args, **kwargs): get_secret("OPENAI_API_KEY") ) openai.api_key = api_key + openai.api_type = "open_ai" + openai.api_base = "https://api.openai.com/v1" response = openai.Moderation.create(*args, **kwargs) return response diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index f7393f5e5c..285236962f 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -814,6 +814,8 @@ def test_completion_ai21(): # test_completion_together_ai_stream() def test_moderation(): + import openai + openai.api_type = "azure" response = litellm.moderation(input="i'm ishaan cto of litellm") print(response) output = response["results"][0] diff --git a/pyproject.toml b/pyproject.toml index 250dd863c6..166287f02e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.708" +version = "0.1.710" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"