@inworld/cli 0.2.15 → 0.3.0-rc.5

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 (225) hide show
  1. package/dist/index.js +1246 -544
  2. package/dist/index.js.map +4 -4
  3. package/dist/package.json +49 -0
  4. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts +10 -0
  5. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts.map +1 -0
  6. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js +16 -0
  7. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js.map +1 -0
  8. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts +13 -0
  9. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts.map +1 -0
  10. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.js +2 -0
  11. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.js.map +1 -0
  12. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts +7 -0
  13. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts.map +1 -0
  14. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js +15 -0
  15. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js.map +1 -0
  16. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts +14 -0
  17. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts.map +1 -0
  18. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js +7 -0
  19. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js.map +1 -0
  20. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.d.ts +116 -0
  21. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.d.ts.map +1 -0
  22. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.js +71 -0
  23. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.js.map +1 -0
  24. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts +14 -0
  25. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts.map +1 -0
  26. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js +7 -0
  27. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js.map +1 -0
  28. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts +76 -0
  29. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts.map +1 -0
  30. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js +40 -0
  31. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js.map +1 -0
  32. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts +10 -0
  33. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts.map +1 -0
  34. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js +7 -0
  35. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js.map +1 -0
  36. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts +7 -0
  37. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts.map +1 -0
  38. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js +13 -0
  39. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js.map +1 -0
  40. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts +115 -0
  41. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts.map +1 -0
  42. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js +86 -0
  43. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js.map +1 -0
  44. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts +255 -0
  45. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts.map +1 -0
  46. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js +88 -0
  47. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js.map +1 -0
  48. package/dist/proto/generated/portal/fetch.pb.d.ts +26 -0
  49. package/dist/proto/generated/portal/fetch.pb.d.ts.map +1 -0
  50. package/dist/proto/generated/portal/fetch.pb.js +274 -0
  51. package/dist/proto/generated/portal/fetch.pb.js.map +1 -0
  52. package/dist/src/auth/callback_server.d.ts +41 -0
  53. package/dist/src/auth/callback_server.d.ts.map +1 -0
  54. package/dist/src/auth/callback_server.js +136 -0
  55. package/dist/src/auth/callback_server.js.map +1 -0
  56. package/dist/src/auth/manager.d.ts +97 -0
  57. package/dist/src/auth/manager.d.ts.map +1 -0
  58. package/dist/src/auth/manager.js +340 -0
  59. package/dist/src/auth/manager.js.map +1 -0
  60. package/dist/src/auth/utils.d.ts +45 -0
  61. package/dist/src/auth/utils.d.ts.map +1 -0
  62. package/dist/src/auth/utils.js +183 -0
  63. package/dist/src/auth/utils.js.map +1 -0
  64. package/dist/src/commands/auth/disable_telemetry_command.d.ts +3 -0
  65. package/dist/src/commands/auth/disable_telemetry_command.d.ts.map +1 -0
  66. package/dist/src/commands/auth/enable_telemetry_command.d.ts +3 -0
  67. package/dist/src/commands/auth/enable_telemetry_command.d.ts.map +1 -0
  68. package/dist/src/commands/auth/login_ci_command.d.ts +3 -0
  69. package/dist/src/commands/auth/login_ci_command.d.ts.map +1 -0
  70. package/dist/src/commands/auth/login_ci_command.js +41 -0
  71. package/dist/src/commands/auth/login_ci_command.js.map +1 -0
  72. package/dist/src/commands/auth/login_command.d.ts +4 -0
  73. package/dist/src/commands/auth/login_command.d.ts.map +1 -0
  74. package/dist/src/commands/auth/login_command.js +134 -0
  75. package/dist/src/commands/auth/login_command.js.map +1 -0
  76. package/dist/src/commands/auth/logout_command.d.ts +4 -0
  77. package/dist/src/commands/auth/logout_command.d.ts.map +1 -0
  78. package/dist/src/commands/auth/logout_command.js +54 -0
  79. package/dist/src/commands/auth/logout_command.js.map +1 -0
  80. package/dist/src/commands/auth/print_access_token_command.d.ts +3 -0
  81. package/dist/src/commands/auth/print_access_token_command.d.ts.map +1 -0
  82. package/dist/src/commands/auth/print_access_token_command.js +21 -0
  83. package/dist/src/commands/auth/print_access_token_command.js.map +1 -0
  84. package/dist/src/commands/auth/print_api_key_command.d.ts +3 -0
  85. package/dist/src/commands/auth/print_api_key_command.d.ts.map +1 -0
  86. package/dist/src/commands/auth/print_api_key_command.js +26 -0
  87. package/dist/src/commands/auth/print_api_key_command.js.map +1 -0
  88. package/dist/src/commands/auth/status_command.d.ts +4 -0
  89. package/dist/src/commands/auth/status_command.d.ts.map +1 -0
  90. package/dist/src/commands/auth/status_command.js +84 -0
  91. package/dist/src/commands/auth/status_command.js.map +1 -0
  92. package/dist/src/commands/auth_command.d.ts +3 -0
  93. package/dist/src/commands/auth_command.d.ts.map +1 -0
  94. package/dist/src/commands/auth_command.js +20 -0
  95. package/dist/src/commands/auth_command.js.map +1 -0
  96. package/dist/src/commands/graph/graph_deploy_command.d.ts +24 -0
  97. package/dist/src/commands/graph/graph_deploy_command.d.ts.map +1 -0
  98. package/dist/src/commands/graph/graph_deploy_command.js +191 -0
  99. package/dist/src/commands/graph/graph_deploy_command.js.map +1 -0
  100. package/dist/src/commands/graph/graph_init_command.d.ts +4 -0
  101. package/dist/src/commands/graph/graph_init_command.d.ts.map +1 -0
  102. package/dist/src/commands/graph/graph_init_command.js +376 -0
  103. package/dist/src/commands/graph/graph_init_command.js.map +1 -0
  104. package/dist/src/commands/graph/graph_run_command.d.ts +24 -0
  105. package/dist/src/commands/graph/graph_run_command.d.ts.map +1 -0
  106. package/dist/src/commands/graph/graph_run_command.js +50 -0
  107. package/dist/src/commands/graph/graph_run_command.js.map +1 -0
  108. package/dist/src/commands/graph/graph_serve_command.d.ts +4 -0
  109. package/dist/src/commands/graph/graph_serve_command.d.ts.map +1 -0
  110. package/dist/src/commands/graph/graph_serve_command.js +40 -0
  111. package/dist/src/commands/graph/graph_serve_command.js.map +1 -0
  112. package/dist/src/commands/graph/graph_variant_command.d.ts +3 -0
  113. package/dist/src/commands/graph/graph_variant_command.d.ts.map +1 -0
  114. package/dist/src/commands/graph/graph_variant_command.js +13 -0
  115. package/dist/src/commands/graph/graph_variant_command.js.map +1 -0
  116. package/dist/src/commands/graph/graph_visualize_command.d.ts +7 -0
  117. package/dist/src/commands/graph/graph_visualize_command.d.ts.map +1 -0
  118. package/dist/src/commands/graph/graph_visualize_command.js +35 -0
  119. package/dist/src/commands/graph/graph_visualize_command.js.map +1 -0
  120. package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts +3 -0
  121. package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts.map +1 -0
  122. package/dist/src/commands/graph/variant/graph_variant_list_command.js +25 -0
  123. package/dist/src/commands/graph/variant/graph_variant_list_command.js.map +1 -0
  124. package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts +7 -0
  125. package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts.map +1 -0
  126. package/dist/src/commands/graph/variant/graph_variant_print_command.js +45 -0
  127. package/dist/src/commands/graph/variant/graph_variant_print_command.js.map +1 -0
  128. package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts +3 -0
  129. package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts.map +1 -0
  130. package/dist/src/commands/graph/variant/graph_variant_register_command.js +45 -0
  131. package/dist/src/commands/graph/variant/graph_variant_register_command.js.map +1 -0
  132. package/dist/src/commands/graph_command.d.ts +3 -0
  133. package/dist/src/commands/graph_command.d.ts.map +1 -0
  134. package/dist/src/commands/graph_command.js +20 -0
  135. package/dist/src/commands/graph_command.js.map +1 -0
  136. package/dist/src/commands/tts_commands.d.ts +17 -0
  137. package/dist/src/commands/tts_commands.d.ts.map +1 -0
  138. package/dist/src/commands/tts_commands.js +568 -0
  139. package/dist/src/commands/tts_commands.js.map +1 -0
  140. package/dist/src/commands/workspace_command.d.ts +12 -0
  141. package/dist/src/commands/workspace_command.d.ts.map +1 -0
  142. package/dist/src/commands/workspace_command.js +33 -0
  143. package/dist/src/commands/workspace_command.js.map +1 -0
  144. package/dist/src/constants.d.ts +10 -0
  145. package/dist/src/constants.d.ts.map +1 -0
  146. package/dist/src/constants.js +30 -0
  147. package/dist/src/constants.js.map +1 -0
  148. package/dist/src/grpc/core/InworldError.d.ts +30 -0
  149. package/dist/src/grpc/core/InworldError.d.ts.map +1 -0
  150. package/dist/src/grpc/core/InworldError.js +46 -0
  151. package/dist/src/grpc/core/InworldError.js.map +1 -0
  152. package/dist/src/grpc/core/statusCodes.d.ts +122 -0
  153. package/dist/src/grpc/core/statusCodes.d.ts.map +1 -0
  154. package/dist/src/grpc/core/statusCodes.js +133 -0
  155. package/dist/src/grpc/core/statusCodes.js.map +1 -0
  156. package/dist/src/index.d.ts +2 -0
  157. package/dist/src/index.d.ts.map +1 -0
  158. package/dist/src/services/analytics.d.ts +45 -0
  159. package/dist/src/services/analytics.d.ts.map +1 -0
  160. package/dist/src/services/deploy_service.d.ts +4 -0
  161. package/dist/src/services/deploy_service.d.ts.map +1 -0
  162. package/dist/src/services/deploy_service.js +128 -0
  163. package/dist/src/services/deploy_service.js.map +1 -0
  164. package/dist/src/services/graph_loader.d.ts +7 -0
  165. package/dist/src/services/graph_loader.d.ts.map +1 -0
  166. package/dist/src/services/graph_loader.js +103 -0
  167. package/dist/src/services/graph_loader.js.map +1 -0
  168. package/dist/src/services/graph_variant_service.d.ts +12 -0
  169. package/dist/src/services/graph_variant_service.d.ts.map +1 -0
  170. package/dist/src/services/graph_variant_service.js +66 -0
  171. package/dist/src/services/graph_variant_service.js.map +1 -0
  172. package/dist/src/services/tts_service.d.ts +273 -0
  173. package/dist/src/services/tts_service.d.ts.map +1 -0
  174. package/dist/src/services/tts_service.js +299 -0
  175. package/dist/src/services/tts_service.js.map +1 -0
  176. package/dist/src/services/update_checker.d.ts +37 -0
  177. package/dist/src/services/update_checker.d.ts.map +1 -0
  178. package/dist/src/services/workspace_service.d.ts +47 -0
  179. package/dist/src/services/workspace_service.d.ts.map +1 -0
  180. package/dist/src/services/workspace_service.js +222 -0
  181. package/dist/src/services/workspace_service.js.map +1 -0
  182. package/dist/src/templates/llm_tts/graph.d.ts +2 -0
  183. package/dist/src/templates/llm_tts/graph.d.ts.map +1 -0
  184. package/dist/src/utils/array.d.ts +2 -0
  185. package/dist/src/utils/array.d.ts.map +1 -0
  186. package/dist/src/utils/array.js +4 -0
  187. package/dist/src/utils/array.js.map +1 -0
  188. package/dist/src/utils/confirm.d.ts +62 -0
  189. package/dist/src/utils/confirm.d.ts.map +1 -0
  190. package/dist/src/utils/confirm.js +90 -0
  191. package/dist/src/utils/confirm.js.map +1 -0
  192. package/dist/src/utils/long_running_operations.d.ts +38 -0
  193. package/dist/src/utils/long_running_operations.d.ts.map +1 -0
  194. package/dist/src/utils/long_running_operations.js +62 -0
  195. package/dist/src/utils/long_running_operations.js.map +1 -0
  196. package/dist/src/utils/resource_name_helper.d.ts +12 -0
  197. package/dist/src/utils/resource_name_helper.d.ts.map +1 -0
  198. package/dist/src/utils/resource_name_helper.js +29 -0
  199. package/dist/src/utils/resource_name_helper.js.map +1 -0
  200. package/dist/src/utils/selector.d.ts +62 -0
  201. package/dist/src/utils/selector.d.ts.map +1 -0
  202. package/dist/src/utils/selector.js +77 -0
  203. package/dist/src/utils/selector.js.map +1 -0
  204. package/dist/src/utils/spinner.d.ts +75 -0
  205. package/dist/src/utils/spinner.d.ts.map +1 -0
  206. package/dist/src/utils/spinner.js +178 -0
  207. package/dist/src/utils/spinner.js.map +1 -0
  208. package/dist/src/utils/ui.d.ts +27 -0
  209. package/dist/src/utils/ui.d.ts.map +1 -0
  210. package/dist/src/utils/ui.js +83 -0
  211. package/dist/src/utils/ui.js.map +1 -0
  212. package/dist/templates/llm_tts/graph.ts +8 -9
  213. package/package.json +5 -4
  214. package/dist/src/templates/simple/README.md +0 -106
  215. package/dist/src/templates/simple/graph.ts +0 -32
  216. package/dist/src/templates/simple/metadata.json +0 -26
  217. package/dist/templates/simple/README.md +0 -106
  218. package/dist/templates/simple/graph.ts +0 -32
  219. package/dist/templates/simple/metadata.json +0 -26
  220. package/src/templates/llm_tts/README.md +0 -155
  221. package/src/templates/llm_tts/graph.ts +0 -30
  222. package/src/templates/llm_tts/metadata.json +0 -41
  223. package/src/templates/simple/README.md +0 -106
  224. package/src/templates/simple/graph.ts +0 -32
  225. package/src/templates/simple/metadata.json +0 -26
