jev is a Bloom scalar function that evaluates a state against a typed question using TypeSafe’s Jev model. Use it to classify text, assess a yes/no statement, or rate text against a rubric.
Setup
- Open Settings → Config → Environment.
- Under General, click + Add variable.
- Set the name to
TYPESAFE_API_KEYand the value to your TypeSafe API key, then save it.
jev.
Run the queries below on Bloom. jev is available in local and distributed Bloom execution and currently uses TypeSafe’s jev-latest model.
Syntax
Pass one question object as the second argument. Do not wrap it in the TypeSafe HTTP API’s
questions map or include the full API request body.
Use single quotes around SQL string literals and double quotes inside JSON. Escape an apostrophe inside a SQL string by doubling it: 'What''s new?'.
Return value
For all three question types,jev returns a JSON object encoded as a SQL string (Utf8). On success, Bloom extracts the answer at answers.result from TypeSafe’s response and serializes that object as the result column.
For example, a successful Noul result contains JSON text with this shape (illustrative value):
error object before reading answer fields.
A SQL NULL state returns SQL NULL without making an API request. Empty strings are evaluated; the Choice example below filters them out before calling jev.
Question types
Choice: classify social media posts
This example evaluates up to 100 nonempty posts. Replaceoleander.bluesky.bluesky_posts with your own table and text with the column you want to classify.
text, supplies the state from each row. The second argument supplies the same question for those rows. The other option covers posts that do not fit the named categories.
Noul: assess a yes/no question
This example uses a string literal as the state, so no table is needed.criteria object is optional for noul; you can use just type and instructions. TypeSafe expresses a Noul judgment as a probability from 0 to 1 that the answer is yes. See Noul for its interpretation.
Score: rate against a rubric
criteria, starting at 0. This three-level rubric spans 0 to 2, and TypeSafe’s score can fall between levels. Use descriptive levels and measure one dimension at a time. See Score for details.
Errors
A missing or emptyTYPESAFE_API_KEY, an unusable authorization header, or an invalid question fails query planning. Check the environment variable and ensure the question is a non-null JSON string literal with a supported type and valid criteria.
Failures during evaluation are returned as JSON strings in the affected rows. Other rows can still succeed. For example:
Bloom retries HTTP 429 and 529 responses up to twice within a 15-second per-row request budget. Provider error bodies are not included in the result.