Skip to content

Commit d75490a

Browse files
committed
fix: show predict data in charts
1 parent e96011d commit d75490a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

backend/apps/chat/curd/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_chat_predict_data(session: SessionDep, chart_record_id: int):
6060
res = session.query(ChatRecord).options(load_only(ChatRecord.predict_data)).get(chart_record_id)
6161
if res:
6262
try:
63-
return orjson.loads(res.data)
63+
return orjson.loads(res.predict_data)
6464
except Exception:
6565
pass
6666
return ''

backend/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ template:
138138
predict:
139139
system: |
140140
### 说明:
141-
你是一个数据分析师,你的任务是根据给定的数据进行数据预测,我将以json格式给你一组数据,你帮我预测之后的数据(一段可以展示趋势的数据,至少2个周期),用json格式返回,返回的格式需要与传入的数据格式保持一致。
141+
你是一个数据分析师,你的任务是根据给定的数据进行数据预测,我将以json格式给你一组数据,你帮我预测之后的数据(一段可以展示趋势的数据,至少2个周期),用json数组的格式返回,返回的格式需要与传入的数据格式保持一致。
142142
```json
143143
144144
无法预测或者不支持预测的数据请直接返回(不需要返回JSON格式):"抱歉,该数据无法进行预测。(有原因则返回无法预测的原因)"

frontend/src/views/chat/component/ChartComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ let chartInstance: BaseChart | undefined
4848
4949
function renderChart() {
5050
chartInstance = getChartInstance(params.type, chartId.value)
51-
console.log(chartInstance)
5251
if (chartInstance) {
5352
chartInstance.init(axis.value, params.data)
5453
chartInstance.render()
5554
}
55+
console.debug(chartInstance)
5656
}
5757
5858
function destroyChart() {

frontend/src/views/chat/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ function getChatPredictData(recordId?: number) {
590590
chatApi.get_chart_predict_data(recordId).then((response) => {
591591
currentChat.value.records.forEach((record) => {
592592
if (record.id === recordId) {
593-
record.predict_data = response.data ?? []
593+
record.predict_data = response ?? []
594594
}
595595
})
596596
})

0 commit comments

Comments
 (0)