mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
Merge branch 'main' of https://github.com/dataease/SQLBot
This commit is contained in:
@@ -60,7 +60,7 @@ def get_chat_predict_data(session: SessionDep, chart_record_id: int):
|
||||
res = session.query(ChatRecord).options(load_only(ChatRecord.predict_data)).get(chart_record_id)
|
||||
if res:
|
||||
try:
|
||||
return orjson.loads(res.data)
|
||||
return orjson.loads(res.predict_data)
|
||||
except Exception:
|
||||
pass
|
||||
return ''
|
||||
|
||||
@@ -153,7 +153,7 @@ async def update(session: SessionDep, editor: UserEditor, trans: Trans):
|
||||
raise Exception(f"User with id [{editor.id}] not found!")
|
||||
if editor.account != user_model.account:
|
||||
raise Exception(f"account cannot be changed!")
|
||||
if editor.email != user_model.email and check_email_exists(session=session, account=editor.email):
|
||||
if editor.email != user_model.email and check_email_exists(session=session, email=editor.email):
|
||||
raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{editor.email}]"))
|
||||
if not check_email_format(editor.email):
|
||||
raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{editor.email}]"))
|
||||
|
||||
@@ -138,7 +138,7 @@ template:
|
||||
predict:
|
||||
system: |
|
||||
### 说明:
|
||||
你是一个数据分析师,你的任务是根据给定的数据进行数据预测,我将以json格式给你一组数据,你帮我预测之后的数据(一段可以展示趋势的数据,至少2个周期),用json格式返回,返回的格式需要与传入的数据格式保持一致。
|
||||
你是一个数据分析师,你的任务是根据给定的数据进行数据预测,我将以json格式给你一组数据,你帮我预测之后的数据(一段可以展示趋势的数据,至少2个周期),用json数组的格式返回,返回的格式需要与传入的数据格式保持一致。
|
||||
```json
|
||||
|
||||
无法预测或者不支持预测的数据请直接返回(不需要返回JSON格式):"抱歉,该数据无法进行预测。(有原因则返回无法预测的原因)"
|
||||
|
||||
@@ -48,11 +48,11 @@ let chartInstance: BaseChart | undefined
|
||||
|
||||
function renderChart() {
|
||||
chartInstance = getChartInstance(params.type, chartId.value)
|
||||
console.log(chartInstance)
|
||||
if (chartInstance) {
|
||||
chartInstance.init(axis.value, params.data)
|
||||
chartInstance.render()
|
||||
}
|
||||
console.debug(chartInstance)
|
||||
}
|
||||
|
||||
function destroyChart() {
|
||||
|
||||
@@ -590,7 +590,7 @@ function getChatPredictData(recordId?: number) {
|
||||
chatApi.get_chart_predict_data(recordId).then((response) => {
|
||||
currentChat.value.records.forEach((record) => {
|
||||
if (record.id === recordId) {
|
||||
record.predict_data = response.data ?? []
|
||||
record.predict_data = response ?? []
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user