@inworld/cli 0.3.1 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/index.js +820 -296
  2. package/dist/package.json +11 -7
  3. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts.map +1 -1
  4. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js +0 -1
  5. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js.map +1 -1
  6. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts.map +1 -1
  7. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts.map +1 -1
  8. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js +0 -1
  9. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js.map +1 -1
  10. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts.map +1 -1
  11. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js +0 -1
  12. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js.map +1 -1
  13. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts.map +1 -1
  14. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js +0 -1
  15. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js.map +1 -1
  16. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts +2 -0
  17. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts.map +1 -1
  18. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js +0 -1
  19. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js.map +1 -1
  20. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts.map +1 -1
  21. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js +0 -1
  22. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js.map +1 -1
  23. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts.map +1 -1
  24. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js +0 -1
  25. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js.map +1 -1
  26. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts.map +1 -1
  27. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js +0 -1
  28. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js.map +1 -1
  29. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts.map +1 -1
  30. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js +0 -1
  31. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js.map +1 -1
  32. package/dist/proto/generated/portal/fetch.pb.d.ts.map +1 -1
  33. package/dist/proto/generated/portal/fetch.pb.js.map +1 -1
  34. package/dist/src/auth/manager.d.ts.map +1 -1
  35. package/dist/src/auth/manager.js +1 -3
  36. package/dist/src/auth/manager.js.map +1 -1
  37. package/dist/src/auth/utils.d.ts +1 -1
  38. package/dist/src/auth/utils.d.ts.map +1 -1
  39. package/dist/src/auth/utils.js +1 -1
  40. package/dist/src/auth/utils.js.map +1 -1
  41. package/dist/src/commands/auth/disable_telemetry_command.js +21 -0
  42. package/dist/src/commands/auth/disable_telemetry_command.js.map +1 -0
  43. package/dist/src/commands/auth/enable_telemetry_command.js +22 -0
  44. package/dist/src/commands/auth/enable_telemetry_command.js.map +1 -0
  45. package/dist/src/commands/auth/login_command.d.ts.map +1 -1
  46. package/dist/src/commands/auth/login_command.js +2 -2
  47. package/dist/src/commands/auth/login_command.js.map +1 -1
  48. package/dist/src/commands/auth/status_command.d.ts.map +1 -1
  49. package/dist/src/commands/auth/status_command.js.map +1 -1
  50. package/dist/src/commands/auth_command.js +4 -0
  51. package/dist/src/commands/auth_command.js.map +1 -1
  52. package/dist/src/commands/graph/graph_deploy_command.d.ts.map +1 -1
  53. package/dist/src/commands/graph/graph_deploy_command.js +14 -1
  54. package/dist/src/commands/graph/graph_deploy_command.js.map +1 -1
  55. package/dist/src/commands/graph/graph_init_command.d.ts.map +1 -1
  56. package/dist/src/commands/graph/graph_init_command.js +231 -272
  57. package/dist/src/commands/graph/graph_init_command.js.map +1 -1
  58. package/dist/src/commands/graph/graph_run_command.d.ts.map +1 -1
  59. package/dist/src/commands/graph/graph_run_command.js +1 -1
  60. package/dist/src/commands/graph/graph_run_command.js.map +1 -1
  61. package/dist/src/commands/graph/graph_visualize_command.d.ts.map +1 -1
  62. package/dist/src/commands/graph/graph_visualize_command.js +3 -3
  63. package/dist/src/commands/graph/graph_visualize_command.js.map +1 -1
  64. package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts.map +1 -1
  65. package/dist/src/commands/graph/variant/graph_variant_list_command.js +1 -0
  66. package/dist/src/commands/graph/variant/graph_variant_list_command.js.map +1 -1
  67. package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts.map +1 -1
  68. package/dist/src/commands/graph/variant/graph_variant_print_command.js +2 -1
  69. package/dist/src/commands/graph/variant/graph_variant_print_command.js.map +1 -1
  70. package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts.map +1 -1
  71. package/dist/src/commands/graph/variant/graph_variant_register_command.js +1 -0
  72. package/dist/src/commands/graph/variant/graph_variant_register_command.js.map +1 -1
  73. package/dist/src/commands/tts/tts_clone_command.d.ts +6 -0
  74. package/dist/src/commands/tts/tts_clone_command.d.ts.map +1 -0
  75. package/dist/src/commands/tts/tts_clone_command.js +80 -0
  76. package/dist/src/commands/tts/tts_clone_command.js.map +1 -0
  77. package/dist/src/commands/tts/tts_design_command.d.ts +6 -0
  78. package/dist/src/commands/tts/tts_design_command.d.ts.map +1 -0
  79. package/dist/src/commands/tts/tts_design_command.js +216 -0
  80. package/dist/src/commands/tts/tts_design_command.js.map +1 -0
  81. package/dist/src/commands/tts/tts_list_voices_command.d.ts +6 -0
  82. package/dist/src/commands/tts/tts_list_voices_command.d.ts.map +1 -0
  83. package/dist/src/commands/tts/tts_list_voices_command.js +108 -0
  84. package/dist/src/commands/tts/tts_list_voices_command.js.map +1 -0
  85. package/dist/src/commands/tts/tts_synthesize_command.d.ts +6 -0
  86. package/dist/src/commands/tts/tts_synthesize_command.d.ts.map +1 -0
  87. package/dist/src/commands/tts/tts_synthesize_command.js +351 -0
  88. package/dist/src/commands/tts/tts_synthesize_command.js.map +1 -0
  89. package/dist/src/commands/tts/tts_utils.d.ts +14 -0
  90. package/dist/src/commands/tts/tts_utils.d.ts.map +1 -0
  91. package/dist/src/commands/tts/tts_utils.js +84 -0
  92. package/dist/src/commands/tts/tts_utils.js.map +1 -0
  93. package/dist/src/commands/tts_commands.d.ts +0 -11
  94. package/dist/src/commands/tts_commands.d.ts.map +1 -1
  95. package/dist/src/commands/tts_commands.js +6 -556
  96. package/dist/src/commands/tts_commands.js.map +1 -1
  97. package/dist/src/commands/workspace_command.d.ts +10 -0
  98. package/dist/src/commands/workspace_command.d.ts.map +1 -1
  99. package/dist/src/commands/workspace_command.js +39 -0
  100. package/dist/src/commands/workspace_command.js.map +1 -1
  101. package/dist/src/constants.d.ts +2 -1
  102. package/dist/src/constants.d.ts.map +1 -1
  103. package/dist/src/constants.js +19 -1
  104. package/dist/src/constants.js.map +1 -1
  105. package/dist/src/grpc/core/InworldError.d.ts.map +1 -1
  106. package/dist/src/grpc/core/InworldError.js.map +1 -1
  107. package/dist/src/index.js +139 -0
  108. package/dist/src/index.js.map +1 -0
  109. package/dist/src/services/analytics.d.ts +2 -2
  110. package/dist/src/services/analytics.d.ts.map +1 -1
  111. package/dist/src/services/analytics.js +139 -0
  112. package/dist/src/services/analytics.js.map +1 -0
  113. package/dist/src/services/deploy_service.js +1 -1
  114. package/dist/src/services/deploy_service.js.map +1 -1
  115. package/dist/src/services/graph_loader.d.ts.map +1 -1
  116. package/dist/src/services/graph_loader.js +1 -1
  117. package/dist/src/services/graph_loader.js.map +1 -1
  118. package/dist/src/services/graph_variant_service.d.ts.map +1 -1
  119. package/dist/src/services/graph_variant_service.js +1 -1
  120. package/dist/src/services/graph_variant_service.js.map +1 -1
  121. package/dist/src/services/template_service.d.ts +79 -0
  122. package/dist/src/services/template_service.d.ts.map +1 -0
  123. package/dist/src/services/template_service.js +299 -0
  124. package/dist/src/services/template_service.js.map +1 -0
  125. package/dist/src/services/tts_service.d.ts +138 -71
  126. package/dist/src/services/tts_service.d.ts.map +1 -1
  127. package/dist/src/services/tts_service.js +87 -66
  128. package/dist/src/services/tts_service.js.map +1 -1
  129. package/dist/src/services/update_checker.js +134 -0
  130. package/dist/src/services/update_checker.js.map +1 -0
  131. package/dist/src/services/workspace_service.d.ts +6 -0
  132. package/dist/src/services/workspace_service.d.ts.map +1 -1
  133. package/dist/src/services/workspace_service.js +115 -13
  134. package/dist/src/services/workspace_service.js.map +1 -1
  135. package/dist/src/utils/audio_player.d.ts +10 -0
  136. package/dist/src/utils/audio_player.d.ts.map +1 -0
  137. package/dist/src/utils/audio_player.js +34 -0
  138. package/dist/src/utils/audio_player.js.map +1 -0
  139. package/dist/src/utils/long_running_operations.d.ts.map +1 -1
  140. package/dist/src/utils/long_running_operations.js +1 -1
  141. package/dist/src/utils/long_running_operations.js.map +1 -1
  142. package/dist/src/utils/resource_name_helper.d.ts +5 -0
  143. package/dist/src/utils/resource_name_helper.d.ts.map +1 -1
  144. package/dist/src/utils/resource_name_helper.js +9 -0
  145. package/dist/src/utils/resource_name_helper.js.map +1 -1
  146. package/dist/src/utils/selector.d.ts.map +1 -1
  147. package/dist/src/utils/selector.js +1 -2
  148. package/dist/src/utils/selector.js.map +1 -1
  149. package/dist/src/utils/ui.d.ts.map +1 -1
  150. package/dist/src/utils/ui.js +8 -2
  151. package/dist/src/utils/ui.js.map +1 -1
  152. package/package.json +8 -2
  153. package/dist/index.js.map +0 -7
  154. package/dist/src/templates/llm_tts/README.md +0 -161
  155. package/dist/src/templates/llm_tts/graph.d.ts +0 -2
  156. package/dist/src/templates/llm_tts/graph.d.ts.map +0 -1
  157. package/dist/src/templates/llm_tts/graph.ts +0 -30
  158. package/dist/src/templates/llm_tts/metadata.json +0 -41
  159. package/dist/templates/llm_tts/README.md +0 -155
  160. package/dist/templates/llm_tts/graph.ts +0 -29
  161. package/dist/templates/llm_tts/metadata.json +0 -41
