mirror of
https://github.com/open-webui/pipelines
synced 2025-06-25 09:36:35 +00:00
refac
This commit is contained in:
parent
a7238b96b7
commit
f1bcd5be0f
@ -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,
|
||||
)
|
||||
|
@ -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,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user