600msも待てない音声エージェントのために

OpenAI: GPT-Live 1

openai/gpt-live-1
提供中 speech-to-speech 1プロバイダー
Playground

OpenAI full-duplex voice model for natural, expressive speech-to-speech conversations that listens while speaking and supports client delegation to your application.

作成者OpenAI
言語未指定
レスポンス形式ストリーミング: PCM · µ-law · A-law
ステータス提供中

プロバイダー

同じモデルを複数のプロバイダーがホストしている場合があります。バックエンドを固定したい場合は1つのプロバイダーを選び、そうでなければルーティングに選択を任せられます。

プロバイダーSlug1時間あたりレイテンシiTTSのレイテンシは音声の最初のバイトが届くまでの時間、STTのレイテンシは最初のトークンが届くまでの時間で計測しています。モード稼働率
OpenAI 3個のパラメーター
openai
$3
—
ストリーミング

対応言語

このモデルの確認済み言語リストはまだありません。

機能

Speech to speech

Full-duplex speech-to-speech over WebSocket, listening while it speaks.

speech_to_speech
Text input and output

Accepts text input and returns text output alongside audio.

text_input_output
Turn-taking

The model manages when to listen and speak over a continuous audio stream, with interruption handling.

turn_taking
Live transcripts

Streams timestamped transcripts of both input and output speech.

live_transcripts
Client delegation

Emits client delegation events for your application to handle and accepts application-provided results back into the conversation.

client_delegation

コード

言語

OpenAI SDKによるライブ音声変換

GPT-Liveセッションを開き、question.pcm(24 kHz・16ビット・モノラルPCM)をリアルタイムでストリーミングして、音声の返答をreply.pcmに保存します。

import { readFile, writeFile } from "node:fs/promises";
import { setTimeout as sleep } from "node:timers/promises";
import OpenAI from "openai";
import { LiveWS } from "openai/resources/live/ws";

const client = new OpenAI({
  apiKey: process.env.ALLMODELS_API_KEY,
  baseURL: "https://api.allmodels.io/oai"
});
const live = new LiveWS(client);
const reply = [];
let quiet;

live.on("session.output_audio.delta", ({ delta }) => reply.push(Buffer.from(delta, "base64")));
live.on("session.output_transcript.delta", () => {
  // End the session two seconds after the reply's transcript goes quiet.
  clearTimeout(quiet);
  quiet = setTimeout(() => live.send({ type: "session.close" }), 2000);
});
live.on("session.closed", async () => {
  await writeFile("reply.pcm", Buffer.concat(reply));
  live.close();
});
live.on("error", console.error);

live.send({
  type: "session.start",
  session: {
    model: "gpt-live-1",
    audio: { format: { type: "audio/pcm", rate: 24000 }, output: { voice: "marin" } },
    delegation: { type: "client" }
  }
});

// Stream 100 ms frames in real time, then two seconds of silence.
const audio = Buffer.concat([await readFile("question.pcm"), Buffer.alloc(2 * 24000 * 2)]);
for (let offset = 0; offset < audio.length; offset += 4800) {
  live.send({ type: "session.input_audio.append", audio: audio.subarray(offset, offset + 4800).toString("base64") });
  await sleep(100);
}