Spaces:
Sleeping
Sleeping
Commit ·
1fa1fdf
1
Parent(s): 6a8fc80
feat : upgrade ai agent readme
Browse files- services/agents.py +17 -10
services/agents.py
CHANGED
|
@@ -166,17 +166,24 @@ def deblur_image_from_url(
|
|
| 166 |
user_text: str
|
| 167 |
) -> str:
|
| 168 |
"""
|
| 169 |
-
這個工具可以從提供的
|
| 170 |
-
|
| 171 |
-
並回傳
|
| 172 |
-
|
|
|
|
| 173 |
Args:
|
| 174 |
-
file_url:
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
"""
|
| 181 |
try:
|
| 182 |
tile_size = 512
|
|
|
|
| 166 |
user_text: str
|
| 167 |
) -> str:
|
| 168 |
"""
|
| 169 |
+
這個工具可以從提供的圖片來源載入影像(支援 HTTP/HTTPS 網址與本地檔案路徑),
|
| 170 |
+
並使用分塊處理(Tiled Processing)進行去模糊(deblur)。處理完成後,
|
| 171 |
+
會將結果儲存於伺服器的 static/ 目錄,並回傳去模糊後圖片的 **絕對 URL 路徑**
|
| 172 |
+
以及根據 user_text 生成的額外文字結果。
|
| 173 |
+
|
| 174 |
Args:
|
| 175 |
+
file_url:
|
| 176 |
+
圖片來源,可為:
|
| 177 |
+
- HTTP/HTTPS 網路圖片網址(例如:https://example.com/img.png)
|
| 178 |
+
- 本地檔案路徑(例如:/tmp/xxx.png)
|
| 179 |
+
|
| 180 |
+
user_text:
|
| 181 |
+
使用者針對圖片提出的處理需求或描述文字。
|
| 182 |
+
|
| 183 |
+
Returns:
|
| 184 |
+
JSON 格式的字串,包含:
|
| 185 |
+
- "image_url": 去模糊後圖片的絕對 URL 路徑
|
| 186 |
+
- "text_result": 根據 user_text 產生的額外文字說明
|
| 187 |
"""
|
| 188 |
try:
|
| 189 |
tile_size = 512
|