@@ -1,32 +0,0 @@
1
- import {
2
- CustomNode,
3
- GraphBuilder,
4
- ProcessContext,
5
- } from '@inworld/runtime/graph';
6
-
7
- interface CustomTextOutput {
8
- processedText: string;
9
- }
10
-
11
- // Define a custom node that processes the input text
12
- export class CustomTextNode extends CustomNode {
13
- async process(
14
- _context: ProcessContext,
15
- input: string,
16
- ): Promise<CustomTextOutput> {
17
- return {
18
- processedText: input.toUpperCase(),
19
- };
20
- }
21
- }
22
- // Create an instance of the custom node
23
- const customTextNode = new CustomTextNode();
24
-
25
- // Creating a simple single-node graph builder instance and adding the node to it.
26
- const graphBuilder = new GraphBuilder('custom-text-node')
27
- .addNode(customTextNode)
28
- .setStartNode(customTextNode)
29
- .setEndNode(customTextNode);
30
-
31
- // Export graph to be used by Inworld CLI or Inworld Graph Server.
32
- export const graph = graphBuilder.build();
@@ -1,26 +0,0 @@
1
- {
2
- "id": "simple",
3
- "name": "Simple Custom Node",
4
- "description": "A basic example demonstrating how to create a custom node that processes text input. Perfect for learning the basics of the Inworld Runtime graph system.",
5
- "tags": ["beginner", "custom-node", "text-processing"],
6
- "defaultProjectName": "simple-graph",
7
- "examples": {
8
- "curlCommand": "curl http://localhost:3000/v1/graph:start -X POST -H 'Content-Type: application/json' -d '{\"input\": \"Hello\"}}'",
9
- "inputExample": {
10
- "text": "Hello!"
11
- },
12
- "outputExample": {
13
- "processedText": "HELLO!"
14
- }
15
- },
16
- "features": [
17
- "Custom node implementation",
18
- "Text processing pipeline",
19
- "Simple graph structure",
20
- "TypeScript support"
21
- ],
22
- "requirements": {
23
- "node": ">=18.0.0",
24
- "dependencies": ["@inworld/runtime"]
25
- }
26
- }
@@ -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,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": ["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
- }
@@ -1,106 +0,0 @@
1
- # Simple Custom Node Graph
2
-
3
- This is a simple Inworld Runtime graph project that demonstrates creating a custom node.
4
-
5
- ## Overview
6
-
7
- This template provides a basic example of:
8
-
9
- - Creating a custom node by extending `CustomNode`
10
- - Processing input text and returning transformed output
11
- - Setting up a single-node graph with start and end points
12
-
13
- ## Getting Started
14
-
15
- ### Installation
16
-
17
- ```bash
18
- npm install
19
- ```
20
-
21
- ### Running the Graph
22
-
23
- #### As a server (recommended):
24
-
25
- ```bash
26
- npm start
27
- # or
28
- npx inworld serve {{graphFileName}}
29
- ```
30
-
31
- #### Direct execution:
32
-
33
- ```bash
34
- npm run run
35
- # or
36
- npx inworld run {{graphFileName}}
37
- ```
38
-
39
- ## Project Structure
40
-
41
- - **`{{graphFileName}}`** - Main graph file containing your custom node implementation
42
- - **`package.json`** - Project dependencies and scripts
43
- - **`README.md`** - This file
44
-
45
- ## How It Works
46
-
47
- The template includes:
48
-
49
- 1. **CustomTextNode**: A custom node that processes input text (converts to uppercase as an example)
50
- 2. **GraphBuilder**: Creates a graph with the custom node as both start and end point
51
- 3. **Graph Export**: Exports the built graph for use with Inworld CLI or Graph Server
52
-
53
- ## Customization
54
-
55
- ### Modifying the Custom Node
56
-
57
- Edit the `CustomTextNode` class in `{{graphFileName}}` to change how text is processed:
58
-
59
- ```typescript
60
- export class CustomTextNode extends CustomNode {
61
- async process(
62
- _context: ProcessContext,
63
- input: string,
64
- ): Promise<CustomTextOutput> {
65
- // Add your custom processing logic here
66
- return {
67
- processedText: yourTransformFunction(input),
68
- };
69
- }
70
- }
71
- ```
72
-
73
- ### Adding More Nodes
74
-
75
- You can create additional custom nodes and chain them together:
76
-
77
- ```typescript
78
- const node1 = new FirstCustomNode();
79
- const node2 = new SecondCustomNode();
80
-
81
- const graphBuilder = new GraphBuilder('my-graph')
82
- .addNode(node1)
83
- .addNode(node2)
84
- .setStartNode(node1)
85
- .setEndNode(node2)
86
- .connectNodes(node1, node2);
87
- ```
88
-
89
- ## Deployment
90
-
91
- To package your graph for deployment:
92
-
93
- ```bash
94
- npx inworld deploy {{graphFileName}}
95
- ```
96
-
97
- This will create a deployment package that can be uploaded to Inworld Cloud.
98
-
99
- ## Documentation
100
-
101
- For more information about Inworld Runtime, visit the [documentation](https://docs.inworld.ai/).
102
-
103
- ## Requirements
104
-
105
- - Node.js >= 18.0.0
106
- - @inworld/cli package
@@ -1,32 +0,0 @@
1
- import {
2
- CustomNode,
3
- GraphBuilder,
4
- ProcessContext,
5
- } from '@inworld/runtime/graph';
6
-
7
- interface CustomTextOutput {
8
- processedText: string;
9
- }
10
-
11
- // Define a custom node that processes the input text
12
- export class CustomTextNode extends CustomNode {
13
- async process(
14
- _context: ProcessContext,
15
- input: string,
16
- ): Promise<CustomTextOutput> {
17
- return {
18
- processedText: input.toUpperCase(),
19
- };
20
- }
21
- }
22
- // Create an instance of the custom node
23
- const customTextNode = new CustomTextNode();
24
-
25
- // Creating a simple single-node graph builder instance and adding the node to it.
26
- const graphBuilder = new GraphBuilder('custom-text-node')
27
- .addNode(customTextNode)
28
- .setStartNode(customTextNode)
29
- .setEndNode(customTextNode);
30
-
31
- // Export graph to be used by Inworld CLI or Inworld Graph Server.
32
- export const graph = graphBuilder.build();
@@ -1,26 +0,0 @@
1
- {
2
- "id": "simple",
3
- "name": "Simple Custom Node",
4
- "description": "A basic example demonstrating how to create a custom node that processes text input. Perfect for learning the basics of the Inworld Runtime graph system.",
5
- "tags": ["beginner", "custom-node", "text-processing"],
6
- "defaultProjectName": "simple-graph",
7
- "examples": {
8
- "curlCommand": "curl http://localhost:3000/v1/graph:start -X POST -H 'Content-Type: application/json' -d '{\"input\": \"Hello\"}}'",
9
- "inputExample": {
10
- "text": "Hello!"
11
- },
12
- "outputExample": {
13
- "processedText": "HELLO!"
14
- }
15
- },
16
- "features": [
17
- "Custom node implementation",
18
- "Text processing pipeline",
19
- "Simple graph structure",
20
- "TypeScript support"
21
- ],
22
- "requirements": {
23
- "node": ">=18.0.0",
24
- "dependencies": ["@inworld/runtime"]
25
- }
26
- }