This commit is contained in:
Timothy J. Baek 2024-05-21 20:12:36 -07:00
parent a7238b96b7
commit f1bcd5be0f
2 changed files with 5 additions and 2 deletions

View File

@ -32,6 +32,7 @@ class Pipeline:
AZURE_OPENAI_API_KEY = "your-azure-openai-api-key-here"
AZURE_OPENAI_ENDPOINT = "your-azure-openai-endpoint-here"
DEPLOYMENT_NAME = "your-deployment-name-here"
MODEL = "gpt-3.5-turbo"
headers = {"api-key": AZURE_OPENAI_API_KEY, "Content-Type": "application/json"}
@ -40,7 +41,7 @@ class Pipeline:
try:
r = requests.post(
url=url,
json={**body, "model": "gpt-3.5-turbo"},
json={**body, "model": MODEL},
headers=headers,
stream=True,
)

View File

@ -28,7 +28,9 @@ class Pipeline:
print(messages)
print(user_message)
OPENAI_API_KEY = "your-openai-api-key-here"
MODEL = "gpt-3.5-turbo"
headers = {}
headers["Authorization"] = f"Bearer {OPENAI_API_KEY}"
@ -37,7 +39,7 @@ class Pipeline:
try:
r = requests.post(
url="https://api.openai.com/v1/chat/completions",
json={**body, "model": "gpt-3.5-turbo"},
json={**body, "model": MODEL},
headers=headers,
stream=True,
)