Skip to content

Commit

Permalink
feat: add allow_llm_to_see_data flag for vanna
Browse files Browse the repository at this point in the history
  • Loading branch information
hwzhuhao committed Oct 10, 2024
1 parent 68107fe commit 4f382c2
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 195 deletions.
7 changes: 4 additions & 3 deletions api/core/tools/provider/builtin/vanna/tools/vanna.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ def _invoke(
# 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 = []

Expand Down
12 changes: 6 additions & 6 deletions api/core/tools/provider/builtin/vanna/tools/vanna.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 4f382c2

Please sign in to comment.