Spaces:
Running
Running
Upload main.py
Browse files
main.py
CHANGED
@@ -536,9 +536,7 @@ def google_ai(query: str, api_key: None = Depends(validate_api_key)):
|
|
536 |
"text": query
|
537 |
}
|
538 |
}
|
539 |
-
response = requests.post(f"{url}?key={token}", headers=headers, json=data)
|
540 |
-
if response.status_code != 200:
|
541 |
-
return {"message": f"error {response.status_code}"}
|
542 |
response_str = response.json()
|
543 |
answer = response_str["candidates"]
|
544 |
for results in answer:
|
|
|
536 |
"text": query
|
537 |
}
|
538 |
}
|
539 |
+
response = requests.post(f"{url}/v1beta3/models/text-bison-001:generateText?key={token}", headers=headers, json=data)
|
|
|
|
|
540 |
response_str = response.json()
|
541 |
answer = response_str["candidates"]
|
542 |
for results in answer:
|