Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nextchanges/bundles/genie_agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add the `genie_agents` resource for managing AI/BI Genie agents on the direct deployment engine. ([#7617](https://github.com/databricks/cli/pull/7617))
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
bundle:
name: test-bundle

resources:
genie_agents:
agent1:
genie_agent_id: "01f0a1b2c3d4e5f60718293a4b5c6d7e"
display_name: bound-agent
warehouse_id: test-warehouse-id
# Matches the folder the out-of-band create below defaults to, so the
# plan right after bind is clean (no parent_path move).
parent_path: /Users/$CURRENT_USER_NAME
definition:
config:
sample_questions:
- id: "01f0a1b2c3d4e5f60718293a4b5c6d7f"
question: What was the average trip distance last month?
2 changes: 2 additions & 0 deletions acceptance/bundle/deployment/bind/genie_agent/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = false
EnvMatrix.DMS = ["", "true"]
51 changes: 51 additions & 0 deletions acceptance/bundle/deployment/bind/genie_agent/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

>>> [CLI] genie-agents create-genie-agent --json {
"display_name": "bound-agent",
"warehouse_id": "test-warehouse-id",
"parent_path": "/Users/[USERNAME]",
"definition": {
"config": {
"sample_questions": [
{"id": "01f0a1b2c3d4e5f60718293a4b5c6d7f", "question": "What was the average trip distance last month?"}
]
}
}
} --genie-agent-id 01f0a1b2c3d4e5f60718293a4b5c6d7e
{
"name": "agents/01f0a1b2c3d4e5f60718293a4b5c6d7e",
"display_name": "bound-agent",
"warehouse_id": "test-warehouse-id"
}

>>> [CLI] bundle deployment bind agent1 01f0a1b2c3d4e5f60718293a4b5c6d7e --auto-approve
Successfully bound genie_agent with an id '01f0a1b2c3d4e5f60718293a4b5c6d7e'
Run 'bundle deploy' to deploy changes to your workspace

>>> [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Files: 2 uploaded, 0 deleted
Resources: 0 created, 0 changed, 0 deleted, 1 unchanged

>>> [CLI] genie-agents get-genie-agent agents/01f0a1b2c3d4e5f60718293a4b5c6d7e
{
"name": "agents/01f0a1b2c3d4e5f60718293a4b5c6d7e",
"display_name": "bound-agent",
"warehouse_id": "test-warehouse-id"
}

>>> [CLI] bundle deployment unbind agent1

>>> [CLI] bundle destroy --auto-approve
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Destroy: 0 deleted

>>> [CLI] genie-agents get-genie-agent agents/01f0a1b2c3d4e5f60718293a4b5c6d7e
{
"name": "agents/01f0a1b2c3d4e5f60718293a4b5c6d7e",
"display_name": "bound-agent",
"warehouse_id": "test-warehouse-id"
}
38 changes: 38 additions & 0 deletions acceptance/bundle/deployment/bind/genie_agent/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
AGENT="01f0a1b2c3d4e5f60718293a4b5c6d7e"

envsubst < databricks.yml.tmpl > databricks.yml

# Create the object outside the bundle in the same folder as its local config.
AGENT_CONFIG=$(cat <<EOF
{
"display_name": "bound-agent",
"warehouse_id": "test-warehouse-id",
"parent_path": "/Users/$CURRENT_USER_NAME",
"definition": {
"config": {
"sample_questions": [
{"id": "01f0a1b2c3d4e5f60718293a4b5c6d7f", "question": "What was the average trip distance last month?"}
]
}
}
}
EOF
)
trace $CLI genie-agents create-genie-agent --json "$AGENT_CONFIG" --genie-agent-id "$AGENT" | agent_fields

trace $CLI bundle deployment bind agent1 "$AGENT" --auto-approve
Comment thread
eric-cho1 marked this conversation as resolved.
Resolved

# Bind copies the remote object into state, so the first plan after bind must
# be clean (no recreate).
trace $CLI bundle plan

trace $CLI bundle deploy

trace $CLI genie-agents get-genie-agent "agents/$AGENT" | agent_fields

trace $CLI bundle deployment unbind agent1

trace $CLI bundle destroy --auto-approve

# Read the Genie agent again (expecting it still exists and is not deleted):
trace $CLI genie-agents get-genie-agent "agents/$AGENT" | agent_fields
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Project a genie agent read to the fields the test asserts.
agent_fields() {
jq '{name, display_name, warehouse_id}'
}
6 changes: 6 additions & 0 deletions acceptance/bundle/deployment/bind/genie_agent/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Genie agents are managed by the direct deployment engine.
Cloud = false

Ignore = [
".databricks",
]
2 changes: 2 additions & 0 deletions acceptance/bundle/invariant/auto-migrate/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ EnvMatrixExclude.no_external_location = ["INPUT_CONFIG=external_location.yml.tmp
EnvMatrixExclude.no_uc_trailing_slash = ["INPUT_CONFIG=uc_trailing_slash.yml.tmpl"]
# Genie spaces are direct-only too; the terraform deploy that seeds the migration fails for them.
EnvMatrixExclude.no_genie_space = ["INPUT_CONFIG=genie_space.yml.tmpl"]
# Genie agents are direct-only too; the terraform deploy that seeds the migration fails for them.
EnvMatrixExclude.no_genie_agent = ["INPUT_CONFIG=genie_agent.yml.tmpl"]
# Instance pools are direct-only; the terraform deploy that seeds the migration fails for them.
EnvMatrixExclude.no_instance_pool = ["INPUT_CONFIG=instance_pool.yml.tmpl"]
# Cluster policies are direct-only; the terraform deploy that seeds the migration fails for them.
Expand Down
20 changes: 20 additions & 0 deletions acceptance/bundle/invariant/configs/genie_agent.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
bundle:
name: test-bundle-$UNIQUE_NAME

resources:
genie_agents:
foo:
warehouse_id: $TEST_DEFAULT_WAREHOUSE_ID
display_name: test-genie-agent-$UNIQUE_NAME
description: This is a test genie agent # CAN_REMOVE
definition:
config:
sample_questions:
- id: "01f0a1b2c3d4e5f60718293a4b5c6d7e"
question: What was the average trip distance last month?
data_sources:
tables:
- identifier: samples.nyctaxi.trips
permissions:
- level: CAN_READ
group_name: users
3 changes: 3 additions & 0 deletions acceptance/bundle/invariant/continue_293/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ EnvMatrixExclude.no_vector_search_index = ["INPUT_CONFIG=vector_search_index.yml
# genie_spaces resource is not supported on v0.293.0
EnvMatrixExclude.no_genie_space = ["INPUT_CONFIG=genie_space.yml.tmpl"]

# genie_agents resource is not supported on v0.293.0
EnvMatrixExclude.no_genie_agent = ["INPUT_CONFIG=genie_agent.yml.tmpl"]

# instance_pools resource is not supported on v0.293.0
EnvMatrixExclude.no_instance_pool = ["INPUT_CONFIG=instance_pool.yml.tmpl"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ EnvMatrix.INPUT_CONFIG = [
"external_location.yml.tmpl",
"feature.yml.tmpl",
"feature_spec.yml.tmpl",
"genie_agent.yml.tmpl",
"genie_space.yml.tmpl",
"instance_pool.yml.tmpl",
"job.yml.tmpl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ EnvMatrix.INPUT_CONFIG = [
"external_location.yml.tmpl",
"feature.yml.tmpl",
"feature_spec.yml.tmpl",
"genie_agent.yml.tmpl",
"genie_space.yml.tmpl",
"instance_pool.yml.tmpl",
"job.yml.tmpl",
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/invariant/migrate/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ EnvMatrixExclude.no_external_location = ["INPUT_CONFIG=external_location.yml.tmp
EnvMatrixExclude.no_uc_trailing_slash = ["INPUT_CONFIG=uc_trailing_slash.yml.tmpl"]
# Genie spaces are direct-only too; the terraform deploy that seeds the migration fails for them.
EnvMatrixExclude.no_genie_space = ["INPUT_CONFIG=genie_space.yml.tmpl"]
# Genie agents are direct-only too; the terraform deploy that seeds the migration fails for them.
EnvMatrixExclude.no_genie_agent = ["INPUT_CONFIG=genie_agent.yml.tmpl"]
# Instance pools are direct-only; the terraform deploy that seeds the migration fails for them.
EnvMatrixExclude.no_instance_pool = ["INPUT_CONFIG=instance_pool.yml.tmpl"]
# Cluster policies are direct-only; the terraform deploy that seeds the migration fails for them.
Expand Down
1 change: 1 addition & 0 deletions acceptance/bundle/invariant/no_drift/out.test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ EnvMatrix.INPUT_CONFIG = [
"external_location.yml.tmpl",
"feature.yml.tmpl",
"feature_spec.yml.tmpl",
"genie_agent.yml.tmpl",
"genie_space.yml.tmpl",
"instance_pool.yml.tmpl",
"job.yml.tmpl",
Expand Down
3 changes: 3 additions & 0 deletions acceptance/bundle/invariant/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EnvMatrix.INPUT_CONFIG = [
"external_location.yml.tmpl",
"feature.yml.tmpl",
"feature_spec.yml.tmpl",
"genie_agent.yml.tmpl",
"genie_space.yml.tmpl",
"instance_pool.yml.tmpl",
"job.yml.tmpl",
Expand Down Expand Up @@ -128,6 +129,8 @@ EnvMatrixExclude.no_data_quality_monitor_on_cloud = ["CONFIG_Cloud=true", "INPUT
EnvMatrixExclude.no_feature_spec_dms = ["DMS=true", "INPUT_CONFIG=feature_spec.yml.tmpl"]
# Same for the "postgres_data_apis." prefix.
EnvMatrixExclude.no_postgres_data_api_dms = ["DMS=true", "INPUT_CONFIG=postgres_data_api.yml.tmpl"]
# Same for the "genie_agents." prefix.
EnvMatrixExclude.no_genie_agent_dms = ["DMS=true", "INPUT_CONFIG=genie_agent.yml.tmpl"]

[[Server]]
Pattern = "DELETE /api/2.1/unity-catalog/tables/{full_name}"
Expand Down
128 changes: 128 additions & 0 deletions acceptance/bundle/refschema/output/genie_agents.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
resources.genie_agents.*.create_time *time.Time ALL
resources.genie_agents.*.definition genieagents.GenieAgentDefinition ALL
resources.genie_agents.*.definition.benchmarks *genieagents.GenieAgentBenchmarks ALL
resources.genie_agents.*.definition.benchmarks.questions []genieagents.GenieAgentBenchmarkQuestion ALL
resources.genie_agents.*.definition.benchmarks.questions[*] genieagents.GenieAgentBenchmarkQuestion ALL
resources.genie_agents.*.definition.benchmarks.questions[*].answer []genieagents.GenieAgentBenchmarkAnswer ALL
resources.genie_agents.*.definition.benchmarks.questions[*].answer[*] genieagents.GenieAgentBenchmarkAnswer ALL
resources.genie_agents.*.definition.benchmarks.questions[*].answer[*].content string ALL
resources.genie_agents.*.definition.benchmarks.questions[*].answer[*].format genieagents.GenieAgentBenchmarkAnswerFormat ALL
resources.genie_agents.*.definition.benchmarks.questions[*].evaluation_note string ALL
resources.genie_agents.*.definition.benchmarks.questions[*].id string ALL
resources.genie_agents.*.definition.benchmarks.questions[*].question string ALL
resources.genie_agents.*.definition.config *genieagents.GenieAgentConfig ALL
resources.genie_agents.*.definition.config.sample_questions []genieagents.GenieAgentSampleQuestion ALL
resources.genie_agents.*.definition.config.sample_questions[*] genieagents.GenieAgentSampleQuestion ALL
resources.genie_agents.*.definition.config.sample_questions[*].id string ALL
resources.genie_agents.*.definition.config.sample_questions[*].question string ALL
resources.genie_agents.*.definition.data_sources *genieagents.GenieAgentDataSources ALL
resources.genie_agents.*.definition.data_sources.mcp_connections []genieagents.GenieAgentMcpConnection ALL
resources.genie_agents.*.definition.data_sources.mcp_connections[*] genieagents.GenieAgentMcpConnection ALL
resources.genie_agents.*.definition.data_sources.mcp_connections[*].mcp_connection string ALL
resources.genie_agents.*.definition.data_sources.tables []genieagents.GenieAgentTable ALL
resources.genie_agents.*.definition.data_sources.tables[*] genieagents.GenieAgentTable ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs []genieagents.GenieAgentColumnConfig ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*] genieagents.GenieAgentColumnConfig ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].column string ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].description string ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].display_name string ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].enable_entity_matching bool ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].enable_format_assistance bool ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].exclude bool ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].synonyms []string ALL
resources.genie_agents.*.definition.data_sources.tables[*].column_configs[*].synonyms[*] string ALL
resources.genie_agents.*.definition.data_sources.tables[*].description string ALL
resources.genie_agents.*.definition.data_sources.tables[*].identifier string ALL
resources.genie_agents.*.definition.data_sources.volumes []genieagents.GenieAgentVolume ALL
resources.genie_agents.*.definition.data_sources.volumes[*] genieagents.GenieAgentVolume ALL
resources.genie_agents.*.definition.data_sources.volumes[*].description string ALL
resources.genie_agents.*.definition.data_sources.volumes[*].path string ALL
resources.genie_agents.*.definition.instructions *genieagents.GenieAgentInstructions ALL
resources.genie_agents.*.definition.instructions.example_question_sqls []genieagents.GenieAgentExampleQuestionSql ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*] genieagents.GenieAgentExampleQuestionSql ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].id string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters []genieagents.GenieAgentSqlParameter ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*] genieagents.GenieAgentSqlParameter ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].default_value *genieagents.GenieAgentSqlParameterDefaultValue ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].default_value.value_range *genieagents.GenieAgentSqlParameterDefaultRange ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].default_value.value_range.max string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].default_value.value_range.min string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].default_value.values []string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].default_value.values[*] string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].description string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].name string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].parameters[*].type_hint string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].question string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].sql string ALL
resources.genie_agents.*.definition.instructions.example_question_sqls[*].usage_guidance string ALL
resources.genie_agents.*.definition.instructions.join_specs []genieagents.GenieAgentJoinSpec ALL
resources.genie_agents.*.definition.instructions.join_specs[*] genieagents.GenieAgentJoinSpec ALL
resources.genie_agents.*.definition.instructions.join_specs[*].comment string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].id string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].instruction string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].left genieagents.GenieAgentJoinSource ALL
resources.genie_agents.*.definition.instructions.join_specs[*].left.alias string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].left.identifier string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].relationship_type genieagents.GenieAgentJoinRelationshipType ALL
resources.genie_agents.*.definition.instructions.join_specs[*].right genieagents.GenieAgentJoinSource ALL
resources.genie_agents.*.definition.instructions.join_specs[*].right.alias string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].right.identifier string ALL
resources.genie_agents.*.definition.instructions.join_specs[*].sql string ALL
resources.genie_agents.*.definition.instructions.sql_functions []genieagents.GenieAgentSqlFunction ALL
resources.genie_agents.*.definition.instructions.sql_functions[*] genieagents.GenieAgentSqlFunction ALL
resources.genie_agents.*.definition.instructions.sql_functions[*].id string ALL
resources.genie_agents.*.definition.instructions.sql_functions[*].identifier string ALL
resources.genie_agents.*.definition.instructions.sql_snippets *genieagents.GenieAgentSqlSnippets ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions []genieagents.GenieAgentSqlExpression ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*] genieagents.GenieAgentSqlExpression ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].alias string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].display_name string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].id string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].instruction string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].sql string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].synonyms []string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.expressions[*].synonyms[*] string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters []genieagents.GenieAgentSqlFilter ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*] genieagents.GenieAgentSqlFilter ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*].display_name string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*].id string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*].instruction string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*].sql string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*].synonyms []string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.filters[*].synonyms[*] string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures []genieagents.GenieAgentSqlMeasure ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*] genieagents.GenieAgentSqlMeasure ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].alias string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].display_name string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].id string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].instruction string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].sql string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].synonyms []string ALL
resources.genie_agents.*.definition.instructions.sql_snippets.measures[*].synonyms[*] string ALL
resources.genie_agents.*.definition.instructions.text_instructions []genieagents.GenieAgentTextInstruction ALL
resources.genie_agents.*.definition.instructions.text_instructions[*] genieagents.GenieAgentTextInstruction ALL
resources.genie_agents.*.definition.instructions.text_instructions[*].content string ALL
resources.genie_agents.*.definition.instructions.text_instructions[*].id string ALL
resources.genie_agents.*.description string ALL
resources.genie_agents.*.display_name string ALL
resources.genie_agents.*.effective_parent_path string ALL
resources.genie_agents.*.etag string ALL
resources.genie_agents.*.genie_agent_id string ALL
resources.genie_agents.*.id string INPUT
resources.genie_agents.*.lifecycle resources.Lifecycle INPUT
resources.genie_agents.*.lifecycle.depends_on []resources.DependsOn INPUT
resources.genie_agents.*.lifecycle.depends_on[*] resources.DependsOn INPUT
resources.genie_agents.*.lifecycle.depends_on[*].resource string INPUT
resources.genie_agents.*.lifecycle.prevent_destroy bool INPUT
resources.genie_agents.*.modified_status string INPUT
resources.genie_agents.*.name string ALL
resources.genie_agents.*.parent_path string ALL
resources.genie_agents.*.update_time *time.Time ALL
resources.genie_agents.*.url string INPUT
resources.genie_agents.*.warehouse_id string ALL
resources.genie_agents.*.permissions.object_id string ALL
resources.genie_agents.*.permissions[*] dresources.StatePermission ALL
resources.genie_agents.*.permissions[*].group_name string ALL
resources.genie_agents.*.permissions[*].level iam.PermissionLevel ALL
resources.genie_agents.*.permissions[*].service_principal_name string ALL
resources.genie_agents.*.permissions[*].user_name string ALL
Loading
Loading