Skip to content

Commit e3ccf5e

Browse files
committed
fix: predict
1 parent 4550b41 commit e3ccf5e

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

backend/apps/chat/task/llm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,8 @@ def run_analysis_or_predict_task(llm_service: LLMService, action_type: str, base
846846
try:
847847
llm_service.set_record(save_analysis_predict_record(llm_service.session, base_record, action_type))
848848

849+
yield orjson.dumps({'type': 'id', 'id': llm_service.get_record().id}).decode() + '\n\n'
850+
849851
if action_type == 'analysis':
850852
# generate analysis
851853
analysis_res = llm_service.generate_analysis()

backend/template.yaml

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

frontend/src/views/chat/RecommendQuestion.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function clickQuestion(question: string): void {
6868
.question-grid {
6969
display: grid;
7070
grid-gap: 12px;
71-
grid-template-columns: repeat(2, 50%);
71+
grid-template-columns: repeat(2, calc(50% - 6px));
7272
}
7373
7474
.question {

frontend/src/views/chat/chat-block/UserChat.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function clickPredict() {
4545
4646
.prefix-title {
4747
color: rgba(28, 186, 144, 1);
48+
white-space: nowrap;
4849
}
4950
}
5051
</style>

frontend/src/views/chat/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
@finish="onChartAnswerFinish"
117117
@error="onChartAnswerError"
118118
>
119-
<ChartBlock :message="message" />
119+
<ChartBlock style="margin-top: 12px" :message="message" />
120120
<div
121121
v-if="message.record?.error && message.record?.error?.trim().length > 0"
122122
class="error-container"
@@ -220,7 +220,7 @@
220220
@finish="onPredictAnswerFinish"
221221
@error="onPredictAnswerError"
222222
>
223-
<ChartBlock :message="message" is-predict />
223+
<ChartBlock style="margin-top: 12px" :message="message" is-predict />
224224
<div
225225
v-if="message.record?.error && message.record?.error?.trim().length > 0"
226226
class="error-container"

0 commit comments

Comments
 (0)