Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,13 +22,9 @@ notion = NotionClient(auth=NOTION_TOKEN)
|
|
| 22 |
def add_to_notion(prompt, image_path):
|
| 23 |
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 24 |
|
| 25 |
-
# 이미지를 Notion에 업로드
|
| 26 |
-
with open(image_path, "rb") as f:
|
| 27 |
-
response = notion.files.upload(file=f)
|
| 28 |
-
|
| 29 |
new_page = {
|
| 30 |
"Prompt": {"title": [{"text": {"content": prompt}}]},
|
| 31 |
-
"Image": {"
|
| 32 |
"Date": {"date": {"start": now}}
|
| 33 |
}
|
| 34 |
notion.pages.create(parent={"database_id": NOTION_DATABASE_ID}, properties=new_page)
|
|
@@ -68,6 +64,7 @@ def use_prompt(prompt):
|
|
| 68 |
return prompt
|
| 69 |
|
| 70 |
|
|
|
|
| 71 |
css = """
|
| 72 |
footer {
|
| 73 |
visibility: hidden;
|
|
|
|
| 22 |
def add_to_notion(prompt, image_path):
|
| 23 |
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
new_page = {
|
| 26 |
"Prompt": {"title": [{"text": {"content": prompt}}]},
|
| 27 |
+
"Image": {"url": image_path},
|
| 28 |
"Date": {"date": {"start": now}}
|
| 29 |
}
|
| 30 |
notion.pages.create(parent={"database_id": NOTION_DATABASE_ID}, properties=new_page)
|
|
|
|
| 64 |
return prompt
|
| 65 |
|
| 66 |
|
| 67 |
+
|
| 68 |
css = """
|
| 69 |
footer {
|
| 70 |
visibility: hidden;
|