fix(app): 为图片嵌入 API 请求添加 Authorization 认证头

This commit is contained in:
zhenghu
2026-04-15 10:11:08 +08:00
parent fdfc3e2e2b
commit 131e3d3a7a

2
app.py
View File

@@ -190,7 +190,7 @@ def get_image_embedding(image_url: str, text: str = "这是什么病虫害?",
try: try:
resp = httpx.post( resp = httpx.post(
IMAGE_EMBEDDING_API_URL, IMAGE_EMBEDDING_API_URL,
headers={"Content-Type": "application/json"}, headers={"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"},
json=payload, json=payload,
timeout=120, timeout=120,
) )