-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(bump): next -> main (0.6.0) (#227)
- Loading branch information
Showing
37 changed files
with
1,128 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@livekit/agents': patch | ||
--- | ||
|
||
Allow attributes to be set on accept |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents-plugin-openai": patch | ||
--- | ||
|
||
fix multiple function calls not firing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents": patch | ||
--- | ||
|
||
fix(multimodal): crash on reconnect to same room |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents-plugin-openai": patch | ||
--- | ||
|
||
fix(tts): add missing crypto import to OpenAI tts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents": minor | ||
--- | ||
|
||
MultimodalAgent: emit user started speaking event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents": patch | ||
--- | ||
|
||
fix tokenizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents": minor | ||
--- | ||
|
||
support nested speech handles in pipeline agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents": patch | ||
--- | ||
|
||
fix(pipeline): add transcription for AGENT_SPEECH_COMMITTED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents-plugin-openai": patch | ||
--- | ||
|
||
groq: add support for llama 3.3 70b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents-plugin-elevenlabs": patch | ||
--- | ||
|
||
use AudioByteStream for TTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@livekit/agents": minor | ||
"@livekit/agents-plugin-deepgram": patch | ||
"@livekit/agents-plugin-elevenlabs": patch | ||
"@livekit/agents-plugin-openai": patch | ||
"@livekit/agents-plugin-silero": patch | ||
--- | ||
|
||
add metrics monitoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@livekit/agents": patch | ||
"@livekit/agents-plugin-elevenlabs": patch | ||
"@livekit/agents-plugin-openai": patch | ||
--- | ||
|
||
add testutils, tests for oai, 11labs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export interface LLMMetrics { | ||
requestId: string; | ||
timestamp: number; | ||
ttft: number; | ||
duration: number; | ||
label: string; | ||
cancelled: boolean; | ||
completionTokens: number; | ||
promptTokens: number; | ||
totalTokens: number; | ||
tokensPerSecond: number; | ||
error?: Error; | ||
} | ||
|
||
export interface STTMetrics { | ||
requestId: string; | ||
timestamp: number; | ||
duration: number; | ||
label: string; | ||
audioDuration: number; | ||
streamed: boolean; | ||
error?: Error; | ||
} | ||
|
||
export interface TTSMetrics { | ||
requestId: string; | ||
timestamp: number; | ||
ttfb: number; | ||
duration: number; | ||
label: string; | ||
audioDuration: number; | ||
cancelled: boolean; | ||
charactersCount: number; | ||
streamed: boolean; | ||
error?: Error; | ||
} | ||
|
||
export interface VADMetrics { | ||
timestamp: number; | ||
idleTime: number; | ||
inferenceDurationTotal: number; | ||
inferenceCount: number; | ||
label: string; | ||
} | ||
|
||
export interface PipelineEOUMetrics { | ||
/** | ||
* Unique identifier shared across different metrics to combine related STT, LLM, and TTS metrics | ||
*/ | ||
sequenceId: string; | ||
/** Timestamp of when the event was recorded */ | ||
timestamp: number; | ||
/** Amount of time between the end of speech from VAD and the decision to end the user's turn */ | ||
endOfUtteranceDelay: number; | ||
/** | ||
* Time taken to obtain the transcript after the end of the user's speech. | ||
* | ||
* @remarks | ||
* May be 0 if the transcript was already available. | ||
*/ | ||
transcriptionDelay: number; | ||
} | ||
|
||
export interface PipelineLLMMetrics extends LLMMetrics { | ||
/** | ||
* Unique identifier shared across different metrics to combine related STT, LLM, and TTS metrics | ||
*/ | ||
sequenceId: string; | ||
} | ||
|
||
export interface PipelineTTSMetrics extends TTSMetrics { | ||
/** | ||
* Unique identifier shared across different metrics to combine related STT, LLM, and TTS metrics | ||
*/ | ||
sequenceId: string; | ||
} | ||
|
||
export type PipelineSTTMetrics = STTMetrics; | ||
export type PipelineVADMetrics = VADMetrics; | ||
|
||
export class MultimodalLLMError extends Error { | ||
type?: string; | ||
reason?: string; | ||
code?: string; | ||
constructor( | ||
{ | ||
type, | ||
reason, | ||
code, | ||
message, | ||
}: { type?: string; reason?: string; code?: string; message?: string } = {}, | ||
options?: ErrorOptions, | ||
) { | ||
super(message, options); | ||
this.type = type; | ||
this.reason = reason; | ||
this.code = code; | ||
} | ||
} | ||
|
||
export interface MultimodalLLMMetrics extends LLMMetrics { | ||
inputTokenDetails: { | ||
cachedTokens: number; | ||
textTokens: number; | ||
audioTokens: number; | ||
}; | ||
outputTokenDetails: { | ||
textTokens: number; | ||
audioTokens: number; | ||
}; | ||
} | ||
|
||
export type AgentMetrics = | ||
| STTMetrics | ||
| LLMMetrics | ||
| TTSMetrics | ||
| VADMetrics | ||
| PipelineSTTMetrics | ||
| PipelineEOUMetrics | ||
| PipelineLLMMetrics | ||
| PipelineTTSMetrics | ||
| PipelineVADMetrics | ||
| MultimodalLLMMetrics; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export type { | ||
AgentMetrics, | ||
STTMetrics, | ||
LLMMetrics, | ||
TTSMetrics, | ||
VADMetrics, | ||
PipelineSTTMetrics, | ||
PipelineEOUMetrics, | ||
PipelineLLMMetrics, | ||
PipelineTTSMetrics, | ||
PipelineVADMetrics, | ||
MultimodalLLMMetrics, | ||
} from './base.js'; | ||
export { MultimodalLLMError } from './base.js'; | ||
export { type UsageSummary, UsageCollector } from './usage_collector.js'; | ||
export { logMetrics } from './utils.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import type { AgentMetrics } from './base.js'; | ||
import { isLLMMetrics, isSTTMetrics, isTTSMetrics } from './utils.js'; | ||
|
||
export interface UsageSummary { | ||
llmPromptTokens: number; | ||
llmCompletionTokens: number; | ||
ttsCharactersCount: number; | ||
sttAudioDuration: number; | ||
} | ||
|
||
export class UsageCollector { | ||
#summary: UsageSummary; | ||
|
||
constructor() { | ||
this.#summary = { | ||
llmPromptTokens: 0, | ||
llmCompletionTokens: 0, | ||
ttsCharactersCount: 0, | ||
sttAudioDuration: 0, | ||
}; | ||
} | ||
|
||
collect(metrics: AgentMetrics) { | ||
if (isLLMMetrics(metrics)) { | ||
this.#summary.llmPromptTokens += metrics.promptTokens; | ||
this.#summary.llmCompletionTokens += metrics.completionTokens; | ||
} else if (isTTSMetrics(metrics)) { | ||
this.#summary.ttsCharactersCount += metrics.charactersCount; | ||
} else if (isSTTMetrics(metrics)) { | ||
this.#summary.sttAudioDuration += metrics.audioDuration; | ||
} | ||
} | ||
|
||
get summary(): UsageSummary { | ||
return { ...this.#summary }; | ||
} | ||
} |
Oops, something went wrong.