feat: api auth key
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ import requests
|
|
10 |
import tensorflow_text
|
11 |
|
12 |
api_url="https://free.churchless.tech/v1/chat/completions"
|
|
|
13 |
|
14 |
def download_pdf(url, output_path):
|
15 |
urllib.request.urlretrieve(url, output_path)
|
@@ -114,7 +115,7 @@ def generate_text(prompt):
|
|
114 |
}
|
115 |
|
116 |
#print(data)
|
117 |
-
r = requests.post(api_url, json = data)
|
118 |
completions = r.json()
|
119 |
message = completions.get("choices")[0].get("message").get("content")
|
120 |
print(message)
|
|
|
10 |
import tensorflow_text
|
11 |
|
12 |
api_url="https://free.churchless.tech/v1/chat/completions"
|
13 |
+
api_key="MyDiscord"
|
14 |
|
15 |
def download_pdf(url, output_path):
|
16 |
urllib.request.urlretrieve(url, output_path)
|
|
|
115 |
}
|
116 |
|
117 |
#print(data)
|
118 |
+
r = requests.post(api_url, headers=('Authorization: Bearer ' + api_key), json = data)
|
119 |
completions = r.json()
|
120 |
message = completions.get("choices")[0].get("message").get("content")
|
121 |
print(message)
|