From 536d0affdf956db3a45ef79c34750bcb5266d212 Mon Sep 17 00:00:00 2001 From: Daniel Rochetti Date: Mon, 15 Jan 2024 15:11:26 -0800 Subject: [PATCH] chore: change demo app ids --- apps/demo-nextjs-app-router/app/camera-turbo/page.tsx | 2 +- apps/demo-nextjs-app-router/app/realtime/page.tsx | 2 +- apps/demo-nextjs-app-router/app/whisper/page.tsx | 2 +- apps/demo-nextjs-page-router/pages/index.tsx | 2 +- libs/client/src/realtime.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx b/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx index b70261e..716b400 100644 --- a/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx +++ b/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx @@ -137,7 +137,7 @@ export default function WebcamPage() { const previewRef = useRef(null); const { send } = fal.realtime.connect( - '110602490-sd-turbo-real-time-high-fps-msgpack', + 'fal-ai/sd-turbo-real-time-high-fps-msgpack', { connectionKey: 'camera-turbo-demo', // not throttling the client, handling throttling of the camera itself diff --git a/apps/demo-nextjs-app-router/app/realtime/page.tsx b/apps/demo-nextjs-app-router/app/realtime/page.tsx index a9d9229..f39bd4c 100644 --- a/apps/demo-nextjs-app-router/app/realtime/page.tsx +++ b/apps/demo-nextjs-app-router/app/realtime/page.tsx @@ -14,7 +14,7 @@ const PROMPT = 'a moon in a starry night sky'; export default function RealtimePage() { const [image, setImage] = useState(null); - const { send } = fal.realtime.connect('110602490-lcm-sd15-i2i', { + const { send } = fal.realtime.connect('fal-ai/lcm-sd15-i2i', { connectionKey: 'realtime-demo', throttleInterval: 128, onResult(result) { diff --git a/apps/demo-nextjs-app-router/app/whisper/page.tsx b/apps/demo-nextjs-app-router/app/whisper/page.tsx index b79c091..daf02f8 100644 --- a/apps/demo-nextjs-app-router/app/whisper/page.tsx +++ b/apps/demo-nextjs-app-router/app/whisper/page.tsx @@ -110,7 +110,7 @@ export default function WhisperDemo() { setLoading(true); const start = Date.now(); try { - const result = await fal.subscribe('110602490-whisper', { + const result = await fal.subscribe('fal-ai/whisper', { input: { file_name: 'recording.wav', audio_url: audioFile, diff --git a/apps/demo-nextjs-page-router/pages/index.tsx b/apps/demo-nextjs-page-router/pages/index.tsx index 6bde8b6..832aaaa 100644 --- a/apps/demo-nextjs-page-router/pages/index.tsx +++ b/apps/demo-nextjs-page-router/pages/index.tsx @@ -74,7 +74,7 @@ export function Index() { setLoading(true); const start = Date.now(); try { - const result: Result = await fal.subscribe('110602490/lora', { + const result: Result = await fal.subscribe('fal-ai/lora', { input: { prompt, model_name: 'stabilityai/stable-diffusion-xl-base-1.0', diff --git a/libs/client/src/realtime.ts b/libs/client/src/realtime.ts index 1edfa5d..72afcc4 100644 --- a/libs/client/src/realtime.ts +++ b/libs/client/src/realtime.ts @@ -282,12 +282,12 @@ function shouldSendBinary(message: any): boolean { * Get a token to connect to the realtime endpoint. */ async function getToken(app: string): Promise { - const [_, ...appAlias] = app.split('-'); + const [, appAlias] = ensureAppIdFormat(app).split('/'); const token: string | object = await dispatchRequest( 'POST', `${getRestApiUrl()}/tokens/`, { - allowed_apps: [appAlias.join('-')], + allowed_apps: [appAlias], token_expiration: TOKEN_EXPIRATION_SECONDS, } );