Skip to content

Update databricks-ai-functions skill for AI Functions v2 API#441

Open
qian-yu-db wants to merge 1 commit intomainfrom
ai-function-v2-update
Open

Update databricks-ai-functions skill for AI Functions v2 API#441
qian-yu-db wants to merge 1 commit intomainfrom
ai-function-v2-update

Conversation

@qian-yu-db
Copy link
Copy Markdown
Collaborator

Summary

  • ai_classify v2: JSON string labels (2-500, was 2-20), VARIANT return type, multi-label support, label descriptions, instructions option
  • ai_extract v2: JSON schema with nested structures (up to 7 levels, 128 fields), typed fields, VARIANT return type, composability with ai_parse_document
  • Decision boundary shift: "flat → ai_extract; nested → ai_query" becomes "structured (flat or nested) → ai_extract v2; extreme complexity → ai_query"
  • Pipeline Stage 3b rewrite: replaces ai_query + from_json with ai_extract v2 for nested line-item extraction
  • New Pattern 3b: demonstrates v2 composable VARIANT chaining (ai_parse_document → ai_classify → ai_extract) without intermediate text extraction

Files changed

File Changes
1-task-functions.md Rewrote ai_classify and ai_extract sections with v2 as primary, v1 as legacy
SKILL.md Updated function selection table, quick start examples, patterns, common issues
4-document-processing-pipeline.md Updated pipeline stages, rewrote Stage 3b, cascaded VARIANT access patterns
2-ai-query.md Narrowed "When to Use" to reflect v2 capabilities

References

…ify)

- Rewrite ai_classify section: v2 syntax (JSON string labels, VARIANT return,
  2-500 labels, multi-label support, instructions option), legacy v1 preserved
- Rewrite ai_extract section: v2 syntax (JSON schema with nested structures up
  to 7 levels/128 fields, typed fields, VARIANT return), composability with
  ai_parse_document, legacy v1 preserved
- Update function selection tables and decision boundary across all files:
  "flat → ai_extract; nested → ai_query" becomes "structured (flat or nested)
  → ai_extract v2; extreme complexity → ai_query"
- Rewrite pipeline Stage 3b from ai_query to ai_extract v2 for nested
  line-item extraction, with ai_query preserved as commented alternative
- Add Pattern 3b showing v2 composable VARIANT chaining:
  ai_parse_document → ai_classify → ai_extract without intermediate text extraction
- Update all VARIANT access patterns (header:response.X replaces header.X)
- Add common issues rows for v2 return types and multi-label classification

Co-authored-by: Isaac
@dustinvannoy-db
Copy link
Copy Markdown
Collaborator

@qian-yu-db I just merged one that I htink covers the core changes here. If there is anything you feel still needs added please create a PR with just that and submit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants