Skip to content

Commit 872e034

Browse files
authored
feat(chat-streaming): added a stream option to workflow execute route, updated SDKs, updated docs (#1565)
* feat(chat-stream): updated workflow id execute route to support streaming via API * enable streaming via api * added only text stream option * cleanup deployed preview componnet * updated selectedOutputIds to selectedOutput * updated TS and Python SDKs with async, rate limits, usage, and streaming API routes * stream non-streaming blocks when streaming is specified * fix(chat-panel): add onBlockComplete handler to chat panel to stream back blocks as they complete * update docs * cleanup * ack PR comments * updated next config * removed getAssetUrl in favor of local assets * resolve merge conflicts * remove extra logic to create sensitive result * simplify internal auth * remove vercel blob from CSP + next config
1 parent a63a7b0 commit 872e034

File tree

73 files changed

+3648
-1604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3648
-1604
lines changed

apps/docs/components/ui/lightbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { useEffect, useRef } from 'react'
4-
import { getVideoUrl } from '@/lib/utils'
4+
import { getAssetUrl } from '@/lib/utils'
55

66
interface LightboxProps {
77
isOpen: boolean
@@ -60,7 +60,7 @@ export function Lightbox({ isOpen, onClose, src, alt, type }: LightboxProps) {
6060
/>
6161
) : (
6262
<video
63-
src={getVideoUrl(src)}
63+
src={getAssetUrl(src)}
6464
autoPlay
6565
loop
6666
muted

apps/docs/components/ui/video.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { useState } from 'react'
4-
import { getVideoUrl } from '@/lib/utils'
4+
import { getAssetUrl } from '@/lib/utils'
55
import { Lightbox } from './lightbox'
66

77
interface VideoProps {
@@ -39,7 +39,7 @@ export function Video({
3939
muted={muted}
4040
playsInline={playsInline}
4141
className={`${className} ${enableLightbox ? 'cursor-pointer transition-opacity hover:opacity-90' : ''}`}
42-
src={getVideoUrl(src)}
42+
src={getAssetUrl(src)}
4343
onClick={handleVideoClick}
4444
/>
4545

apps/docs/content/docs/de/sdks/python.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class SimStudioError(Exception):
214214
import os
215215
from simstudio import SimStudioClient
216216

217-
client = SimStudioClient(api_key=os.getenv("SIMSTUDIO_API_KEY"))
217+
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
218218

219219
def run_workflow():
220220
try:
@@ -252,7 +252,7 @@ Behandeln Sie verschiedene Fehlertypen, die während der Workflow-Ausführung au
252252
from simstudio import SimStudioClient, SimStudioError
253253
import os
254254

255-
client = SimStudioClient(api_key=os.getenv("SIMSTUDIO_API_KEY"))
255+
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
256256

257257
def execute_with_error_handling():
258258
try:
@@ -284,7 +284,7 @@ from simstudio import SimStudioClient
284284
import os
285285

286286
# Using context manager to automatically close the session
287-
with SimStudioClient(api_key=os.getenv("SIMSTUDIO_API_KEY")) as client:
287+
with SimStudioClient(api_key=os.getenv("SIM_API_KEY")) as client:
288288
result = client.execute_workflow("workflow-id")
289289
print("Result:", result)
290290
# Session is automatically closed here
@@ -298,7 +298,7 @@ Führen Sie mehrere Workflows effizient aus:
298298
from simstudio import SimStudioClient
299299
import os
300300

301-
client = SimStudioClient(api_key=os.getenv("SIMSTUDIO_API_KEY"))
301+
client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
302302

303303
def execute_workflows_batch(workflow_data_pairs):
304304
"""Execute multiple workflows with different input data."""
@@ -352,8 +352,8 @@ Konfigurieren Sie den Client mit Umgebungsvariablen:
352352

353353
# Development configuration
354354
client = SimStudioClient(
355-
api_key=os.getenv("SIMSTUDIO_API_KEY"),
356-
base_url=os.getenv("SIMSTUDIO_BASE_URL", "https://sim.ai")
355+
api_key=os.getenv("SIM_API_KEY"),
356+
base_url=os.getenv("SIM_BASE_URL", "https://sim.ai")
357357
)
358358
```
359359

@@ -365,13 +365,13 @@ Konfigurieren Sie den Client mit Umgebungsvariablen:
365365
from simstudio import SimStudioClient
366366

367367
# Production configuration with error handling
368-
api_key = os.getenv("SIMSTUDIO_API_KEY")
368+
api_key = os.getenv("SIM_API_KEY")
369369
if not api_key:
370-
raise ValueError("SIMSTUDIO_API_KEY environment variable is required")
370+
raise ValueError("SIM_API_KEY environment variable is required")
371371

372372
client = SimStudioClient(
373373
api_key=api_key,
374-
base_url=os.getenv("SIMSTUDIO_BASE_URL", "https://sim.ai")
374+
base_url=os.getenv("SIM_BASE_URL", "https://sim.ai")
375375
)
376376
```
377377

apps/docs/content/docs/de/sdks/typescript.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class SimStudioError extends Error {
230230
import { SimStudioClient } from 'simstudio-ts-sdk';
231231

232232
const client = new SimStudioClient({
233-
apiKey: process.env.SIMSTUDIO_API_KEY!
233+
apiKey: process.env.SIM_API_KEY!
234234
});
235235

236236
async function runWorkflow() {
@@ -271,7 +271,7 @@ Behandeln Sie verschiedene Fehlertypen, die während der Workflow-Ausführung au
271271
import { SimStudioClient, SimStudioError } from 'simstudio-ts-sdk';
272272

273273
const client = new SimStudioClient({
274-
apiKey: process.env.SIMSTUDIO_API_KEY!
274+
apiKey: process.env.SIM_API_KEY!
275275
});
276276

277277
async function executeWithErrorHandling() {
@@ -315,14 +315,14 @@ Konfigurieren Sie den Client mit Umgebungsvariablen:
315315
import { SimStudioClient } from 'simstudio-ts-sdk';
316316

317317
// Development configuration
318-
const apiKey = process.env.SIMSTUDIO_API_KEY;
318+
const apiKey = process.env.SIM_API_KEY;
319319
if (!apiKey) {
320-
throw new Error('SIMSTUDIO_API_KEY environment variable is required');
320+
throw new Error('SIM_API_KEY environment variable is required');
321321
}
322322

323323
const client = new SimStudioClient({
324324
apiKey,
325-
baseUrl: process.env.SIMSTUDIO_BASE_URL // optional
325+
baseUrl: process.env.SIM_BASE_URL // optional
326326
});
327327
```
328328

@@ -333,14 +333,14 @@ Konfigurieren Sie den Client mit Umgebungsvariablen:
333333
import { SimStudioClient } from 'simstudio-ts-sdk';
334334

335335
// Production configuration with validation
336-
const apiKey = process.env.SIMSTUDIO_API_KEY;
336+
const apiKey = process.env.SIM_API_KEY;
337337
if (!apiKey) {
338-
throw new Error('SIMSTUDIO_API_KEY environment variable is required');
338+
throw new Error('SIM_API_KEY environment variable is required');
339339
}
340340

341341
const client = new SimStudioClient({
342342
apiKey,
343-
baseUrl: process.env.SIMSTUDIO_BASE_URL || 'https://sim.ai'
343+
baseUrl: process.env.SIM_BASE_URL || 'https://sim.ai'
344344
});
345345
```
346346

@@ -357,7 +357,7 @@ import { SimStudioClient } from 'simstudio-ts-sdk';
357357

358358
const app = express();
359359
const client = new SimStudioClient({
360-
apiKey: process.env.SIMSTUDIO_API_KEY!
360+
apiKey: process.env.SIM_API_KEY!
361361
});
362362

363363
app.use(express.json());
@@ -399,7 +399,7 @@ import { NextApiRequest, NextApiResponse } from 'next';
399399
import { SimStudioClient } from 'simstudio-ts-sdk';
400400

401401
const client = new SimStudioClient({
402-
apiKey: process.env.SIMSTUDIO_API_KEY!
402+
apiKey: process.env.SIM_API_KEY!
403403
});
404404

405405
export default async function handler(
@@ -476,7 +476,7 @@ import { useState, useCallback } from 'react';
476476
import { SimStudioClient, WorkflowExecutionResult } from 'simstudio-ts-sdk';
477477

478478
const client = new SimStudioClient({
479-
apiKey: process.env.NEXT_PUBLIC_SIMSTUDIO_API_KEY!
479+
apiKey: process.env.NEXT_PUBLIC_SIM_API_KEY!
480480
});
481481

482482
interface UseWorkflowResult {
@@ -588,7 +588,7 @@ import {
588588

589589
// Type-safe client initialization
590590
const client: SimStudioClient = new SimStudioClient({
591-
apiKey: process.env.SIMSTUDIO_API_KEY!
591+
apiKey: process.env.SIM_API_KEY!
592592
});
593593

594594
// Type-safe workflow execution

0 commit comments

Comments
 (0)