Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -168,12 +168,12 @@ def analyze_image_with_text(image_path: str, user_text: str) -> str:
|
|
| 168 |
tools = [generate_and_upload_image, analyze_image_with_text]
|
| 169 |
|
| 170 |
# 建立 LLM 模型實例
|
| 171 |
-
llm = ChatGoogleGenerativeAI(google_api_key=google_api, model="gemini-2.5-flash", temperature=0.2)
|
| 172 |
|
| 173 |
# 建立提示模板
|
| 174 |
prompt_template = ChatPromptTemplate([
|
| 175 |
-
("system", "
|
| 176 |
-
|
| 177 |
("user", "{input}"),
|
| 178 |
("placeholder", "{agent_scratchpad}"),
|
| 179 |
])
|
|
|
|
| 168 |
tools = [generate_and_upload_image, analyze_image_with_text]
|
| 169 |
|
| 170 |
# 建立 LLM 模型實例
|
| 171 |
+
llm = ChatGoogleGenerativeAI(google_api_key=google_api, model="gemini-2.5-flash-lite", temperature=0.2)
|
| 172 |
|
| 173 |
# 建立提示模板
|
| 174 |
prompt_template = ChatPromptTemplate([
|
| 175 |
+
("system", "你是一個強大的助理,可以根據用戶的請求使用提供的工具。當你執行 generate_and_upload_image 工具\
|
| 176 |
+
成功後,你將會獲得一個圖片的 URL,你的任務是將這個 URL 作為最終回應的一部分。"),
|
| 177 |
("user", "{input}"),
|
| 178 |
("placeholder", "{agent_scratchpad}"),
|
| 179 |
])
|