应用产品
基于 OpenAI Realtime、原生 Accessibility 和 Jev,实现 macOS 的全双工英语语音控制。
English full-duplex voice control for macOS with OpenAI Realtime, native Accessibility, and Jev.
export const TYPESAFE_ENDPOINT = "https://api.typesafe.ai/v1/systemone";链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
intent是/否Which browser action does the user ask for in `transcript`?
target是/否Which element in `elements` is the one the user refers to in `transcript` (the thing to click, type into or select)? Each line of `elements` starts with the element id (e.g. e07), then its role and visible text; the options are those ids.
site是/否Which website or search engine does the user name in `transcript`?
complete是/否Has the user finished saying the command in `transcript`, so it can be executed now without waiting for more words?
is_command是/否Is `transcript` an instruction addressed to a web browser (navigate, search, click, type, scroll, tabs, confirm/cancel)?
destructive是/否Would carrying out the action in `transcript` on this `page` submit a form, place an order, pay, delete, send a message, post publicly, log out, or otherwise do something hard to undo?
scroll_amount打分How far does the user want to scroll according to `transcript`?
0 — A little: a few lines (a bit, slightly, a little)1 — One screen / one page, or no amount specified2 — All the way to the end: the very top or the very bottomtext_span是/否Which option is exactly the text the user wants typed or searched, as spoken in `transcript`? Options are verbatim candidate spans.
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
intent: { type: 'boolean', instructions: 'Which browser action does the user ask for in `transcript`?' },
target: { type: 'boolean', instructions: 'Which element in `elements` is the one the user refers to in `transcript` (the thing to click, type into or select)? Each line of `elements` starts with the element id (e.g. e07), then its role and visible text; the options are those ids.' },
site: { type: 'boolean', instructions: 'Which website or search engine does the user name in `transcript`?' },
complete: { type: 'boolean', instructions: 'Has the user finished saying the command in `transcript`, so it can be executed now without waiting for more words?' },
is_command: { type: 'boolean', instructions: 'Is `transcript` an instruction addressed to a web browser (navigate, search, click, type, scroll, tabs, confirm/cancel)?' },
destructive: { type: 'boolean', instructions: 'Would carrying out the action in `transcript` on this `page` submit a form, place an order, pay, delete, send a message, post publicly, log out, or otherwise do something hard to undo?' },
scroll_amount: { type: 'score', instructions: 'How far does the user want to scroll according to `transcript`?',
criteria: ['A little: a few lines (a bit, slightly, a little)', 'One screen / one page, or no amount specified', 'All the way to the end: the very top or the very bottom'] },
text_span: { type: 'boolean', instructions: 'Which option is exactly the text the user wants typed or searched, as spoken in `transcript`? Options are verbatim candidate spans.' },
},
});