feat: add allow_llm_to_see_data flag for vanna (#9156)

This commit is contained in:
zhuhao
2024-10-10 17:39:26 +08:00
committed by GitHub
parent be2f1e59f2
commit 05c1ef75c4
4 changed files with 102 additions and 195 deletions

View File

@@ -111,9 +111,10 @@ class VannaTool(BuiltinTool):
# with "visualize" set to True (default behavior) leads to remote code execution.
# Affected versions: <= 0.5.5
#########################################################################################
generate_chart = False
# generate_chart = tool_parameters.get("generate_chart", True)
res = vn.ask(prompt, False, True, generate_chart)
allow_llm_to_see_data = tool_parameters.get("allow_llm_to_see_data", False)
res = vn.ask(
prompt, print_results=False, auto_train=True, visualize=False, allow_llm_to_see_data=allow_llm_to_see_data
)
result = []

View File

@@ -200,14 +200,14 @@ parameters:
en_US: If enabled, it will attempt to train on the metadata of that database
zh_Hans: 是否自动从数据库获取元数据来训练
form: form
- name: generate_chart
- name: allow_llm_to_see_data
type: boolean
required: false
default: True
default: false
label:
en_US: Generate Charts
zh_Hans: 生成图表
en_US: Whether to allow the LLM to see the data
zh_Hans: 是否允许LLM查看数据
human_description:
en_US: Generate Charts
zh_Hans: 是否生成图表
en_US: Whether to allow the LLM to see the data
zh_Hans: 是否允许LLM查看数据
form: form