浏览代码

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)
tags/v0.16.0
Kevin Hu 9 个月前
父节点
当前提交
307717b045
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      agent/component/exesql.py

+ 6
- 1
agent/component/exesql.py 查看文件

# #
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
import pyodbc import pyodbc
import logging import logging



class ExeSQLParam(GenerateParam): class ExeSQLParam(GenerateParam):
""" """
Define the ExeSQL component parameters. Define the ExeSQL component parameters.
## 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

正在加载...
取消
保存