Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -157,7 +157,10 @@ def call_claude_api(prompt: str) -> str:
|
|
| 157 |
max_tokens=1024,
|
| 158 |
temperature=0.7,
|
| 159 |
)
|
| 160 |
-
|
|
|
|
|
|
|
|
|
|
| 161 |
except Exception as e:
|
| 162 |
return f"[Claude API 呼叫失敗]: {str(e)}"
|
| 163 |
|
|
|
|
| 157 |
max_tokens=1024,
|
| 158 |
temperature=0.7,
|
| 159 |
)
|
| 160 |
+
text = response.content
|
| 161 |
+
if isinstance(text, list):
|
| 162 |
+
text = ' '.join(str(item) for item in text)
|
| 163 |
+
return text.strip()
|
| 164 |
except Exception as e:
|
| 165 |
return f"[Claude API 呼叫失敗]: {str(e)}"
|
| 166 |
|