fix: simplify gemini token endpoint to avoid SDK instantiation errors
All checks were successful
Build & Push / build-and-push (push) Successful in 1m42s
All checks were successful
Build & Push / build-and-push (push) Successful in 1m42s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { GoogleGenAI, Type } from '@google/genai';
|
import { Type } from '@google/genai';
|
||||||
|
|
||||||
// ─── Constants ────────────────────────────────────────────────────────────────
|
// ─── Constants ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -152,13 +152,7 @@ export function buildLiveConfig(locale: string) {
|
|||||||
|
|
||||||
// ─── Ephemeral Token ──────────────────────────────────────────────────────────
|
// ─── Ephemeral Token ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
export async function generateEphemeralToken(locale: string) {
|
export function generateEphemeralToken(locale: string) {
|
||||||
// GoogleGenAI is instantiated here to validate the API key at request time.
|
|
||||||
// The SDK does not yet expose an ephemeral token API; in production, replace
|
|
||||||
// this with ai.auth.tokens.create() or equivalent when available to avoid
|
|
||||||
// exposing the API key to the client.
|
|
||||||
new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY! });
|
|
||||||
|
|
||||||
const config = buildLiveConfig(locale);
|
const config = buildLiveConfig(locale);
|
||||||
return { config, model: GEMINI_LIVE_MODEL };
|
return { config, model: GEMINI_LIVE_MODEL };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user