Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -12,10 +12,9 @@ logging.basicConfig(level=logging.INFO) 
     | 
|
| 12 | 
         
             
            # API 클라이언트 설정
         
     | 
| 13 | 
         
             
            api_client = Client("http://211.233.58.202:7960/")
         
     | 
| 14 | 
         | 
| 15 | 
         
            -
            # Notion API 설정
         
     | 
| 16 | 
         
             
            # Notion API 설정
         
     | 
| 17 | 
         
             
            NOTION_API_KEY = "secret_MpVfJphbfo4599fdczYfMYKNOpyzCcvkhhzk3lgTfVk"
         
     | 
| 18 | 
         
            -
            NOTION_DATABASE_ID = " 
     | 
| 19 | 
         
             
            NOTION_API_URL = "https://api.notion.com/v1"
         
     | 
| 20 | 
         | 
| 21 | 
         
             
            headers = {
         
     | 
| 
         @@ -62,15 +61,16 @@ def upload_to_notion(prompt, image_url): 
     | 
|
| 62 | 
         
             
                        }
         
     | 
| 63 | 
         
             
                    ]
         
     | 
| 64 | 
         
             
                }
         
     | 
| 65 | 
         
            -
             
     | 
| 66 | 
         
             
                try:
         
     | 
| 67 | 
         
            -
                    response = requests.post(f"{NOTION_API_URL}/pages", headers=headers,  
     | 
| 68 | 
         
             
                    response.raise_for_status()
         
     | 
| 69 | 
         
             
                    logging.info("Successfully added to Notion")
         
     | 
| 70 | 
         
             
                    return response.json()["url"]
         
     | 
| 71 | 
         
             
                except requests.exceptions.RequestException as e:
         
     | 
| 72 | 
         
             
                    logging.error(f"Failed to add to Notion: {e}")
         
     | 
| 73 | 
         
             
                    logging.error(f"Response content: {response.text}")
         
     | 
| 
         | 
|
| 74 | 
         
             
                    raise Exception(f"Failed to add to Notion: {e}")
         
     | 
| 75 | 
         | 
| 76 | 
         
             
            def respond(message, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
         
     | 
| 
         | 
|
| 12 | 
         
             
            # API 클라이언트 설정
         
     | 
| 13 | 
         
             
            api_client = Client("http://211.233.58.202:7960/")
         
     | 
| 14 | 
         | 
| 
         | 
|
| 15 | 
         
             
            # Notion API 설정
         
     | 
| 16 | 
         
             
            NOTION_API_KEY = "secret_MpVfJphbfo4599fdczYfMYKNOpyzCcvkhhzk3lgTfVk"
         
     | 
| 17 | 
         
            +
            NOTION_DATABASE_ID = "88c9bdadcb2044129af77d5932e1a82a"
         
     | 
| 18 | 
         
             
            NOTION_API_URL = "https://api.notion.com/v1"
         
     | 
| 19 | 
         | 
| 20 | 
         
             
            headers = {
         
     | 
| 
         | 
|
| 61 | 
         
             
                        }
         
     | 
| 62 | 
         
             
                    ]
         
     | 
| 63 | 
         
             
                }
         
     | 
| 64 | 
         
            +
             
     | 
| 65 | 
         
             
                try:
         
     | 
| 66 | 
         
            +
                    response = requests.post(f"{NOTION_API_URL}/pages", headers=headers, json=data)
         
     | 
| 67 | 
         
             
                    response.raise_for_status()
         
     | 
| 68 | 
         
             
                    logging.info("Successfully added to Notion")
         
     | 
| 69 | 
         
             
                    return response.json()["url"]
         
     | 
| 70 | 
         
             
                except requests.exceptions.RequestException as e:
         
     | 
| 71 | 
         
             
                    logging.error(f"Failed to add to Notion: {e}")
         
     | 
| 72 | 
         
             
                    logging.error(f"Response content: {response.text}")
         
     | 
| 73 | 
         
            +
                    logging.error(f"Request payload: {json.dumps(data, indent=2)}")
         
     | 
| 74 | 
         
             
                    raise Exception(f"Failed to add to Notion: {e}")
         
     | 
| 75 | 
         | 
| 76 | 
         
             
            def respond(message, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
         
     |