Computes an Amazon Titan text embedding for the input string via AWS Bedrock and returns the embedding as a float vector.
Parameters
text:
large_string
The input text.
model_id:
large_string
The model identifier to invoke.
dimensions:
int64
= NULL
The embedding dimension count.
normalize:
bool
= NULL
aws_access_key_id_override:
large_string
= NULL
aws_session_token_override:
large_string
= NULL
aws_role_arn_override:
large_string
= NULL
aws_region_override:
large_string
= NULL
aws_profile_name_override:
large_string
= NULL
Invokes an AWS Bedrock model via InvokeModel with the provided binary request body and returns the raw binary response body.
Parameters
body:
large_binary
The request body.
model_id:
large_string
The model identifier to invoke.
content_type:
large_string
= NULL
The request content type.
accept:
large_string
= NULL
The response MIME type to request.
aws_access_key_id_override:
large_string
= NULL
aws_session_token_override:
large_string
= NULL
aws_role_arn_override:
large_string
= NULL
aws_region_override:
large_string
= NULL
aws_profile_name_override:
large_string
= NULL
Classifies `text` with the fine-tuned encoder at `url` (chalk-encoder:// or chalk-encoder+grpc[s]://): `label_index` indexes `labels` (a JSON array of the model's label names) and `probability` is that label's probability renormalized over `labels`. A row is null where `text` is null; `error` is set on every row of a failed call. `url` and `labels` must be literals.
Parameters
url:
large_string
The URL to request.
labels:
large_string
text:
large_string
The input text.
Alias of `prompt_jev`: asks Jev's structured-decision API a set of typed questions (noul/choice/score) about `state` and returns the answers as a JSON string alongside usage statistics.
Parameters
state:
large_string
The current state value.
questions:
large_string
model:
large_string
= NULL
api_server:
large_string
= NULL
api_key:
large_string
= NULL
Makes a completion request to OpenAI's chat API and returns the response.
Parameters
prompt:
large_string
model:
large_string
= NULL
api_server:
large_string
= NULL
api_key:
large_string
= NULL
max_tokens:
int64
= NULL
temperature:
double
= NULL
service_tier:
large_string
= NULL
response_format:
large_string
= NULL
chat_template_kwargs:
large_string
= NULL
extra_body:
large_string
= NULL
api:
large_string
= NULL
timeout_seconds:
double
= NULL
Examples
SELECT openai_complete('Classify this card transaction memo into exactly one category from [groceries, dining, travel, utilities, other]. Reply with the category only, lowercase. Memo: UBER *TRIP SAN FRANCISCO CA', model => 'gpt-4o-mini', temperature => 0.0, max_tokens => 5).completion AS memo_category;
| memo_category |
| ------------- |
| travel        |
SELECT openai_complete('Rate the urgency of this support ticket from 1 (low) to 5 (critical) and name its topic in one word. Ticket: Our checkout page has returned 500 errors for every customer since 9am.', model => 'gpt-4o-mini', temperature => 0.0, response_format => '{"type": "json_schema", "json_schema": {"name": "ticket", "strict": true, "schema": {"type": "object", "properties": {"urgency": {"type": "integer"}, "topic": {"type": "string"}}, "required": ["urgency", "topic"], "additionalProperties": false}}}').completion AS ticket_triage;
| ticket_triage                    |
| -------------------------------- |
| {"topic":"Checkout","urgency":5} |
Makes a completion request to OpenAI's chat API and returns the raw JSON response string.
Parameters
prompt:
large_string
model:
large_string
= NULL
api_server:
large_string
= NULL
api_key:
large_string
= NULL
max_tokens:
int64
= NULL
temperature:
double
= NULL
service_tier:
large_string
= NULL
response_format:
large_string
= NULL
chat_template_kwargs:
large_string
= NULL
Examples
SELECT json_extract_scalar(openai_complete_raw('Classify this card transaction memo into one category (groceries, travel, dining, utilities). Reply with only the category: UBER *TRIP SAN FRANCISCO', model => 'gpt-4o-mini', temperature => 0.0), '$.choices[0].message.content') AS memo_category;
| memo_category |
| ------------- |
| travel        |
SELECT json_extract_scalar(openai_complete_raw('Summarize this support ticket in one sentence: My order #4821 arrived with a cracked screen and I need a replacement before Friday.', model => 'gpt-4o-mini', max_tokens => 5, temperature => 0.0), '$.choices[0].finish_reason') AS finish_reason;
| finish_reason |
| ------------- |
| length        |
Makes an embedding request to OpenAI's embeddings API and returns the response.
Parameters
input:
large_string
The input value.
model:
large_string
= NULL
api_server:
large_string
= NULL
api_key:
large_string
= NULL
dimensions:
int64
= NULL
The embedding dimension count.
Examples
SELECT round(cosine_similarity_vector(openai_embed('Wireless noise-cancelling headphones', model => 'text-embedding-3-small').embedding, openai_embed('Bluetooth over-ear headset with ANC', model => 'text-embedding-3-small').embedding), 1) AS title_similarity;
| title_similarity |
| ---------------- |
| 0.6              |
SELECT cardinality(openai_embed('Wireless noise-cancelling headphones', model => 'text-embedding-3-small', dimensions => 256).embedding) AS embedding_dims;
| embedding_dims |
| -------------- |
| 256            |
Asks Jev's structured-decision API a set of typed questions (noul/choice/score) about `state` and returns the answers as a JSON string alongside usage statistics.
Parameters
state:
large_string
The current state value.
questions:
large_string
model:
large_string
= NULL
api_server:
large_string
= NULL
api_key:
large_string
= NULL
Invokes an AWS SageMaker endpoint for inference with the provided binary input and returns the binary output.
Parameters
body:
large_binary
The request body.
endpoint:
large_string
The name of the model endpoint to invoke.
content_type:
large_string
The request content type.
target_model:
large_string
target_variant:
large_string
Invokes a Vertex AI endpoint for inference with binary input, returns binary output.
Parameters
body:
large_binary
The request body.
endpoint:
large_string
The name of the model endpoint to invoke.
content_type:
large_string
= NULL
The request content type.
gcp_credentials_override:
large_string
= NULL
dedicated_endpoint_dns:
large_string
= NULL
method:
large_string
= NULL
The HTTP method, such as 'GET' or 'POST'.
api_host:
large_string
= NULL