lidp
commited on
Commit
·
1de5cd5
1
Parent(s):
a92172b
Remove WenCai imageurl and update investment_advisor prompt (#2606)
Browse files### What problem does this PR solve?
### Type of change
- [x] Refactoring
agent/component/wencai.py
CHANGED
@@ -64,6 +64,12 @@ class WenCai(ComponentBase, ABC):
|
|
64 |
continue
|
65 |
wencai_res.append({"content": pd.DataFrame.from_dict(item[1], orient='index').to_markdown()})
|
66 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
wencai_res.append({"content": item[0] + "\n" + str(item[1])})
|
68 |
except Exception as e:
|
69 |
return WenCai.be_output("**ERROR**: " + str(e))
|
|
|
64 |
continue
|
65 |
wencai_res.append({"content": pd.DataFrame.from_dict(item[1], orient='index').to_markdown()})
|
66 |
continue
|
67 |
+
if isinstance(item[1], pd.DataFrame):
|
68 |
+
if "image_url" in item[1].columns:
|
69 |
+
continue
|
70 |
+
wencai_res.append({"content": item[1].to_markdown()})
|
71 |
+
continue
|
72 |
+
|
73 |
wencai_res.append({"content": item[0] + "\n" + str(item[1])})
|
74 |
except Exception as e:
|
75 |
return WenCai.be_output("**ERROR**: " + str(e))
|
agent/templates/investment_advisor.json
CHANGED
@@ -44,7 +44,7 @@
|
|
44 |
}
|
45 |
],
|
46 |
"presence_penalty": 0.4,
|
47 |
-
"prompt": "Role: You are a professional financial counseling assistant.\n\
|
48 |
"temperature": 0.1,
|
49 |
"top_p": 0.3
|
50 |
}
|
@@ -369,7 +369,7 @@
|
|
369 |
],
|
370 |
"presencePenaltyEnabled": true,
|
371 |
"presence_penalty": 0.4,
|
372 |
-
"prompt": "Role: You are a professional financial counseling assistant.\n\
|
373 |
"temperature": 0.1,
|
374 |
"temperatureEnabled": true,
|
375 |
"topPEnabled": true,
|
|
|
44 |
}
|
45 |
],
|
46 |
"presence_penalty": 0.4,
|
47 |
+
"prompt": "Role: You are a professional financial counseling assistant.\n\nTask: Answer user's question based on content provided by Wencai and AkShare.\n\nNotice:\n- Output no more than 5 news items from AkShare if there's content provided by Wencai.\n- Items from AkShare MUST have a corresponding URL link.\n\n############\nContent provided by Wencai: \n{wencai_input}\n\n################\nContent provided by AkShare: \n{ak_input}",
|
48 |
"temperature": 0.1,
|
49 |
"top_p": 0.3
|
50 |
}
|
|
|
369 |
],
|
370 |
"presencePenaltyEnabled": true,
|
371 |
"presence_penalty": 0.4,
|
372 |
+
"prompt": "Role: You are a professional financial counseling assistant.\n\nTask: Answer user's question based on content provided by Wencai and AkShare.\n\nNotice:\n- Output no more than 5 news items from AkShare if there's content provided by Wencai.\n- Items from AkShare MUST have a corresponding URL link.\n\n############\nContent provided by Wencai: \n{wencai_input}\n\n################\nContent provided by AkShare: \n{ak_input}",
|
373 |
"temperature": 0.1,
|
374 |
"temperatureEnabled": true,
|
375 |
"topPEnabled": true,
|