Update app.py
Browse files
app.py
CHANGED
@@ -45,16 +45,12 @@ def read_root():
|
|
45 |
|
46 |
class ImageData(BaseModel):
|
47 |
url: str
|
48 |
-
title: str
|
49 |
|
50 |
-
@app.
|
51 |
async def upload_image(data: ImageData):
|
52 |
try:
|
53 |
-
|
54 |
-
overwrite_custom_metadata=True,
|
55 |
-
custom_metadata={'title': data.title}
|
56 |
-
)
|
57 |
-
|
58 |
upload = imagekit.upload(
|
59 |
file=data.url,
|
60 |
file_name="image.jpg",
|
|
|
45 |
|
46 |
class ImageData(BaseModel):
|
47 |
url: str
|
48 |
+
#title: str
|
49 |
|
50 |
+
@app.post("/image_upload")
|
51 |
async def upload_image(data: ImageData):
|
52 |
try:
|
53 |
+
|
|
|
|
|
|
|
|
|
54 |
upload = imagekit.upload(
|
55 |
file=data.url,
|
56 |
file_name="image.jpg",
|