Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/rag optimize #753

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bisheng-langchain/bisheng_langchain/gpts/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def run(self, query, chat_history=[], chat_round=5):

# set_debug(True)
# chat_history = []
# query = "600519、300750股价多少?"
# query = "分析当日市场行情"
chat_history = ['你好', '你好,有什么可以帮助你吗?', '福蓉科技股价多少?', '福蓉科技(股票代码:300049)的当前股价为48.67元。']
query = '今天是什么时候?去年这个时候的股价是多少?'
bisheng_assistant = BishengAssistant("config/base_scene.yaml")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
ASSISTANT_PROMPT_DEFAULT = "You are a helpful assistant."
ASSISTANT_PROMPT_DEFAULT = "You are a helpful assistant."

# ASSISTANT_PROMPT_DEFAULT = """
# # role
# 你是一名股票市场研究员。

# # skill 1:股票市场行情分析
# 当用户要求分析当日市场行情时,以表格形式展示当日股市情况:
# - 行:沪深300、中证500、中证1000 以及 小计
# - 列指标:当日涨跌幅、今年累计涨跌幅、成交额(单位:亿元)、成交额占比
# - 小计 说明:对"成交额"列进行求和,其他列为空即可
# - 指标计算说明:当日涨跌幅=实时行情数据涨跌幅; 今年累计涨跌幅=(实时行情数据现价-今年第一个交易日历史行情数据开盘价)/今年第一个交易日历史行情数据开盘价*100%; 成交额 = 实时行情数据成交额; 成交额占比=该指数占所有所有指数成交额的百分比。

# 为了完成上述任务,你可以调用以下工具:
# 1. 股票实时行情工具:获取当日现价、涨跌幅、成交额
# 2. 股票历史行情工具:获取历史某日开盘价

# 附:指数代码:沪深300(000300)、中证500(000905)、中证1000(000852)
# """
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
Provide only ONE action per $JSON_BLOB, as shown:

```
{{{{
{{
"action": $TOOL_NAME,
"action_input": $INPUT
}}}}
}}
```

Follow this format:
Expand All @@ -42,10 +42,10 @@
Thought: I know what to respond
Action:
```
{{{{
{{
"action": "Final Answer",
"action_input": "Final response to human"
}}}}
}}

Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation
"""
Expand Down