-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(i18n): update translations #1572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -821,7 +821,9 @@ async function checkUsage() { | |||||||||||||
|
|
||||||||||||||
| Execute workflows with real-time streaming responses: | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| typescript | ||||||||||||||
| import { SimStudioClient } from 'simstudio-ts-sdk'; | ||||||||||||||
|
|
||||||||||||||
| const client = new SimStudioClient({ | ||||||||||||||
|
|
@@ -842,23 +844,28 @@ async function executeWithStreaming() { | |||||||||||||
| console.error('Fehler:', error); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| The streaming response follows the Server-Sent Events (SSE) format: | ||||||||||||||
|
|
||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":"One"} | ||||||||||||||
|
|
||||||||||||||
| data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", zwei"} | ||||||||||||||
|
|
||||||||||||||
| data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}} | ||||||||||||||
|
|
||||||||||||||
| data: [DONE] | ||||||||||||||
|
|
||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| **React Streaming Example:** | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| typescript | ||||||||||||||
| import { useState, useEffect } from 'react'; | ||||||||||||||
|
Comment on lines
+866
to
869
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Code block syntax is broken. Fix the markdown formatting.
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/docs/content/docs/de/sdks/typescript.mdx
Line: 866:869
Comment:
**syntax:** Code block syntax is broken. Fix the markdown formatting.
```suggestion
```typescript
import { useState, useEffect } from 'react';
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||
|
|
||||||||||||||
| function StreamingWorkflow() { | ||||||||||||||
|
|
@@ -926,6 +933,7 @@ function StreamingWorkflow() { | |||||||||||||
| </div> | ||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ## Getting Your API Key | ||||||||||||||
|
|
@@ -961,7 +969,9 @@ function StreamingWorkflow() { | |||||||||||||
|
|
||||||||||||||
| The SDK is written in TypeScript and provides full type safety: | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| typescript | ||||||||||||||
| import { | ||||||||||||||
|
Comment on lines
+972
to
975
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Code block syntax is broken. Language identifier must be on the same line as opening backticks.
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/docs/content/docs/de/sdks/typescript.mdx
Line: 972:975
Comment:
**syntax:** Code block syntax is broken. Language identifier must be on the same line as opening backticks.
```suggestion
```typescript
import {
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||
| SimStudioClient, | ||||||||||||||
| WorkflowExecutionResult, | ||||||||||||||
|
|
@@ -987,4 +997,296 @@ const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id'); | |||||||||||||
|
|
||||||||||||||
| ## License | ||||||||||||||
|
|
||||||||||||||
| Apache-2.0 | ||||||||||||||
|
|
||||||||||||||
| const reader = response.body?.getReader(); | ||||||||||||||
| const decoder = new TextDecoder(); | ||||||||||||||
|
|
||||||||||||||
| while (reader) { | ||||||||||||||
| const { done, value } = await reader.read(); | ||||||||||||||
| if (done) break; | ||||||||||||||
|
|
||||||||||||||
| const chunk = decoder.decode(value); | ||||||||||||||
| const lines = chunk.split('\n\n'); | ||||||||||||||
|
|
||||||||||||||
| for (const line of lines) { | ||||||||||||||
| if (line.startsWith('data: ')) { | ||||||||||||||
| const data = line.slice(6); | ||||||||||||||
| if (data === '[DONE]') { | ||||||||||||||
| setLoading(false); | ||||||||||||||
| break; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| try { | ||||||||||||||
| const parsed = JSON.parse(data); | ||||||||||||||
| if (parsed.chunk) { | ||||||||||||||
| setOutput(prev => prev + parsed.chunk); | ||||||||||||||
| } else if (parsed.event === 'done') { | ||||||||||||||
| console.log('Execution complete:', parsed.metadata); | ||||||||||||||
| } | ||||||||||||||
| } catch (e) { | ||||||||||||||
| // Skip invalid JSON | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| return ( | ||||||||||||||
| <div> | ||||||||||||||
| <button onClick={executeStreaming} disabled={loading}> | ||||||||||||||
| {loading ? 'Generiere...' : 'Streaming starten'} | ||||||||||||||
| </button> | ||||||||||||||
| <div style={{ whiteSpace: 'pre-wrap' }}>{output}</div> | ||||||||||||||
| </div> | ||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ## Getting Your API Key | ||||||||||||||
|
|
||||||||||||||
| <Steps> | ||||||||||||||
| <Step title="Log in to Sim"> | ||||||||||||||
| Navigate to [Sim](https://sim.ai) and log in to your account. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Open your workflow"> | ||||||||||||||
| Navigate to the workflow you want to execute programmatically. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Deploy your workflow"> | ||||||||||||||
| Click on "Deploy" to deploy your workflow if it hasn't been deployed yet. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Create or select an API key"> | ||||||||||||||
| During the deployment process, select or create an API key. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Copy the API key"> | ||||||||||||||
| Copy the API key to use in your TypeScript/JavaScript application. | ||||||||||||||
| </Step> | ||||||||||||||
| </Steps> | ||||||||||||||
|
|
||||||||||||||
| <Callout type="warning"> | ||||||||||||||
| Keep your API key secure and never commit it to version control. Use environment variables or secure configuration management. | ||||||||||||||
| </Callout> | ||||||||||||||
|
|
||||||||||||||
| ## Requirements | ||||||||||||||
|
|
||||||||||||||
| - Node.js 16+ | ||||||||||||||
| - TypeScript 5.0+ (for TypeScript projects) | ||||||||||||||
|
|
||||||||||||||
| ## TypeScript Support | ||||||||||||||
|
|
||||||||||||||
| The SDK is written in TypeScript and provides full type safety: | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| import { | ||||||||||||||
| SimStudioClient, | ||||||||||||||
| WorkflowExecutionResult, | ||||||||||||||
| WorkflowStatus, | ||||||||||||||
| SimStudioError | ||||||||||||||
| } from 'simstudio-ts-sdk'; | ||||||||||||||
|
|
||||||||||||||
| // Typsichere Client-Initialisierung | ||||||||||||||
| const client: SimStudioClient = new SimStudioClient({ | ||||||||||||||
| apiKey: process.env.SIM_API_KEY! | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| // Typsichere Workflow-Ausführung | ||||||||||||||
| const result: WorkflowExecutionResult = await client.executeWorkflow('workflow-id', { | ||||||||||||||
| input: { | ||||||||||||||
| message: 'Hallo, TypeScript!' | ||||||||||||||
| } | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| // Typsichere Statusprüfung | ||||||||||||||
| const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id'); | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ## License | ||||||||||||||
|
|
||||||||||||||
| Apache-2.0 + limits.usage.limit.toFixed(2)); | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Incomplete line with code fragment 'Apache-2.0 + limits.usage.limit.toFixed(2));' appears to be corrupted content that should be removed. Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/docs/content/docs/de/sdks/typescript.mdx
Line: 1105:1105
Comment:
**syntax:** Incomplete line with code fragment 'Apache-2.0 + limits.usage.limit.toFixed(2));' appears to be corrupted content that should be removed.
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||
| console.log('Plan:', limits.usage.plan); | ||||||||||||||
|
|
||||||||||||||
| const percentUsed = (limits.usage.currentPeriodCost / limits.usage.limit) * 100; | ||||||||||||||
| console.log('Usage: ' + percentUsed.toFixed(1) + '%'); | ||||||||||||||
|
|
||||||||||||||
| if (percentUsed > 80) { | ||||||||||||||
| console.warn('⚠️ Warning: You are approaching your usage limit!'); | ||||||||||||||
| } | ||||||||||||||
| } catch (error) { | ||||||||||||||
| console.error('Error checking usage:', error); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| checkUsage(); | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ### Streaming-Workflow-Ausführung | ||||||||||||||
|
|
||||||||||||||
| Führen Sie Workflows mit Echtzeit-Streaming-Antworten aus: | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| import { SimStudioClient } from 'simstudio-ts-sdk'; | ||||||||||||||
|
|
||||||||||||||
| const client = new SimStudioClient({ | ||||||||||||||
| apiKey: process.env.SIM_API_KEY! | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| async function executeWithStreaming() { | ||||||||||||||
| try { | ||||||||||||||
| // Enable streaming for specific block outputs | ||||||||||||||
| const result = await client.executeWorkflow('workflow-id', { | ||||||||||||||
| input: { message: 'Count to five' }, | ||||||||||||||
| stream: true, | ||||||||||||||
| selectedOutputs: ['agent1.content'] // Use blockName.attribute format | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| console.log('Workflow result:', result); | ||||||||||||||
| } catch (error) { | ||||||||||||||
| console.error('Error:', error); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| Die Streaming-Antwort folgt dem Server-Sent Events (SSE) Format: | ||||||||||||||
|
|
||||||||||||||
| ``` | ||||||||||||||
| data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":"One"} | ||||||||||||||
|
|
||||||||||||||
| data: {"blockId":"7b7735b9-19e5-4bd6-818b-46aae2596e9f","chunk":", two"} | ||||||||||||||
|
|
||||||||||||||
| data: {"event":"done","success":true,"output":{},"metadata":{"duration":610}} | ||||||||||||||
|
|
||||||||||||||
| data: [DONE] | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| **React Streaming-Beispiel:** | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| import { useState, useEffect } from 'react'; | ||||||||||||||
|
|
||||||||||||||
| function StreamingWorkflow() { | ||||||||||||||
| const [output, setOutput] = useState(''); | ||||||||||||||
| const [loading, setLoading] = useState(false); | ||||||||||||||
|
|
||||||||||||||
| const executeStreaming = async () => { | ||||||||||||||
| setLoading(true); | ||||||||||||||
| setOutput(''); | ||||||||||||||
|
|
||||||||||||||
| // IMPORTANT: Make this API call from your backend server, not the browser | ||||||||||||||
| // Never expose your API key in client-side code | ||||||||||||||
| const response = await fetch('https://sim.ai/api/workflows/WORKFLOW_ID/execute', { | ||||||||||||||
| method: 'POST', | ||||||||||||||
| headers: { | ||||||||||||||
| 'Content-Type': 'application/json', | ||||||||||||||
| 'X-API-Key': process.env.SIM_API_KEY! // Server-side environment variable only | ||||||||||||||
| }, | ||||||||||||||
| body: JSON.stringify({ | ||||||||||||||
| message: 'Generate a story', | ||||||||||||||
| stream: true, | ||||||||||||||
| selectedOutputs: ['agent1.content'] | ||||||||||||||
| }) | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| const reader = response.body?.getReader(); | ||||||||||||||
| const decoder = new TextDecoder(); | ||||||||||||||
|
|
||||||||||||||
| while (reader) { | ||||||||||||||
| const { done, value } = await reader.read(); | ||||||||||||||
| if (done) break; | ||||||||||||||
|
|
||||||||||||||
| const chunk = decoder.decode(value); | ||||||||||||||
| const lines = chunk.split('\n\n'); | ||||||||||||||
|
|
||||||||||||||
| for (const line of lines) { | ||||||||||||||
| if (line.startsWith('data: ')) { | ||||||||||||||
| const data = line.slice(6); | ||||||||||||||
| if (data === '[DONE]') { | ||||||||||||||
| setLoading(false); | ||||||||||||||
| break; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| try { | ||||||||||||||
| const parsed = JSON.parse(data); | ||||||||||||||
| if (parsed.chunk) { | ||||||||||||||
| setOutput(prev => prev + parsed.chunk); | ||||||||||||||
| } else if (parsed.event === 'done') { | ||||||||||||||
| console.log('Execution complete:', parsed.metadata); | ||||||||||||||
| } | ||||||||||||||
| } catch (e) { | ||||||||||||||
| // Skip invalid JSON | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| return ( | ||||||||||||||
| <div> | ||||||||||||||
| <button onClick={executeStreaming} disabled={loading}> | ||||||||||||||
| {loading ? 'Generating...' : 'Start Streaming'} | ||||||||||||||
| </button> | ||||||||||||||
| <div style={{ whiteSpace: 'pre-wrap' }}>{output}</div> | ||||||||||||||
| </div> | ||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ## Ihren API-Schlüssel erhalten | ||||||||||||||
|
|
||||||||||||||
| <Steps> | ||||||||||||||
| <Step title="Bei Sim anmelden"> | ||||||||||||||
| Navigieren Sie zu [Sim](https://sim.ai) und melden Sie sich bei Ihrem Konto an. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Öffnen Sie Ihren Workflow"> | ||||||||||||||
| Navigieren Sie zu dem Workflow, den Sie programmatisch ausführen möchten. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Deployen Sie Ihren Workflow"> | ||||||||||||||
| Klicken Sie auf "Deploy", um Ihren Workflow zu deployen, falls dies noch nicht geschehen ist. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Erstellen oder wählen Sie einen API-Schlüssel"> | ||||||||||||||
| Wählen Sie während des Deployment-Prozesses einen API-Schlüssel aus oder erstellen Sie einen neuen. | ||||||||||||||
| </Step> | ||||||||||||||
| <Step title="Kopieren Sie den API-Schlüssel"> | ||||||||||||||
| Kopieren Sie den API-Schlüssel zur Verwendung in Ihrer TypeScript/JavaScript-Anwendung. | ||||||||||||||
| </Step> | ||||||||||||||
| </Steps> | ||||||||||||||
|
|
||||||||||||||
| <Callout type="warning"> | ||||||||||||||
| Halte deinen API-Schlüssel sicher und committe ihn niemals in die Versionskontrolle. Verwende Umgebungsvariablen oder sicheres Konfigurationsmanagement. | ||||||||||||||
| </Callout> | ||||||||||||||
|
|
||||||||||||||
| ## Anforderungen | ||||||||||||||
|
|
||||||||||||||
| - Node.js 16+ | ||||||||||||||
| - TypeScript 5.0+ (für TypeScript-Projekte) | ||||||||||||||
|
|
||||||||||||||
| ## TypeScript-Unterstützung | ||||||||||||||
|
|
||||||||||||||
| Das SDK ist in TypeScript geschrieben und bietet vollständige Typsicherheit: | ||||||||||||||
|
|
||||||||||||||
| ```typescript | ||||||||||||||
| import { | ||||||||||||||
| SimStudioClient, | ||||||||||||||
| WorkflowExecutionResult, | ||||||||||||||
| WorkflowStatus, | ||||||||||||||
| SimStudioError | ||||||||||||||
| } from 'simstudio-ts-sdk'; | ||||||||||||||
|
|
||||||||||||||
| // Type-safe client initialization | ||||||||||||||
| const client: SimStudioClient = new SimStudioClient({ | ||||||||||||||
| apiKey: process.env.SIM_API_KEY! | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| // Type-safe workflow execution | ||||||||||||||
| const result: WorkflowExecutionResult = await client.executeWorkflow('workflow-id', { | ||||||||||||||
| input: { | ||||||||||||||
| message: 'Hello, TypeScript!' | ||||||||||||||
| } | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| // Type-safe status checking | ||||||||||||||
| const status: WorkflowStatus = await client.getWorkflowStatus('workflow-id'); | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ## Lizenz | ||||||||||||||
|
|
||||||||||||||
| Apache-2.0 | ||||||||||||||
|
Comment on lines
+1000
to
1292
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: This entire section duplicates content from earlier in the file (streaming examples, API key instructions, license). The duplication creates confusion and should be removed to maintain clean documentation structure. Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/docs/content/docs/de/sdks/typescript.mdx
Line: 1000:1292
Comment:
**logic:** This entire section duplicates content from earlier in the file (streaming examples, API key instructions, license). The duplication creates confusion and should be removed to maintain clean documentation structure.
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Code block syntax is broken. The language identifier should be on the same line as the opening backticks.
Prompt To Fix With AI