Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -173,15 +173,15 @@ tools = [generate_and_upload_image, analyze_image_with_text]
|
|
| 173 |
# 建立 LLM 模型實例
|
| 174 |
llm = ChatGoogleGenerativeAI(google_api_key=google_api, model="gemini-2.0-flash", temperature=0.2)
|
| 175 |
|
| 176 |
-
# 建立提示模板
|
| 177 |
-
prompt_template = ChatPromptTemplate.from_messages([
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
])
|
| 182 |
|
| 183 |
# 建立代理人,使用 create_react_agent
|
| 184 |
-
react_agent = create_react_agent(llm, tools
|
| 185 |
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
|
| 186 |
|
| 187 |
|
|
|
|
| 173 |
# 建立 LLM 模型實例
|
| 174 |
llm = ChatGoogleGenerativeAI(google_api_key=google_api, model="gemini-2.0-flash", temperature=0.2)
|
| 175 |
|
| 176 |
+
# # 建立提示模板
|
| 177 |
+
# prompt_template = ChatPromptTemplate.from_messages([
|
| 178 |
+
# ("system", "你是一個強大的助理,可以根據用戶的請求使用提供的工具。"),
|
| 179 |
+
# ("user", "{input}"),
|
| 180 |
+
# ("placeholder", "{agent_scratchpad}"),
|
| 181 |
+
# ])
|
| 182 |
|
| 183 |
# 建立代理人,使用 create_react_agent
|
| 184 |
+
react_agent = create_react_agent(llm, tools)
|
| 185 |
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
|
| 186 |
|
| 187 |
|