some more tweaks

This commit is contained in:
dal 2025-02-17 11:49:04 -07:00
parent 9b1daff0be
commit 387533de5d
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 22 additions and 20 deletions

View File

@ -391,20 +391,23 @@ async fn store_final_message_state(
}
const AGENT_PROMPT: &str = r##"
You are an expert analytics/data engineer helping non-technical users get answers to their analytics questions quickly and accurately. You primarily do this by creating or returning metrics and dashboards that already exist or can be built from available datasets.
You have access to the datasets, documentation, etc. to help you fulfill the user's request through the data catalog.
You are an expert analytics/data engineer.
## Core Responsibilities/Guidelines
# Core Guidelines
- If you don't have the information you need to answer/build/etc. you should search the data catalog
- If you can't find any relevant information in the data catalog, you should explain what you tried to the user.
- You should search the data catalog before creating or modifying any files
- Only open (and show) files that clearly fulfill the user's request
- prefer bulk actions where possible
- Provide concise, friendly explanations
- Politely explain if you cannot fulfill a request with available context
*Today's date is FEB 17, 2025*
## General Frameworks/Tips
- Before creating a dashboard, you should either a) find relevant metrics or b) create the metrics you need first
================================================================================
For context, here is the yml schema for metrics:
```yml
@ -672,7 +675,7 @@ definitions:
- x
- y
i_column_label_format:
column_label_format:
type: object
description: >
Describes how a column's data is formatted (currency, percent, date, etc.).
@ -984,7 +987,7 @@ For context, here is the yml schema for dashboards:
# The file is annotated with comments that serve as documentation for users.
#
# Each dashboard should have:
# 1) A top-level "title" (string).
# 1) A top-level "name" (string).
# 2) A "rows" field, which is an array of row definitions.
# 3) Each row contains an array called "items" with up to 4 metric objects.
# 4) Each metric object has:
@ -999,17 +1002,17 @@ For context, here is the yml schema for dashboards:
# ------------------------------------------------------------------------------
type: object
title: "Dashboard Configuration Schema"
name: "Dashboard Configuration Schema"
description: "Specifies the structure and constraints of a dashboard config file."
properties:
# ----------------------
# 1. TITLE
# 1. name
# ----------------------
title:
name:
type: string
description: >
The title of the entire dashboard (e.g. "Sales & Marketing Dashboard").
The name of the entire dashboard (e.g. "Sales & Marketing Dashboard").
This field is mandatory.
# ----------------------
@ -1064,10 +1067,9 @@ properties:
required:
- items
# Top-level "title" and "rows" are required for every valid dashboard config.
# Top-level "name" is required for every valid dashboard config.
required:
- title
- name
# ------------------------------------------------------------------------------
# NOTE ON WIDTH SUM VALIDATION:
# ------------------------------------------------------------------------------

View File

@ -277,7 +277,7 @@ impl ToolExecutor for CreateFilesTool {
"file_type": {
"type": "string",
"enum": ["metric", "dashboard"],
"description": "The type of file to create. Note that metrics must exist before they can be used in dashboards."
"description": "The type of file to create. All files in a single request must be of the same type. Metrics and dashboards cannot be created in the same request."
},
"yml_content": {
"type": "string",
@ -286,12 +286,12 @@ impl ToolExecutor for CreateFilesTool {
},
"additionalProperties": false
},
"description": "Array of files to create. When creating both metrics and dashboards, metrics should be created first since dashboards depend on existing metrics."
"description": "Array of files to create. All files in a single request must be of the same type (either all metrics or all dashboards). Metrics must be created in a separate request from dashboards since dashboards depend on existing metrics."
}
},
"additionalProperties": false
},
"description": "Creates **new** metric or dashboard files. Use this if no existing file can fulfill the user's needs. Metrics must be created before they can be referenced in dashboards. This will automatically open the created files for the user."
"description": "Creates **new** metric or dashboard files. Use this if no existing file can fulfill the user's needs. IMPORTANT: Metrics and dashboards must be created in separate requests - you cannot mix them in the same request. Create metrics first, then create dashboards that reference those metrics in a separate request."
})
}
}