subhrajit-mohanty
commited on
Commit
·
8444542
1
Parent(s):
9253a16
Documentation updated
Browse files
README.md
CHANGED
@@ -48,3 +48,18 @@ if response.status_code == 200:
|
|
48 |
print(response.json())
|
49 |
```
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
print(response.json())
|
49 |
```
|
50 |
|
51 |
+
### Check list of tokens
|
52 |
+
```
|
53 |
+
import requests
|
54 |
+
|
55 |
+
headers = {
|
56 |
+
'accept': 'application/json',
|
57 |
+
'Content-Type': 'application/json',
|
58 |
+
'Authorization': 'Bearer TOKEN
|
59 |
+
}
|
60 |
+
|
61 |
+
response = requests.get('https://subhraj07-chatapi.hf.space/list', headers=headers)
|
62 |
+
print(response.json())
|
63 |
+
|
64 |
+
```
|
65 |
+
|
app.py
CHANGED
@@ -45,11 +45,12 @@ class RefToken(BaseModel):
|
|
45 |
async def list():
|
46 |
try:
|
47 |
return {
|
48 |
-
"Check here": "https://huggingface.co/spaces/Subhraj07/chatapi/blob/main/README.md"
|
|
|
49 |
}
|
50 |
except Exception as e:
|
51 |
raise HTTPException(status_code=500, detail="An error occurred while processing the request." + str(e))
|
52 |
-
|
53 |
@app.post("/create")
|
54 |
async def create(data: RefToken):
|
55 |
token = "Reference Key is incorrect"
|
|
|
45 |
async def list():
|
46 |
try:
|
47 |
return {
|
48 |
+
"Please Check the documentation here": "https://huggingface.co/spaces/Subhraj07/chatapi/blob/main/README.md",
|
49 |
+
"Swagger UI" : "https://subhraj07-chatapi.hf.space/docs"
|
50 |
}
|
51 |
except Exception as e:
|
52 |
raise HTTPException(status_code=500, detail="An error occurred while processing the request." + str(e))
|
53 |
+
|
54 |
@app.post("/create")
|
55 |
async def create(data: RefToken):
|
56 |
token = "Reference Key is incorrect"
|