@@ -1,161 +0,0 @@
1
- # LLM + TTS Pipeline Graph
2
-
3
- This is an Inworld Runtime graph that creates a complete conversational AI pipeline with LLM chat and text-to-speech capabilities.
4
-
5
- ## Overview
6
-
7
- This template provides a production-ready pipeline that:
8
-
9
- - Accepts user input and formats it for LLM processing
10
- - Sends requests to an LLM provider (OpenAI GPT-4o-mini by default)
11
- - Streams responses for better user experience
12
- - Chunks text for optimal TTS processing
13
- - Converts text responses to speech using TTS
14
-
15
- ## Getting Started
16
-
17
- ### Installation
18
-
19
- ```bash
20
- npm install
21
- ```
22
-
23
- ### Configuration
24
-
25
- Before running, you'll need to set up your API keys:
26
-
27
- ```bash
28
- # Set your OpenAI API key (for LLM)
29
- export OPENAI_API_KEY="your-openai-api-key"
30
-
31
- # Set your TTS provider credentials (if using a specific provider)
32
- export TTS_API_KEY="your-tts-api-key"
33
- ```
34
-
35
- ### Running the Graph
36
-
37
- #### As a server (recommended):
38
-
39
- ```bash
40
- npm start
41
- # or
42
- npx inworld serve {{graphFileName}}
43
- ```
44
-
45
- #### Direct execution:
46
-
47
- ```bash
48
- npm run run
49
- # or
50
- npx inworld run {{graphFileName}}
51
- ```
52
-
53
- ## Project Structure
54
-
55
- - **`{{graphFileName}}`** - Main graph file with the LLM-TTS pipeline
56
- - **`package.json`** - Project dependencies and scripts
57
- - **`README.md`** - This file
58
-
59
- ## Pipeline Architecture
60
-
61
- The graph uses a `SequentialGraphBuilder` with the following nodes in order:
62
-
63
- 1. **LLMChatRequestBuilderNode**: Formats user input into LLM chat messages
64
- 2. **RemoteLLMChatNode**: Sends requests to the LLM provider and receives responses
65
- 3. **TextChunkingNode**: Breaks text into optimal chunks for TTS processing
66
- 4. **RemoteTTSNode**: Converts text chunks to speech
67
-
68
- ## Customization
69
-
70
- ### Changing the LLM Provider
71
-
72
- Edit the `RemoteLLMChatNode` configuration in `{{graphFileName}}`:
73
-
74
- ```typescript
75
- new RemoteLLMChatNode({
76
- provider: 'anthropic', // Change to 'anthropic', 'google', etc.
77
- modelName: 'claude-3-sonnet', // Change to desired model
78
- stream: true,
79
- // Add other provider-specific options
80
- });
81
- ```
82
-
83
- ### Modifying the System Prompt
84
-
85
- Add system messages to the `LLMChatRequestBuilderNode`:
86
-
87
- ```typescript
88
- new LLMChatRequestBuilderNode({
89
- messages: [
90
- {
91
- role: 'system',
92
- content: { type: 'text', text: 'You are a helpful assistant...' },
93
- },
94
- {
95
- role: 'user',
96
- content: { type: 'template', template: '{{user_input}}' },
97
- },
98
- ],
99
- });
100
- ```
101
-
102
- ### Customizing TTS Settings
103
-
104
- Configure the TTS node for different voices or providers:
105
-
106
- ```typescript
107
- new RemoteTTSNode({
108
- speakerId: 'Dennis',
109
- modelId: 'inworld-tts-1-max',
110
- });
111
- ```
112
-
113
- ### Adding Additional Processing
114
-
115
- You can insert additional nodes into the pipeline:
116
-
117
- ```typescript
118
- const graphBuilder = new SequentialGraphBuilder({
119
- id: 'custom-text-node-llm',
120
- nodes: [
121
- new LLMChatRequestBuilderNode({...}),
122
- new RemoteLLMChatNode({...}),
123
- new CustomProcessingNode(), // Your custom node
124
- new TextChunkingNode(),
125
- new RemoteTTSNode(),
126
- ],
127
- });
128
- ```
129
-
130
- ## Environment Variables
131
-
132
- The following environment variables can be configured:
133
-
134
- - `OPENAI_API_KEY`: API key for OpenAI (required for GPT models)
135
- - `ANTHROPIC_API_KEY`: API key for Anthropic (if using Claude)
136
- - `GOOGLE_API_KEY`: API key for Google (if using Gemini)
137
- - `TTS_API_KEY`: API key for your TTS provider
138
-
139
- ## Deployment
140
-
141
- To package your graph for deployment:
142
-
143
- ```bash
144
- npx inworld deploy {{graphFileName}}
145
- ```
146
-
147
- This will create a deployment package that can be uploaded to Inworld Cloud.
148
-
149
- ## Documentation
150
-
151
- For more information about:
152
-
153
- - Inworld Runtime: Visit the [documentation](https://docs.inworld.ai/)
154
- - LLM providers: Check provider-specific documentation
155
- - TTS options: See the TTS provider documentation
156
-
157
- ## Requirements
158
-
159
- - Node.js >= 18.0.0
160
- - @inworld/cli package
161
- - Valid API keys for LLM and TTS providers
@@ -1,2 +0,0 @@
1
- export declare const graph: any;
2
- //# sourceMappingURL=graph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../src/templates/llm_tts/graph.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,KAAK,KAAuB,CAAC"}
@@ -1,30 +0,0 @@
1
- import {
2
- LLMChatRequestBuilderNode,
3
- RemoteLLMChatNode,
4
- RemoteTTSNode,
5
- SequentialGraphBuilder,
6
- TextChunkingNode,
7
- } from '@inworld/runtime/graph';
8
-
9
- const graphBuilder = new SequentialGraphBuilder({
10
- id: 'custom-text-node-llm',
11
- nodes: [
12
- new LLMChatRequestBuilderNode({
13
- messages: [
14
- {
15
- role: 'user',
16
- content: { type: 'template', template: '{{user_input}}' },
17
- },
18
- ],
19
- }),
20
- new RemoteLLMChatNode({
21
- provider: 'openai',
22
- modelName: 'gpt-4o-mini',
23
- stream: true,
24
- }),
25
- new TextChunkingNode(),
26
- new RemoteTTSNode(),
27
- ],
28
- });
29
-
30
- export const graph = graphBuilder.build();
@@ -1,41 +0,0 @@
1
- {
2
- "name": "LLM + TTS Pipeline",
3
- "displayName": "LLM Chat with Text-to-Speech",
4
- "description": "A production-ready pipeline that processes user input through an LLM (GPT-4o-mini by default) and converts the response to speech using TTS. Includes streaming support for better user experience.",
5
- "tags": ["llm", "tts", "openai", "voice", "streaming"],
6
- "defaultProjectName": "llm-tts-graph",
7
- "examples": {
8
- "curlCommand": "curl http://localhost:3000/v1/graph:start -X POST -H 'Content-Type: application/json' -d '{\"input\": {\"user_input\":\"What is the weather like today?\"}}'",
9
- "inputExample": {
10
- "user_input": "What is the weather like today?"
11
- },
12
- "outputExample": {
13
- "text": "I don't have access to real-time weather data...",
14
- "audio": "base64_encoded_audio_data..."
15
- }
16
- },
17
- "features": [
18
- "LLM integration (OpenAI GPT-4o-mini)",
19
- "Text-to-Speech conversion",
20
- "Streaming responses",
21
- "Text chunking for optimal TTS",
22
- "Configurable providers"
23
- ],
24
- "requirements": {
25
- "node": ">=18.0.0",
26
- "dependencies": ["@inworld/runtime"],
27
- "apiKeys": ["OPENAI_API_KEY"],
28
- "optionalApiKeys": ["TTS_API_KEY"]
29
- },
30
- "configuration": {
31
- "llm": {
32
- "provider": "openai",
33
- "model": "gpt-4o-mini",
34
- "streaming": true
35
- },
36
- "tts": {
37
- "provider": "default",
38
- "voice": "default"
39
- }
40
- }
41
- }
@@ -1,155 +0,0 @@
1
- # LLM + TTS Pipeline Graph
2
-
3
- This is an Inworld Runtime graph that creates a complete conversational AI pipeline with LLM chat and text-to-speech capabilities.
4
-
5
- ## Overview
6
-
7
- This template provides a production-ready pipeline that:
8
-
9
- - Accepts user input and formats it for LLM processing
10
- - Sends requests to an LLM provider (OpenAI GPT-4o-mini by default)
11
- - Streams responses for better user experience
12
- - Chunks text for optimal TTS processing
13
- - Converts text responses to speech using TTS
14
-
15
- ## Getting Started
16
-
17
- ### Installation
18
-
19
- ```bash
20
- npm install
21
- ```
22
-
23
- ### Configuration
24
-
25
- Before running, you'll need to set up your API keys:
26
-
27
- ```bash
28
- # Set your Inworld API key
29
- export INWORLD_API_KEY="your-inworld-api-key"
30
- ```
31
-
32
- ### Running the Graph
33
-
34
- #### As a server (recommended):
35
-
36
- ```bash
37
- npm start
38
- # or
39
- npx inworld serve {{graphFileName}}
40
- ```
41
-
42
- #### Direct execution:
43
-
44
- ```bash
45
- npm run run
46
- # or
47
- npx inworld run {{graphFileName}}
48
- ```
49
-
50
- ## Project Structure
51
-
52
- - **`{{graphFileName}}`** - Main graph file with the LLM-TTS pipeline
53
- - **`package.json`** - Project dependencies and scripts
54
- - **`README.md`** - This file
55
-
56
- ## Pipeline Architecture
57
-
58
- The graph uses a `SequentialGraphBuilder` with the following nodes in order:
59
-
60
- 1. **LLMChatRequestBuilderNode**: Formats user input into LLM chat messages
61
- 2. **RemoteLLMChatNode**: Sends requests to the LLM provider and receives responses
62
- 3. **TextChunkingNode**: Breaks text into optimal chunks for TTS processing
63
- 4. **RemoteTTSNode**: Converts text chunks to speech
64
-
65
- ## Customization
66
-
67
- ### Changing the LLM Provider
68
-
69
- Edit the `RemoteLLMChatNode` configuration in `{{graphFileName}}`:
70
-
71
- ```typescript
72
- new RemoteLLMChatNode({
73
- provider: 'anthropic', // Change to 'anthropic', 'google', etc.
74
- modelName: 'claude-3-sonnet', // Change to desired model
75
- stream: true,
76
- // Add other provider-specific options
77
- });
78
- ```
79
-
80
- ### Modifying the System Prompt
81
-
82
- Add system messages to the `LLMChatRequestBuilderNode`:
83
-
84
- ```typescript
85
- new LLMChatRequestBuilderNode({
86
- messages: [
87
- {
88
- role: 'system',
89
- content: { type: 'text', text: 'You are a helpful assistant...' },
90
- },
91
- {
92
- role: 'user',
93
- content: { type: 'template', template: '{{user_input}}' },
94
- },
95
- ],
96
- });
97
- ```
98
-
99
- ### Customizing TTS Settings
100
-
101
- Configure the TTS node for different voices or providers:
102
-
103
- ```typescript
104
- new RemoteTTSNode({
105
- speakerId: 'Dennis',
106
- modelId: 'inworld-tts-1-max',
107
- });
108
- ```
109
-
110
- ### Adding Additional Processing
111
-
112
- You can insert additional nodes into the pipeline:
113
-
114
- ```typescript
115
- const graphBuilder = new SequentialGraphBuilder({
116
- id: 'custom-text-node-llm',
117
- nodes: [
118
- new LLMChatRequestBuilderNode({...}),
119
- new RemoteLLMChatNode({...}),
120
- new CustomProcessingNode(), // Your custom node
121
- new TextChunkingNode(),
122
- new RemoteTTSNode(),
123
- ],
124
- });
125
- ```
126
-
127
- ## Environment Variables
128
-
129
- The following environment variables can be configured:
130
-
131
- - `INWORLD_API_KEY`: API key for OpenAI (required for GPT models)
132
-
133
- ## Deployment
134
-
135
- To package your graph for deployment:
136
-
137
- ```bash
138
- npx inworld deploy {{graphFileName}}
139
- ```
140
-
141
- This will create a deployment package that can be uploaded to Inworld Cloud.
142
-
143
- ## Documentation
144
-
145
- For more information about:
146
-
147
- - Inworld Runtime: Visit the [documentation](https://docs.inworld.ai/)
148
- - LLM providers: Check provider-specific documentation
149
- - TTS options: See the TTS provider documentation
150
-
151
- ## Requirements
152
-
153
- - Node.js >= 18.0.0
154
- - @inworld/cli package
155
- - Valid Inworld API key
@@ -1,29 +0,0 @@
1
- import {
2
- RemoteLLMChatNode,
3
- RemoteTTSNode,
4
- SequentialGraphBuilder,
5
- TextChunkingNode,
6
- } from '@inworld/runtime/graph';
7
-
8
- const graphBuilder = new SequentialGraphBuilder({
9
- id: 'llm-tts-graph',
10
- nodes: [
11
- new RemoteLLMChatNode({
12
- provider: 'openai',
13
- modelName: 'gpt-4o-mini',
14
- stream: true,
15
- messageTemplates: [
16
- {
17
- role: 'user',
18
- content: { type: 'template', template: '{{user_input}}' },
19
- },
20
- ],
21
-
22
- }),
23
- new TextChunkingNode(),
24
- new RemoteTTSNode(),
25
- ],
26
- enableRemoteConfig: false
27
- });
28
-
29
- export const graph = graphBuilder.build();
@@ -1,41 +0,0 @@
1
- {
2
- "name": "LLM + TTS Pipeline",
3
- "displayName": "LLM Chat with Text-to-Speech",
4
- "description": "A production-ready pipeline that processes user input through an LLM (GPT-4o-mini by default) and converts the response to speech using TTS. Includes streaming support for better user experience.",
5
- "tags": ["llm", "tts", "openai", "voice", "streaming"],
6
- "defaultProjectName": "llm-tts-graph",
7
- "examples": {
8
- "curlCommand": "curl http://localhost:3000/v1/graph:start -X POST -H 'Content-Type: application/json' -d '{\"input\": {\"user_input\":\"What is the weather like today?\"}}'",
9
- "inputExample": {
10
- "user_input": "What is the weather like today?"
11
- },
12
- "outputExample": {
13
- "text": "I don't have access to real-time weather data...",
14
- "audio": "base64_encoded_audio_data..."
15
- }
16
- },
17
- "features": [
18
- "LLM integration (OpenAI GPT-4o-mini)",
19
- "Text-to-Speech conversion",
20
- "Streaming responses",
21
- "Text chunking for optimal TTS",
22
- "Configurable providers"
23
- ],
24
- "requirements": {
25
- "node": ">=18.0.0",
26
- "dependencies": ["@inworld/runtime"],
27
- "apiKeys": ["INWORLD_API_KEY"],
28
- "optionalApiKeys": []
29
- },
30
- "configuration": {
31
- "llm": {
32
- "provider": "openai",
33
- "model": "gpt-4o-mini",
34
- "streaming": true
35
- },
36
- "tts": {
37
- "provider": "default",
38
- "voice": "default"
39
- }
40
- }
41
- }