搜索与检索
使用 TypeSafe 的 Jev 进行网页搜索,包含源选择、查询理解和相关性排序,基于 Search1API 构建。
Search the web with TypeSafe's Jev: source selection, query understanding and relevance ranking. Built with Search1API.
const TYPESAFE_URL = 'https://api.typesafe.ai/v1/systemone';链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
window选项How recent?
any — Any time7d — Past weeksource_reddit是/否Wants Reddit?
plain是/否No criteria
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
window: { type: 'choice', instructions: 'How recent?',
criteria: { any: 'Any time', 7d: 'Past week' } },
source_reddit: { type: 'boolean', instructions: 'Wants Reddit?' },
plain: { type: 'boolean', instructions: 'No criteria' },
},
});source_reddit是/否Wants Reddit?
plain是/否No criteria
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
source_reddit: { type: 'boolean', instructions: 'Wants Reddit?' },
plain: { type: 'boolean', instructions: 'No criteria' },
},
});