Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,15 @@ def chat_api(history, question):
|
|
15 |
body = str.encode(json.dumps(data))
|
16 |
url = st.secrets["url"]
|
17 |
api_key = st.secrets["ms_api_key"]
|
18 |
-
|
|
|
19 |
# Replace this with the primary/secondary key, AMLToken, or Microsoft Entra ID token for the endpoint
|
20 |
if not api_key:
|
21 |
raise Exception("A key should be provided to invoke the endpoint")
|
22 |
|
23 |
|
24 |
headers = {'Content-Type':'application/json', 'Accept': 'application/json', 'Authorization':('Bearer '+ api_key)}
|
25 |
-
|
26 |
req = urllib.request.Request(url, body, headers)
|
27 |
response = urllib.request.urlopen(req)
|
28 |
result = response.read()
|
|
|
15 |
body = str.encode(json.dumps(data))
|
16 |
url = st.secrets["url"]
|
17 |
api_key = st.secrets["ms_api_key"]
|
18 |
+
print(url)
|
19 |
+
print(api_key)
|
20 |
# Replace this with the primary/secondary key, AMLToken, or Microsoft Entra ID token for the endpoint
|
21 |
if not api_key:
|
22 |
raise Exception("A key should be provided to invoke the endpoint")
|
23 |
|
24 |
|
25 |
headers = {'Content-Type':'application/json', 'Accept': 'application/json', 'Authorization':('Bearer '+ api_key)}
|
26 |
+
print(headers)
|
27 |
req = urllib.request.Request(url, body, headers)
|
28 |
response = urllib.request.urlopen(req)
|
29 |
result = response.read()
|