ai_functions
Creates, updates, deletes, gets or lists an ai_functions resource.
Overview​
| Name | ai_functions |
| Type | Resource |
| Id | databricks_workspace.aifunctions.ai_functions |
Fields​
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
ai_classify | exec | deployment_name, workspace_domain, content, labels | Classifies content according to a set of provided labels. For REST API requests, the default rate | |
ai_decide | exec | deployment_name, workspace_domain, state, questions | Turn text and structured data into decisions your application can use. Define questions and criteria | |
ai_extract | exec | deployment_name, workspace_domain, content, schema | Extracts structured data from text and documents according to a provided schema. For REST API | |
ai_parse_document | exec | deployment_name, workspace_domain, content | Parse structured content from unstructured documents. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks workspace deployment name: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME) |
workspace_domain | string | The Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}}) |
Lifecycle Methods​
- ai_classify
- ai_decide
- ai_extract
- ai_parse_document
Classifies content according to a set of provided labels. For REST API requests, the default rate
EXEC databricks_workspace.aifunctions.ai_functions.ai_classify
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"content": "{{ content }}",
"labels": "{{ labels }}",
"options": "{{ options }}"
}'
;
Turn text and structured data into decisions your application can use. Define questions and criteria
EXEC databricks_workspace.aifunctions.ai_functions.ai_decide
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"state": "{{ state }}",
"questions": "{{ questions }}",
"options": "{{ options }}"
}'
;
Extracts structured data from text and documents according to a provided schema. For REST API
EXEC databricks_workspace.aifunctions.ai_functions.ai_extract
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"content": "{{ content }}",
"schema": "{{ schema }}",
"options": "{{ options }}"
}'
;
Parse structured content from unstructured documents.
EXEC databricks_workspace.aifunctions.ai_functions.ai_parse_document
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"content": "{{ content }}",
"options": "{{ options }}"
}'
;