mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-04 11:24:00 +08:00
Fix exesql re-generate SQL issue. (#4717)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
8e74bc8e42
commit
307717b045
@ -15,6 +15,8 @@
|
|||||||
#
|
#
|
||||||
from abc import ABC
|
from abc import ABC
|
||||||
import re
|
import re
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pymysql
|
import pymysql
|
||||||
import psycopg2
|
import psycopg2
|
||||||
@ -22,6 +24,7 @@ from agent.component import GenerateParam, Generate
|
|||||||
import pyodbc
|
import pyodbc
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
class ExeSQLParam(GenerateParam):
|
class ExeSQLParam(GenerateParam):
|
||||||
"""
|
"""
|
||||||
Define the ExeSQL component parameters.
|
Define the ExeSQL component parameters.
|
||||||
@ -137,7 +140,9 @@ class ExeSQL(Generate, ABC):
|
|||||||
## Answer only the modified SQL statement. Please do not give any explanation, just answer the code.
|
## Answer only the modified SQL statement. Please do not give any explanation, just answer the code.
|
||||||
'''
|
'''
|
||||||
self._param.prompt=prompt
|
self._param.prompt=prompt
|
||||||
response = Generate._run(self, [], **kwargs)
|
kwargs_ = deepcopy(kwargs)
|
||||||
|
kwargs_["stream"] = False
|
||||||
|
response = Generate._run(self, [], **kwargs_)
|
||||||
try:
|
try:
|
||||||
regenerated_sql = response.loc[0,"content"]
|
regenerated_sql = response.loc[0,"content"]
|
||||||
return regenerated_sql
|
return regenerated_sql
|
||||||
|
Loading…
x
Reference in New Issue
Block a user