Vercel News

TypeSafe AI's Jev 1.14 is now available on AI Gateway

8.5内容质量

TL;DR · AI 摘要

TypeSafe AI 的 Jev 1.14 版本新增图像输入和长上下文模式,支持更复杂的决策模型应用。

核心要点

  • Jev 1.14 支持图像输入,通过文件类型传递图像数据进行决策分析。
  • 长上下文模式可处理超长文档、日志或对话历史,提升模型处理能力。
  • 使用 AI SDK 和 Decisions API 调用模型,支持 Zero Data Retention 和 No Training 配置。

结构提纲

按章节快速跳转。

  1. 介绍 Jev 1.14 的主要更新内容和应用场景。

  2. 详细说明如何通过文件类型传递图像数据进行决策分析。

  3. 解释长上下文模式的启用方法及处理超长文档的能力。

  4. 提供代码示例展示图像输入和长上下文模式的调用方式。

  5. 介绍 Zero Data Retention 和 No Training 的启用方式。

  6. 指引读者查阅更多文档和使用案例。

思维导图

用一张图看清主题之间的关系。

查看大纲文本(无障碍 / 无 JS 友好)
  • Jev 1.14 新特性
    • 图像输入
      • 文件类型传递图像数据
    • 长上下文模式
      • 处理超长文档/日志
    • 配置选项
      • Zero Data Retention
      • No Training

金句 / Highlights

值得收藏与分享的关键句。

#AI模型#决策系统#图像处理#长上下文#TypeSafe AI
打开原文

TypeSafe AI's Jev 1.14 is now available on AI Gateway - Vercel

Jev 1.14 from TypeSafe AI is now available on AI Gateway .

Jev is a decision model for software. You pass it state and a set of questions, and it returns typed Choice, Score, and Boolean answers with probabilities instead of free-form text. It answers every question in one request, in parallel, for classification, routing, scoring, and automated verification.

Jev 1.14 accepts images as part of the state, and has an experimental long-context mode for documents, logs, or conversation histories that are too long for a standard request.

Use typesafe-ai/jev-1.14.0 as the model name.

Copy link to heading Image input

Pass an image as a file part alongside text in state . This example reads a local PNG and asks a Boolean question about its color:

AI SDK

Decisions API

code
1
import
{
readFileSync
}
from
'node:fs'
;
2
import
{
experimental_decide
as
decide
}
from
'ai'
;
3
4
const
result
=
await
decide
(
{
5
model
:
'typesafe-ai/jev-1.14.0'
,
6
state
:
[
7
{
type
:
'text'
,
text
:
'A product photo from a support ticket.'
}
,
8
{
9
type
:
'file'
,
10
mediaType
:
'image/png'
,
11
data
:
readFileSync
(
'./photo.png'
)
,
12
}
,
13
]
,
14
questions
:
{
15
red
:
{
16
type
:
'boolean'
,
17
instructions
:
'Is the image predominantly red?'
,
18
}
,
19
}
,
20
}
)
;
21
22
console
.
log
(
result
.
answers
.
red
)
;

Copy for agent

View model details

↗

Copy link to heading Long context

Enable long-context mode with providerOptions.typesafe.longContext: true . This example reads a support log and checks whether it reports a damaged delivery:

code
1
import
{
readFileSync
}
from
'node:fs'
;
2
import
{
experimental_decide
as
decide
}
from
'ai'
;
3
4
const
result
=
await
decide
(
{
5
model
:
'typesafe-ai/jev-1.14.0'
,
6
state
:
readFileSync
(
'./support-log.txt'
,
'utf8'
)
,
7
questions
:
{
8
damaged
:
{
9
type
:
'boolean'
,
10
instructions
:
'Does the log say the delivered item arrived damaged?'
,
11
}
,
12
}
,
13
providerOptions
:
{
14
typesafe
:
{
longContext
:
true
}
,
15
}
,
16
}
)
;
17
18
console
.
log
(
result
.
answers
.
damaged
)
;

Jev supports Zero Data Retention and No Training , which you can enable per request. Decision calls also appear in logs and custom reporting , count toward budgets , and accept other Gateway provider options in the same providerOptions.gateway object.

Read the documentation on decision models on AI Gateway for more details, discover practical use cases for Jev , and browse resources in the knowledge base .