瀏覽代碼

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 查看文件

@@ -15,6 +15,8 @@
#
from abc import ABC
import re
from copy import deepcopy

import pandas as pd
import pymysql
import psycopg2
@@ -22,6 +24,7 @@ from agent.component import GenerateParam, Generate
import pyodbc
import logging


class ExeSQLParam(GenerateParam):
"""
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.
'''
self._param.prompt=prompt
response = Generate._run(self, [], **kwargs)
kwargs_ = deepcopy(kwargs)
kwargs_["stream"] = False
response = Generate._run(self, [], **kwargs_)
try:
regenerated_sql = response.loc[0,"content"]
return regenerated_sql

Loading…
取消
儲存