Feat: add data type invoke (#5126)

### What problem does this PR solve?
```
Invoke agent
To be able to interact dynamically with the API, there is a customizable Data Type JSON or FormData, the default is JSON 
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
so95
2025-02-27 15:15:33 +07:00
committed by GitHub
parent 7a6e70d6b3
commit 11de7599e5
5 changed files with 39 additions and 13 deletions

View File

@ -79,7 +79,6 @@ class ExeSQL(Generate, ABC):
ans = self.get_input()
ans = "".join([str(a) for a in ans["content"]]) if "content" in ans else ""
ans = self._refactor(ans)
logging.info("db_type: ", self._param.db_type)
if self._param.db_type in ["mysql", "mariadb"]:
db = pymysql.connect(db=self._param.database, user=self._param.username, host=self._param.host,
port=self._param.port, password=self._param.password)
@ -128,7 +127,6 @@ class ExeSQL(Generate, ABC):
single_sql = self._refactor(single_sql)
if self._loop > self._param.loop:
sql_res.append({"content": "Can't query the correct data via SQL statement."})
# raise Exception("Maximum loop time exceeds. Can't query the correct data via SQL statement.")
db.close()
if not sql_res:
return ExeSQL.be_output("")