support proxy openai urls

This commit is contained in:
Krrish Dholakia 2023-08-02 19:50:08 -07:00
parent a5e1d3a15a
commit 9464e2b214
15 changed files with 111 additions and 42 deletions

View file

@ -0,0 +1,15 @@
import sys, os
import traceback
sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path
import litellm
from litellm import embedding, completion
litellm.api_base = "https://oai.hconeai.com/v1"
litellm.headers = {"Helicone-Auth": f"Bearer {os.getenv('HELICONE_API_KEY')}"}
response = litellm.completion(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "how does a court case get to the Supreme Court?"}]
)
print(response)