skills(experimental): fix VARIANT accessors + ai_query error field in databricks-ai-functions#117
Open
malcolndandaro wants to merge 1 commit into
Conversation
… databricks-ai-functions Eval-driven fixes (SkillForge L1-L5) for databricks-ai-functions: - ai_parse_document: correct accessors to parsed:document:pages / :elements / :error_status (colon notation) — removes a self-contradiction that stalled the agent - ai_extract: standardize on JSON-string schema + colon VARIANT access; note dot returns NULL on a VARIANT; add v1/v2.1 version distinction - ai_query: fix failOnError struct error field .error -> .errorMessage (per docs) All three originally-regressing cases (ai_extract, ai_parse_document, ai_translate) now pass the WITH-vs-WITHOUT eval; reconciled to the skill's own references/4 and the official Databricks docs. Signed-off-by: Malcoln Dandaro <dmalcoln@gmail.com>
simonfaltum
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eval-driven improvement of the
databricks-ai-functions(experimental) skill. I ran the skill through a full SkillForge L1–L5 evaluation (7 ground-truth cases, WITH-vs-WITHOUT controlled experiment), found that the skill was making the agent worse than no skill on three cases, diagnosed the root cause of each against the live Databricks docs, and fixed them. All corrections reconcile the skill to its own canonical reference content and the official function docs.What the eval found (baseline): L5 Output 0.53, with 5 regressions across 3 cases (the skill steered the agent to wrong output that it got right without the skill):
ai_parse_documentdocument:{pages, elements}+error_status, but the example queries usedparsed:pages[*].elements[*].content/parsed:error. The agent noticed the conflict, stopped to verify against docs, and ran out of turns before answering.ai_extractARRAY(...)→ STRUCT → dot access while the reference said it returns a VARIANT; nothing warned that dot notation returnsNULLsilently on a VARIANT. The agent produced a confused hybrid.ai_query(failOnError => false).errorin several places; the docs confirm it iserrorMessage.What changed:
ai_parse_documentaccessors — corrected examples toparsed:document:pages/parsed:document:elements/parsed:error_status(colon-notation), matching the schema tree,references/4, and the ai_parse_document docs. (SKILL.md Pattern 3 +references/1)ai_extractVARIANT access — standardized on the JSON-string schema, colon-notation access (result:response:field), and an explicit "dot notation returnsNULLon a VARIANT — always use colon" note. (SKILL.md Quick Start +references/1)ai_extractversion distinction — added a concise note that the current form (JSON-string schema) is v2.1 → returns a VARIANT (not a STRUCT), vs the legacyARRAY(...)→ STRUCT form. (references/1)ai_queryerror field — corrected.error→.errorMessage(thefailOnError => falsestruct is{response, errorMessage}per the ai_query docs). (SKILL.md +references/2+references/4)Result (clean re-eval): all 3 regressing cases now POSITIVE (
ai_extract,ai_parse_document,ai_translate→ WITH-skill 1.0);needs_skillgaps 5 → 1; positives 22 → 29; L5 Output 0.53 → ~0.58–0.61. Fix #4 (ai_queryfield name) is a docs-confirmed mechanical correction that directly targets the one remaining regression +needs_skill.Documentation safety checklist
ALL PRIVILEGES, admin tokens, or broad scopes)