Jev
Overview
The Jev connector enables your AI Colleagues to integrate with TypeSafe's Jev model, facilitating structured decision-making such as yes/no checks, classification, routing and scoring within automated workflows.
Jev is TypeSafe's evaluation model, designed to assess content against typed questions and return structured answers with probabilities and confidence scores, rather than free-form text. The Jev connector allows Leena AI to make fast, consistent judgments — for example, whether a request is urgent, which team should handle it, or how frustrated an employee is — that AI Colleagues can act on directly.
API Details
Leena AI integrates with Jev via REST APIs.
Documentation link: https://docs.typesafe.ai/api
Setup
The Jev connector uses API Key authentication.
Prerequisites
Before setting up the Jev connector, ensure you have:
- A TypeSafe account (or use Leena AI's built-in authentication)
- Access to the TypeSafe Console for API key generation (optional)
- Understanding of the question types supported by Jev (Noul, Choice and Score)
- Access to your Leena AI workspace with connector management permissions
Get credentials
Here is how to create an API key in the TypeSafe Console:
- Sign in to TypeSafe: Log in to your account at TypeSafe Console
- Navigate to API Keys section: Open the API keys page in the console
- Create New API Key:
- Create a new API key
- Name your key: Use a descriptive name like "Leena AI Integration" or "Production Backend"
- Save and Note Credentials:
- Copy your API key immediately
- Store the key securely
Critical Security Notice: Store your API key securely and don't share it. If your key is lost or exposed, create a new one in the TypeSafe Console and update the connection in Leena AI.
Add connection
Here is how to add a connection on Leena AI:
- Log in to your Leena AI workspace
- Navigate to Settings > Integrations
- Search for "Jev" and select it from the list to add its new connector
- Start configuring the connector:
Model: Choose from available Jev models:
jev-latest: Always uses TypeSafe's current production Jev model (default, recommended)jev-preview: TypeSafe's preview model, for testing upcoming changes before they reachjev-latestjev-1.13.0: A fixed model version, for results that stay consistent over time
Auth type: Choose between:
- API key: Use your own TypeSafe API key
- Leena AI auth key: Use Leena AI's managed authentication (no additional configuration required)
API key: If using your own key, paste your TypeSafe API key in the configuration field
- Test Connection: Click Test connection to verify that Leena AI can reach TypeSafe with the selected authentication
- Save Configurations:
- Ensure the key is valid and active
- Click Save to complete the connector setup
- The connector will be saved and ready to use
Tip:jev-latestcan change when TypeSafe releases a new model. If an AI Colleague's behavior depends on stable scores or thresholds, select a fixed version such asjev-1.13.0.
Actions
The following actions are supported for the Jev connector:
Evaluate
Evaluates content (the state) against one or more typed questions and returns a structured answer for each question. The Agent can leverage the tool (workflow), which has been designed to classify, route, score or check content — such as employee messages, tickets or form data — before deciding what to do next.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| State | The content to evaluate. Plain text (for example, an employee's message) or JSON (for example, a ticket, chat transcript or form data) |
| Questions | Array of one or more questions to evaluate against the state |
Question Structure:
Each question in the questions array must follow this structure:
| Name | Required | Description |
|---|---|---|
| Question ID | Yes | Unique key for the question (e.g. is_urgent). The answer is returned under this key. Must be unique within the call |
| Type | Yes | Question type (values: noul, choice or score) |
| Instructions | Yes | The question to ask (e.g. "Does this message express urgency?"). Plain text or JSON |
| Criteria (JSON) | Depends on type | Defines the possible answers. Required for choice and score, optional for noul |
Question Types:
| Type | Description | Criteria Format |
|---|---|---|
| Noul (yes/no) | Returns a probability from 0 (no) to 1 (yes) | Optional. JSON object with "true" and "false" keys describing each answer, e.g. {"true": "Urgent", "false": "Not urgent"} |
| Choice | Selects one option from a defined set, with the probability of each option and a confidence score | Required. JSON object mapping each option to a description, e.g. {"billing": "Payments", "technical": "Bugs"}. 1 to 255 options |
| Score | Rates content on an ordered scale, returning a probability-weighted score and a confidence score | Required. JSON array of 2 to 10 levels, ordered lowest to highest, e.g. ["Calm", "Frustrated", "Very angry"] |
Confidence Guidelines:
| Value | Description | Use Case |
|---|---|---|
| Above 0.8 | High confidence | Act on the answer automatically |
| 0.5 – 0.8 | Moderate confidence | Act, but log for review |
| Below 0.5 | Low confidence | Route to a human for review |
These ranges are a starting point. Adjust them to suit how critical the decision is.
Here is a sample JSON input:
//Yes/No Check (Noul)
{
"payload": {
"state": "My salary hasn't been credited for 3 days and I can't pay rent. Please help ASAP.",
"questions": [
{
"id": "is_urgent",
"type": "noul",
"instructions": "Does this message express urgency?",
"criteria": "{\"true\": \"Urgent\", \"false\": \"Not urgent\"}"
}
]
}
}
//Routing (Choice)
{
"payload": {
"state": "I can't log in to my laptop after the latest update.",
"questions": [
{
"id": "department",
"type": "choice",
"instructions": "Which team should handle this request?",
"criteria": "{\"payroll\": \"Salary, payslips and deductions\", \"it\": \"Devices, access and software\", \"hr\": \"Leave, policies and benefits\"}"
}
]
}
}
//Sentiment Rating (Score)
{
"payload": {
"state": "This is the third time I'm asking about my reimbursement. Nobody has replied.",
"questions": [
{
"id": "frustration",
"type": "score",
"instructions": "How frustrated is the employee?",
"criteria": "[\"Calm\", \"Frustrated\", \"Very angry\"]"
}
]
}
}
//Structured State with Multiple Questions
{
"payload": {
"state": "{\"ticket_id\": \"TKT-10482\", \"subject\": \"Salary not credited\", \"message\": \"My salary hasn't been credited for 3 days and I can't pay rent. Please help ASAP.\"}",
"questions": [
{
"id": "is_urgent",
"type": "noul",
"instructions": "Does this ticket express urgency?"
},
{
"id": "department",
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": "{\"payroll\": \"Salary, payslips and deductions\", \"it\": \"Devices, access and software\", \"hr\": \"Leave, policies and benefits\"}"
},
{
"id": "frustration",
"type": "score",
"instructions": "How frustrated is the employee?",
"criteria": "[\"Calm\", \"Frustrated\", \"Very angry\"]"
}
]
}
}Response
Upon successful evaluation, the action returns:
- An answer for each question, returned under its Question ID
- Question type for each answer (
noul,choiceorscore) - For Noul: probability that the answer is yes (0 to 1)
- For Choice: the selected option, the probability of each option and a confidence score (0 to 1)
- For Score: the probability-weighted score (which can fall between levels, e.g. 1.3), a legend mapping each level index to its label, the probability of each level and a confidence score (0 to 1)
- Model version used for evaluation
- Token usage information (input tokens and output tokens)
Here is a sample JSON response:
{
"model": "jev-1.13.0",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.96
},
"department": {
"type": "choice",
"choice": "payroll",
"probabilities": { "payroll": 0.94, "it": 0.01, "hr": 0.05 },
"confidence": 0.9
},
"frustration": {
"type": "score",
"score": 1.3,
"legend": { "0": "Calm", "1": "Frustrated", "2": "Very angry" },
"probabilities": { "0": 0.02, "1": 0.66, "2": 0.32 },
"confidence": 0.71
}
},
"usage": { "input_tokens": 412, "output_tokens": 38 }
}Error Handling
| Status | Description |
|---|---|
| 400 | Invalid input, such as a duplicate Question ID, missing instructions, criteria that isn't valid JSON, or criteria outside the allowed limits (1–255 Choice options, 2–10 Score levels) |
| 401 | The API key is invalid or missing |
| 422 | TypeSafe rejected the request as malformed |
| 429 | TypeSafe rate limit exceeded. Retry after a short wait |
| 529 | TypeSafe is temporarily overloaded. Retry after a short wait |
Each request times out after 60 seconds.
Updated 34 minutes ago
