@promptbook/remote-server 0.44.0-9 → 0.44.0

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.
package/README.md CHANGED
@@ -1,5 +1,743 @@
1
- # 📖 Promptbook
1
+ # ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook
2
2
 
3
3
  Library to supercharge your use of large language models
4
4
 
5
- [Read the manual](https://github.com/webgptorg/promptbook)
5
+ <!--Badges-->
6
+ <!--⚠️WARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/800-badges/badges.ts so every manual change will be overwritten.-->
7
+
8
+ [![License of 📖 Prompt book](https://img.shields.io/github/license/webgptorg/promptbook.svg?style=flat)](https://github.com/webgptorg/promptbook/blob/main/LICENSE)
9
+ [![Known Vulnerabilities](https://snyk.io/test/github/webgptorg/promptbook/badge.svg)](https://snyk.io/test/github/webgptorg/promptbook)
10
+ [![Issues](https://img.shields.io/github/issues/webgptorg/promptbook.svg?style=flat)](https://github.com/webgptorg/promptbook/issues)
11
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/@promptbook/remote-server)](https://socket.dev/npm/package/@promptbook/remote-server)
12
+
13
+ <!--/Badges-->
14
+
15
+ ## 📦 Package `@promptbook/remote-server`
16
+
17
+ - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
18
+ - This package `@promptbook/remote-server` is one part of the promptbook ecosystem.
19
+
20
+ To install this package, run:
21
+
22
+ ```bash
23
+ npm i @promptbook/remote-server
24
+ ```
25
+
26
+ <!-- TODO: Sample of use + interlink server and client -->
27
+
28
+ ---
29
+
30
+ Rest of the documentation is common for **entire promptbook ecosystem**:
31
+
32
+ <!--
33
+ TODO: Probbably remove this section only in packages
34
+ > ⚠ Warning: This library is still in early development.
35
+ -->
36
+
37
+ ## 🤍 Whitepaper
38
+
39
+ When you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how it is integrated. Whether it's the direct calling of a REST API, using the SDK, hardcoding the prompt in the source code, or importing a text file, the process remains the same.
40
+
41
+ If you need something more advanced or want to extend the capabilities of LLMs, you generally have three ways to proceed:
42
+
43
+ 1. **Fine-tune** the model to your specifications or even train your own.
44
+ 2. **Prompt-engineer** the prompt to the best shape you can achieve.
45
+ 3. Use **multiple prompts** in a pipeline to get the best result.
46
+
47
+ In any of these situations, but especially in (3), the Promptbook library can make your life easier and make **orchestraror for your prompts**.
48
+
49
+ - **Separation of concerns** between prompt engineer and programmer; between code files and prompt files; and between prompts, templates, templating pipelines, and their execution logic.
50
+ - Set up a **common format** for prompts that is interchangeable between projects and language/technology stacks.
51
+ - **Preprocessing** and cleaning the input data from the user.
52
+ - Use default values - **Jokers** to bypass some parts of the pipeline.
53
+ - **Expect** some specific output from the model.
54
+ - **Retry** mismatched outputs.
55
+ - **Combine** multiple models together.
56
+ - Interactive **User interaction** with the model and the user.
57
+ - Leverage **external** sources (like ChatGPT plugins or OpenAI's GPTs).
58
+ - Simplify your code to be **DRY** and not repeat all the boilerplate code for each prompt.
59
+ - **Versioning** of promptbooks
60
+ - **Reuse** parts of promptbooks in/between projects.
61
+ - Run the LLM **optimally** in parallel, with the best _cost/quality_ ratio or _speed/quality_ ratio.
62
+ - **Execution report** to see what happened during the execution.
63
+ - **Logging** the results of the promptbooks.
64
+ - _(Not ready yet)_ **Caching** calls to LLMs to save money and time.
65
+ - _(Not ready yet)_ Extend one prompt book from another one.
66
+ - _(Not ready yet)_ Leverage the **streaming** to make super cool UI/UX.
67
+ - _(Not ready yet)_ **A/B testing** to determine which prompt works best for the job.
68
+
69
+ ![WebGPT](./other/screencasts/screencast-fiabciakcmgepblmdkmemdbbkilneeeh-2023.10.26-21_46_17.gif)
70
+
71
+ ## 🧔 Promptbook _(for prompt-engeneers)_
72
+
73
+ **P**romp**t** **b**oo**k** markdown file (**PTBK** for short, or `.ptbk.md`) is document that describes a series of prompts that are chained together to form somewhat reciepe for transforming natural language input. Inside a PTBK you can use chat prompts, completion prompts, scripting or trigger interaction with user to ask for additional information.
74
+
75
+ - Multiple promptbooks forms a library which will become a **part of your application codebase**.
76
+ - Theese promptbooks are designed such as they **can be written by non-programmers**.
77
+
78
+ <!-- TODO: [🧠] Make some more clear escaping -->
79
+
80
+ ### Sample:
81
+
82
+ File `write-website-content.ptbk.md`:
83
+
84
+ <!------------------------[ Sample: ]------------------------>
85
+
86
+ > # 🌍 Create website content
87
+ >
88
+ > Instructions for creating web page content.
89
+ >
90
+ > - PROMPTBOOK URL https://promptbook.webgpt.com/en/write-website-content.ptbk.md@v0.1.0
91
+ > - PROMPTBOOK VERSION 0.0.1
92
+ > - INPUT  PARAM `{rawTitle}` Automatically suggested a site name or empty text
93
+ > - INPUT  PARAM `{rawAssigment}` Automatically generated site entry from image recognition
94
+ > - OUTPUT PARAM `{content}` Web content
95
+ > - OUTPUT PARAM `{keywords}` Keywords
96
+ >
97
+ > ## 👤 Specifying the assigment
98
+ >
99
+ > What is your web about?
100
+ >
101
+ > - PROMPT DIALOG
102
+ >
103
+ > ```
104
+ > {rawAssigment}
105
+ > ```
106
+ >
107
+ > `-> {assigment}` Website assignment and specification
108
+ >
109
+ > ## ✨ Improving the title
110
+ >
111
+ > - MODEL VARIANT Chat
112
+ > - MODEL NAME `gpt-4`
113
+ > - POSTPROCESSING `unwrapResult`
114
+ >
115
+ > ```
116
+ > As an experienced marketing specialist, you have been entrusted with improving the name of your client's business.
117
+ >
118
+ > A suggested name from a client:
119
+ > "{rawTitle}"
120
+ >
121
+ > Assignment from customer:
122
+ >
123
+ > > {assigment}
124
+ >
125
+ > ## Instructions:
126
+ >
127
+ > - Write only one name suggestion
128
+ > - The name will be used on the website, business cards, visuals, etc.
129
+ > ```
130
+ >
131
+ > `-> {enhancedTitle}` Enhanced title
132
+ >
133
+ > ## 👤 Website title approval
134
+ >
135
+ > Is the title for your website okay?
136
+ >
137
+ > - PROMPT DIALOG
138
+ >
139
+ > ```
140
+ > {enhancedTitle}
141
+ > ```
142
+ >
143
+ > `-> {title}` Title for the website
144
+ >
145
+ > ## 🐰 Cunning subtitle
146
+ >
147
+ > - MODEL VARIANT Chat
148
+ > - MODEL NAME `gpt-4`
149
+ > - POSTPROCESSING `unwrapResult`
150
+ >
151
+ > ```
152
+ > As an experienced copywriter, you have been entrusted with creating a claim for the "{title}" web page.
153
+ >
154
+ > A website assignment from a customer:
155
+ >
156
+ > > {assigment}
157
+ >
158
+ > ## Instructions:
159
+ >
160
+ > - Write only one name suggestion
161
+ > - Claim will be used on website, business cards, visuals, etc.
162
+ > - Claim should be punchy, funny, original
163
+ > ```
164
+ >
165
+ > `-> {claim}` Claim for the web
166
+ >
167
+ > ## 🚦 Keyword analysis
168
+ >
169
+ > - MODEL VARIANT Chat
170
+ > - MODEL NAME `gpt-4`
171
+ >
172
+ > ```
173
+ > As an experienced SEO specialist, you have been entrusted with creating keywords for the website "{title}".
174
+ >
175
+ > Website assignment from the customer:
176
+ >
177
+ > > {assigment}
178
+ >
179
+ > ## Instructions:
180
+ >
181
+ > - Write a list of keywords
182
+ > - Keywords are in basic form
183
+ >
184
+ > ## Example:
185
+ >
186
+ > - Ice cream
187
+ > - Olomouc
188
+ > - Quality
189
+ > - Family
190
+ > - Tradition
191
+ > - Italy
192
+ > - Craft
193
+ >
194
+ > ```
195
+ >
196
+ > `-> {keywords}` Keywords
197
+ >
198
+ > ## 🔗 Combine the beginning
199
+ >
200
+ > - SIMPLE TEMPLATE
201
+ >
202
+ > ```
203
+ >
204
+ > # {title}
205
+ >
206
+ > > {claim}
207
+ >
208
+ > ```
209
+ >
210
+ > `-> {contentBeginning}` Beginning of web content
211
+ >
212
+ > ## 🖋 Write the content
213
+ >
214
+ > - MODEL VARIANT Completion
215
+ > - MODEL NAME `gpt-3.5-turbo-instruct`
216
+ >
217
+ > ```
218
+ > As an experienced copywriter and web designer, you have been entrusted with creating text for a new website {title}.
219
+ >
220
+ > A website assignment from a customer:
221
+ >
222
+ > > {assigment}
223
+ >
224
+ > ## Instructions:
225
+ >
226
+ > - Text formatting is in Markdown
227
+ > - Be concise and to the point
228
+ > - Use keywords, but they should be naturally in the text
229
+ > - This is the complete content of the page, so don't forget all the important information and elements the page should contain
230
+ > - Use headings, bullets, text formatting
231
+ >
232
+ > ## Keywords:
233
+ >
234
+ > {keywords}
235
+ >
236
+ > ## Web Content:
237
+ >
238
+ > {contentBeginning}
239
+ > ```
240
+ >
241
+ > `-> {contentBody}` Middle of the web content
242
+ >
243
+ > ## 🔗 Combine the content
244
+ >
245
+ > - SIMPLE TEMPLATE
246
+ >
247
+ > ```markdown
248
+ > {contentBeginning}
249
+ >
250
+ > {contentBody}
251
+ > ```
252
+ >
253
+ > `-> {content}`
254
+
255
+ <!------------------------[ /Sample ]------------------------>
256
+
257
+ Following is the scheme how the promptbook above is executed:
258
+
259
+ ```mermaid
260
+ %% 🔮 Tip: Open this on GitHub or in the VSCode website to see the Mermaid graph visually
261
+
262
+ flowchart LR
263
+ subgraph "🌍 Create website content"
264
+
265
+ direction TB
266
+
267
+ input((Input)):::input
268
+ templateSpecifyingTheAssigment(👤 Specifying the assigment)
269
+ input--"{rawAssigment}"-->templateSpecifyingTheAssigment
270
+ templateImprovingTheTitle(✨ Improving the title)
271
+ input--"{rawTitle}"-->templateImprovingTheTitle
272
+ templateSpecifyingTheAssigment--"{assigment}"-->templateImprovingTheTitle
273
+ templateWebsiteTitleApproval(👤 Website title approval)
274
+ templateImprovingTheTitle--"{enhancedTitle}"-->templateWebsiteTitleApproval
275
+ templateCunningSubtitle(🐰 Cunning subtitle)
276
+ templateWebsiteTitleApproval--"{title}"-->templateCunningSubtitle
277
+ templateSpecifyingTheAssigment--"{assigment}"-->templateCunningSubtitle
278
+ templateKeywordAnalysis(🚦 Keyword analysis)
279
+ templateWebsiteTitleApproval--"{title}"-->templateKeywordAnalysis
280
+ templateSpecifyingTheAssigment--"{assigment}"-->templateKeywordAnalysis
281
+ templateCombineTheBeginning(🔗 Combine the beginning)
282
+ templateWebsiteTitleApproval--"{title}"-->templateCombineTheBeginning
283
+ templateCunningSubtitle--"{claim}"-->templateCombineTheBeginning
284
+ templateWriteTheContent(🖋 Write the content)
285
+ templateWebsiteTitleApproval--"{title}"-->templateWriteTheContent
286
+ templateSpecifyingTheAssigment--"{assigment}"-->templateWriteTheContent
287
+ templateKeywordAnalysis--"{keywords}"-->templateWriteTheContent
288
+ templateCombineTheBeginning--"{contentBeginning}"-->templateWriteTheContent
289
+ templateCombineTheContent(🔗 Combine the content)
290
+ templateCombineTheBeginning--"{contentBeginning}"-->templateCombineTheContent
291
+ templateWriteTheContent--"{contentBody}"-->templateCombineTheContent
292
+
293
+ templateCombineTheContent--"{content}"-->output
294
+ output((Output)):::output
295
+
296
+ classDef input color: grey;
297
+ classDef output color: grey;
298
+
299
+ end;
300
+ ```
301
+
302
+ [More template samples](./samples/templates/)
303
+
304
+ _Note: We are using [postprocessing functions](#postprocessing-functions) like `unwrapResult` that can be used to postprocess the result._
305
+
306
+ ## 📦 Packages
307
+
308
+ This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook):
309
+
310
+ <!--[🔠]-->
311
+
312
+ - **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
313
+ - **[@promptbook/utils](https://www.npmjs.com/package/@promptbook/utils)** - Utility functions used in the library but also useful for individual use in preprocessing and postprocessing LLM inputs and outputs
314
+ - _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
315
+ - **[@promptbook/execute-javascript](https://www.npmjs.com/package/@promptbook/execute-javascript)** - Execution tools for javascript inside promptbooks
316
+ - **[@promptbook/openai](https://www.npmjs.com/package/@promptbook/openai)** - Execution tools for OpenAI API, wrapper around OpenAI SDK
317
+ - **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
318
+ - **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
319
+ - **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
320
+ - **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
321
+
322
+ ## 📚 Dictionary
323
+
324
+ The following glossary is used to clarify certain basic concepts:
325
+
326
+ ### Prompt
327
+
328
+ Prompt in a text along with model requirements, but without any execution or templating logic.
329
+
330
+ For example:
331
+
332
+ ```json
333
+ {
334
+ "request": "Which sound does a cat make?",
335
+ "modelRequirements": {
336
+ "variant": "CHAT"
337
+ }
338
+ }
339
+ ```
340
+
341
+ ```json
342
+ {
343
+ "request": "I am a cat.\nI like to eat fish.\nI like to sleep.\nI like to play with a ball.\nI l",
344
+ "modelRequirements": {
345
+ "variant": "COMPLETION"
346
+ }
347
+ }
348
+ ```
349
+
350
+ ### Prompt Template
351
+
352
+ Similar concept to Prompt, but with templating logic.
353
+
354
+ For example:
355
+
356
+ ```json
357
+ {
358
+ "request": "Which sound does a {animalName} make?",
359
+ "modelRequirements": {
360
+ "variant": "CHAT"
361
+ }
362
+ }
363
+ ```
364
+
365
+ ### Model Requirements
366
+
367
+ Abstract way to specify the LLM.
368
+ It does not specify the LLM with concrete version itself, only the requirements for the LLM.
369
+ _NOT chatgpt-3.5-turbo BUT CHAT variant of GPT-3.5._
370
+
371
+ For example:
372
+
373
+ ```json
374
+ {
375
+ "variant": "CHAT",
376
+ "version": "GPT-3.5",
377
+ "temperature": 0.7
378
+ }
379
+ ```
380
+
381
+ ### Execution type
382
+
383
+ Each block of promptbook can have a different execution type.
384
+ It is specified in list of requirements for the block.
385
+ By default, it is `Prompt template`
386
+
387
+ - _(default)_ `Prompt template` The block is a prompt template and is executed by LLM (OpenAI, Azure,...)
388
+ - `SIMPLE TEMPLATE` The block is a simple text template which is just filled with parameters
389
+ - `Script` The block is a script that is executed by some script runtime, the runtime is determined by block type, currently only `javascript` is supported but we plan to add `python` and `typescript` in the future.
390
+ - `PROMPT DIALOG` Ask user for input
391
+
392
+ ### Parameters
393
+
394
+ Parameters that are placed in the prompt template and replaced to create the prompt.
395
+ It is a simple key-value object.
396
+
397
+ ```json
398
+ {
399
+ "animalName": "cat",
400
+ "animalSound": "Meow!"
401
+ }
402
+ ```
403
+
404
+ There are three types of template parameters, depending on how they are used in the promptbook:
405
+
406
+ - **INPUT PARAMETER**s are required to execute the promptbook.
407
+ - **Intermediate parameters** are used internally in the promptbook.
408
+ - **OUTPUT PARAMETER**s are explicitelly marked and they are returned as the result of the promptbook execution.
409
+
410
+ _Note: Parameter can be both intermedite and output at the same time._
411
+
412
+ ### Promptbook
413
+
414
+ Promptbook is **core concept of this library**.
415
+ It represents a series of prompt templates chained together to form a **pipeline** / one big prompt template with input and result parameters.
416
+
417
+ Internally it can have multiple formats:
418
+
419
+ - **.ptbk.md file** in custom markdown format described above
420
+ - _(concept)_ **.ptbk** format, custom fileextension based on markdown
421
+ - _(internal)_ **JSON** format, parsed from the .ptbk.md file
422
+
423
+ ### Promptbook **Library**
424
+
425
+ Library of all promptbooks used in your application.
426
+ Each promptbook is a separate `.ptbk.md` file with unique `PROMPTBOOK URL`. Theese urls are used to reference promptbooks in other promptbooks or in the application code.
427
+
428
+ ### Prompt Result
429
+
430
+ Prompt result is the simplest concept of execution.
431
+ It is the result of executing one prompt _(NOT a template)_.
432
+
433
+ For example:
434
+
435
+ ```json
436
+ {
437
+ "response": "Meow!",
438
+ "model": "chatgpt-3.5-turbo"
439
+ }
440
+ ```
441
+
442
+ ### Execution Tools
443
+
444
+ `ExecutionTools` is an interface which contains all the tools needed to execute prompts.
445
+ It contais 3 subtools:
446
+
447
+ - `NaturalExecutionTools`
448
+ - `ScriptExecutionTools`
449
+ - `UserInterfaceTools`
450
+
451
+ Which are described below:
452
+
453
+ #### Natural Execution Tools
454
+
455
+ `NaturalExecutionTools` is a container for all the tools needed to execute prompts to large language models like GPT-4.
456
+ On its interface it exposes common methods for prompt execution.
457
+ Internally it calls OpenAI, Azure, GPU, proxy, cache, logging,...
458
+
459
+ `NaturalExecutionTools` an abstract interface that is implemented by concrete execution tools:
460
+
461
+ - `OpenAiExecutionTools`
462
+ - _(Not implemented yet)_ `AnthropicClaudeExecutionTools`
463
+ - _(Not implemented yet)_ `AzureOpenAiExecutionTools`
464
+ - _(Not implemented yet)_ `BardExecutionTools`
465
+ - _(Not implemented yet)_ `LamaExecutionTools`
466
+ - _(Not implemented yet)_ `GpuExecutionTools`
467
+ - And a special case are `RemoteNaturalExecutionTools` that connect to a remote server and run one of the above execution tools on that server.
468
+ - The second special case is `MockedEchoNaturalExecutionTools` that is used for testing and mocking.
469
+ - The third special case is `LogNaturalExecutionToolsWrapper` that is technically also an execution tools but it is more proxy wrapper around other execution tools that logs all calls to execution tools.
470
+
471
+ #### Script Execution Tools
472
+
473
+ `ScriptExecutionTools` is an abstract container that represents all the tools needed to EXECUTE SCRIPTs. It is implemented by concrete execution tools:
474
+
475
+ - `JavascriptExecutionTools` is a wrapper around `vm2` module that executes javascript code in a sandbox.
476
+ - `JavascriptEvalExecutionTools` is wrapper around `eval` function that executes javascript. It is used for testing and mocking **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
477
+ - _(Not implemented yet)_ `TypescriptExecutionTools` executes typescript code in a sandbox.
478
+ - _(Not implemented yet)_ `PythonExecutionTools` executes python code in a sandbox.
479
+
480
+ There are [postprocessing functions](#postprocessing-functions) that can be used to postprocess the result.
481
+
482
+ #### User Interface Tools
483
+
484
+ `UserInterfaceTools` is an abstract container that represents all the tools needed to interact with the user. It is implemented by concrete execution tools:
485
+
486
+ - _(Not implemented yet)_ `ConsoleInterfaceTools` is a wrapper around `readline` module that interacts with the user via console.
487
+ - `SimplePromptInterfaceTools` is a wrapper around `window.prompt` synchronous function that interacts with the user via browser prompt. It is used for testing and mocking **NOT intended to use in the production** due to its synchronous nature.
488
+ - `CallbackInterfaceTools` delagates the user interaction to a async callback function. You need to provide your own implementation of this callback function and its bind to UI. <!-- <- TODO: Provide here a way how to do it with some our plugin -->
489
+
490
+ ### Executor
491
+
492
+ Executor is a simple async function that takes **input parameters** and returns **output parameters**.
493
+ It is constructed by combining execution tools and promptbook to execute together.
494
+
495
+ ### 🃏 Jokers
496
+
497
+ Joker is a previously defined parameter that is used to bypass some parts of the pipeline.
498
+ If the joker is present in the template, it is checked to see if it meets the requirements (without postprocessing), and if so, it is used instead of executing that prompt template. There can be multiple wildcards in a prompt template, if so they are checked in order and the first one that meets the requirements is used.
499
+
500
+ If none of the jokers meet the requirements, the prompt template is executed as usual.
501
+
502
+ This can be useful, for example, if you want to use some predefined data, or if you want to use some data from the user, but you are not sure if it is suitable form.
503
+
504
+ When using wildcards, you must have at least one minimum expectation. If you do not have a minimum expectation, the joker will always fulfil the expectation because it has none, so it makes no logical sense.
505
+
506
+ Look at [jokers.ptbk.md](samples/templates/41-jokers.ptbk.md) sample.
507
+
508
+ ### Postprocessing functions
509
+
510
+ You can define postprocessing functions when creating `JavascriptEvalExecutionTools`:
511
+
512
+ ```
513
+
514
+ ```
515
+
516
+ Additionally there are some usefull string-manipulation build-in functions, which are [listed here](src/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.ts).
517
+
518
+ ### Expectations
519
+
520
+ `Expect` command describes the desired output of the prompt template (after post-processing)
521
+ It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
522
+
523
+ _Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units._
524
+
525
+ ```markdown
526
+ # ✨ Sample: Expectations
527
+
528
+ - PROMPTBOOK URL https://promptbook.example.com/samples/postprocessing-2.ptbk.md@v1
529
+ - PROMPTBOOK VERSION 1.0.0
530
+ - INPUT  PARAMETER {yourName} Name of the hero
531
+
532
+ ## 💬 Question
533
+
534
+ - EXPECT MAX 30 CHARACTERS
535
+ - EXPECT MIN 2 CHARACTERS
536
+ - EXPECT MAX 3 WORDS
537
+ - EXPECT EXACTLY 1 SENTENCE
538
+ - EXPECT EXACTLY 1 LINE
539
+
540
+ ...
541
+ ```
542
+
543
+ There are two types of expectations which are not strictly symmetrical:
544
+
545
+ #### Minimal expectations
546
+
547
+ - `EXPECT MIN 0 ...` is not valid minimal expectation. It makes no sense.
548
+ - `EXPECT JSON` is both minimal and maximal expectation
549
+ - When you are using `JOKER` in same prompt template, you need to have at least one minimal expectation
550
+
551
+ #### Maximal expectations
552
+
553
+ - `EXPECT MAX 0 ...` is valid maximal expectation. For example, you can expect 0 pages and 2 sentences.
554
+ - `EXPECT JSON` is both minimal and maximal expectation
555
+
556
+ Look at [expectations.ptbk.md](samples/templates/45-expectations.ptbk.md) and [expect-json.ptbk.md](samples/templates/45-expect-json.ptbk.md) samples for more.
557
+
558
+ <!--
559
+ ### New
560
+ [🥻] Insert here when making new command
561
+ -->
562
+
563
+ ### Execution report
564
+
565
+ Execution report is a simple object or markdown that contains information about the execution of the promptbook.
566
+
567
+ [See the example of such a report](/samples/templates/50-advanced.report.md)
568
+
569
+ <!-- TODO: Write more -->
570
+
571
+ ### Remote server
572
+
573
+ Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
574
+
575
+ You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
576
+ This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
577
+
578
+ ## 👨‍💻 Usage and integration _(for developers)_
579
+
580
+ <!--
581
+
582
+ TODO: [🧙‍♂️]
583
+
584
+ ### 🧙‍♂️ Using wizzard
585
+
586
+ First you need to install this library:
587
+
588
+ ```bash
589
+ npm install --save @promptbook/wizzard
590
+ ```
591
+
592
+ > TODO: !! Write the Wizzard sample
593
+
594
+ [Usage samples](./samples/usage/)
595
+
596
+ -->
597
+
598
+ ### 🔌 Usage in Typescript / Javascript
599
+
600
+ - [Simple usage](./samples/usage/simple-script)
601
+ - [Usage with client and remote server](./samples/usage/remote)
602
+
603
+ ## ➕➖ When to use Promptbook?
604
+
605
+ ### ➕ When to use
606
+
607
+ - When you are writing app that generates complex things via LLM - like **websites, articles, presentations, code, stories, songs**,...
608
+ - When you want to **separate code from text prompts**
609
+ - When you want to describe **complex prompt pipelines** and don't want to do it in the code
610
+ - When you want to **orchestrate multiple prompts** together
611
+ - When you want to **reuse** parts of prompts in multiple places
612
+ - When you want to **version** your prompts and **test multiple versions**
613
+ - When you want to **log** the execution of prompts and backtrace the issues
614
+
615
+ ### ➖ When not to use
616
+
617
+ - When you are writing just a simple chatbot without any extra logic, just system messages
618
+
619
+ ## 🐜 Known issues
620
+
621
+ <!-- TODO: -->
622
+
623
+ ## 🧼 Intentionally not implemented features
624
+
625
+ <!-- TODO: -->
626
+
627
+ ## ❔ FAQ
628
+
629
+ If you have a question [start a discussion](https://github.com/webgptorg/promptbook/discussions/), [open an issue](https://github.com/webgptorg/promptbook/issues) or [write me an email](https://www.pavolhejny.com/contact).
630
+
631
+ ### Why not just use the OpenAI SDK / Anthropic Claude SDK / ...?
632
+
633
+ Different levels of abstraction. OpenAI library is for direct use of OpenAI API. This library is for a higher level of abstraction. It is for creating prompt templates and promptbooks that are independent of the underlying library, LLM model, or even LLM provider.
634
+
635
+ ### How is it different from the Langchain library?
636
+
637
+ Langchain is primarily aimed at ML developers working in Python. This library is for developers working in javascript/typescript and creating applications for end users.
638
+
639
+ We are considering creating a bridge/converter between these two libraries.
640
+
641
+ <!--
642
+
643
+ ==========
644
+ Include:
645
+ - Langchain is the python library and JavaScript is on second place
646
+ - Langchain primarily focused on making templates, not on combining templates into larger structures
647
+ - at the language level it distinguishes between chat and completion, I need to mix the two into one template pipeline
648
+ - for a non-programmer it's quite hard to work with such a thing and write templates - I would much prefer a system that allows non-technical people to write templates (of which there are many more on the market than free pythonists)
649
+ - The focus of promptbooks is primarily on building user applications, not the data processing, training or autogpt.
650
+ -->
651
+
652
+ ### Promptbooks vs. OpenAI`s GPTs
653
+
654
+ GPTs are chat assistants that can be assigned to specific tasks and materials. But they are still chat assistants. Promptbooks are a way to orchestrate many more predefined tasks to have much tighter control over the process. Promptbooks are not a good technology for creating human-like chatbots, GPTs are not a good technology for creating outputs with specific requirements.
655
+
656
+ <!--
657
+ TODO:
658
+ ### Promptbooks vs. Semantic Kernel
659
+
660
+
661
+ -->
662
+
663
+ <!--
664
+ TODO: !
665
+ ### Promptbooks vs. Langtail
666
+
667
+
668
+ -->
669
+
670
+ <!--
671
+ TODO:
672
+ ### Promptbooks vs. Evidentally AI
673
+
674
+ Logging and monitoring
675
+
676
+ -->
677
+
678
+ ### Where should I store my promptbooks?
679
+
680
+ If you use raw SDKs, you just put prompts in the sourcecode, mixed in with typescript, javascript, python or whatever programming language you use.
681
+
682
+ If you use promptbooks, you can store them in several places, each with its own advantages and disadvantages:
683
+
684
+ 1. As **source code**, typically git-committed. In this case you can use the versioning system and the promptbooks will be tightly coupled with the version of the application. You still get the power of promptbooks, as you separate the concerns of the prompt-engineer and the programmer.
685
+
686
+ 2. As data in a **database** In this case, promptbooks are like posts / articles on the blog. They can be modified independently of the application. You don't need to redeploy the application to change the promptbooks. You can have multiple versions of promptbooks for each user. You can have a web interface for non-programmers to create and modify promptbooks. But you lose the versioning system and you still have to consider the interface between the promptbooks and the application _(= input and output parameters)_.
687
+
688
+ 3. In a **configuration** in environment variables. This is a good way to store promptbooks if you have an application with multiple deployments and you want to have different but simple promptbooks for each deployment and you don't need to change them often.
689
+
690
+ ### What should I do when I need same promptbook in multiple human languages?
691
+
692
+ A single promptbook can be written for several _(human)_ languages at once. However, we recommend that you have separate promptbooks for each language.
693
+
694
+ In large language models, you will get better results if you have prompts in the same language as the user input.
695
+
696
+ The best way to manage this is to have suffixed promptbooks like `write-website-content.en.ptbk.md` and `write-website-content.cs.ptbk.md` for each supported language.
697
+
698
+ <!--
699
+ TODO: (Maybe)
700
+ ### Why you need to explicitly specify input and output parameters?
701
+ -->
702
+
703
+ <!--
704
+
705
+
706
+
707
+ !
708
+
709
+
710
+
711
+ unit testing
712
+
713
+ escaping
714
+
715
+ how i get block into prompt
716
+
717
+
718
+ ## 🚷 Limitations
719
+
720
+ function calling
721
+ system message
722
+ iterations
723
+
724
+ -->
725
+
726
+ ## ⌚ Changelog
727
+
728
+ See [CHANGELOG.md](./CHANGELOG.md)
729
+
730
+ ## 📜 License
731
+
732
+ <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://github.com/webgptorg/promptbook">Promptbook</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://github.com/hejny/">Pavol Hejný</a> is licensed under <a href="https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY 4.0</a></p>
733
+
734
+ <!--Contributing-->
735
+ <!--⚠️WARNING: This section was generated by https://github.com/hejny/batch-project-editor/blob/main/src/workflows/810-contributing/contributing.ts so every manual change will be overwritten.-->
736
+
737
+ ## 🖋️ Contributing
738
+
739
+ I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [☕ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
740
+
741
+ You can also ⭐ star the promptbook package, [follow me on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).
742
+
743
+ <!--/Contributing-->
package/esm/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import colors from 'colors';
2
2
  import http from 'http';
3
3
  import { Server } from 'socket.io';
4
- import spaceTrim from 'spacetrim';
4
+ import { spaceTrim } from 'spacetrim';
5
5
 
6
6
  /*! *****************************************************************************
7
7
  Copyright (c) Microsoft Corporation.
@@ -89,7 +89,7 @@ var PromptbookExecutionError = /** @class */ (function (_super) {
89
89
  /**
90
90
  * The version of the Promptbook library
91
91
  */
92
- var PROMPTBOOK_VERSION = '0.44.0-8';
92
+ var PROMPTBOOK_VERSION = '0.44.0-23';
93
93
 
94
94
  /**
95
95
  * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/errors/PromptbookExecutionError.ts","../../../src/version.ts","../../../src/execution/plugins/natural-execution-tools/remote/startRemoteServer.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAA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AY,EAAE,OAAK,CAAC,OAAO,EAAoC,CAAC,CAAC;;;wBAExF,MAAM,CAAC,UAAU,EAAE,CAAC;;;;;aAE3B,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE;;YAEpB,IAAI,SAAS,EAAE;gBACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;aAC/D;SACJ,CAAC,CAAC;KACN,CAAC,CAAC;IAEH,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;IAGxB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,8CAAuC,IAAI,CAAE,CAAC,CAAC,CAAC;IAC5E,IAAI,SAAS,EAAE;QACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;KACzD;IAED,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,OAAO;QACH,IAAI,WAAW;YACX,OAAO,WAAW,CAAC;SACtB;QACD,OAAO;YACH,IAAI,WAAW,EAAE;gBACb,OAAO;aACV;YACD,WAAW,GAAG,IAAI,CAAC;YACnB,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,CAAC,KAAK,EAAE,CAAC;SAClB;KACJ,CAAC;AACN,CAAC;AAED;;;;;;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/errors/PromptbookExecutionError.ts","../../../src/version.ts","../../../src/execution/plugins/natural-execution-tools/remote/startRemoteServer.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;AAChC,IAAI,IAAI,OAAO,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CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,8CAAuC,IAAI,CAAE,CAAC,CAAC,CAAC;IAC5E,IAAI,SAAS,EAAE;QACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;KACzD;IAED,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,OAAO;QACH,IAAI,WAAW;YACX,OAAO,WAAW,CAAC;SACtB;QACD,OAAO;YACH,IAAI,WAAW,EAAE;gBACb,OAAO;aACV;YACD,WAAW,GAAG,IAAI,CAAC;YACnB,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,CAAC,KAAK,EAAE,CAAC;SAClB;KACJ,CAAC;AACN,CAAC;AAED;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import { spaceTrim } from 'spacetrim';
1
2
  import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
2
3
  import { parseNumber } from '../conversion/utils/parseNumber';
3
4
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
@@ -44,17 +45,18 @@ import { unwrapResult } from '../utils/unwrapResult';
44
45
  export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
45
46
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
46
47
  extractOneBlockFromMarkdown, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
47
- prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
+ prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
49
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
49
50
  export { splitIntoSentences };
50
51
  export declare const normalizeTo: {
51
52
  camelCase: typeof normalizeTo_camelCase;
52
53
  PascalCase: typeof normalizeTo_PascalCase;
53
- 'SCREAMING-CASE': typeof normalizeTo_SCREAMING_CASE;
54
+ SCREAMING_CASE: typeof normalizeTo_SCREAMING_CASE;
54
55
  snake_case: typeof normalizeTo_snake_case;
55
56
  'kebab-case': typeof normalizeToKebabCase;
56
57
  };
57
58
  export { capitalize, decapitalize, DIACRITIC_VARIANTS_LETTERS, IKeywords, isValidKeyword, nameToUriPart, nameToUriParts, normalizeTo_camelCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_snake_case, normalizeToKebabCase, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, };
58
59
  /**
59
60
  * TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
61
+ * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
60
62
  */
@@ -1,11 +1,15 @@
1
1
  import type { Expectations } from '../../../../types/PromptbookJson/PromptTemplateJson';
2
+ import { PostprocessingFunction } from '../../script-execution-tools/javascript/JavascriptExecutionToolsOptions';
2
3
  /**
3
4
  * Gets the expectations and creates a fake text that meets the expectations
4
5
  *
6
+ * Note: You can provide postprocessing functions to modify the text before checking the expectations
7
+ * The result will be the text BEFORE the postprocessing
8
+ *
5
9
  * @private internal util for MockedFackedNaturalExecutionTools
6
10
  */
7
- export declare function $fakeTextToExpectations(expectations: Expectations): string;
11
+ export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>;
8
12
  /**
9
- * TODO: Implement better
13
+ * TODO: Implement better - create FakeLLM from this
10
14
  * TODO: [💝] Unite object for expecting amount and format - use here also a format
11
15
  */
@@ -15,8 +15,12 @@ export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
15
15
  * Note: There are also some built-in functions available:
16
16
  * @see ./JavascriptEvalExecutionTools.ts
17
17
  */
18
- functions?: Record<string_javascript_name, ((value: string) => Promisable<string>) | Function>;
18
+ functions?: Record<string_javascript_name, PostprocessingFunction>;
19
19
  };
20
+ /**
21
+ * Function that can be used to postprocess the output of the LLM
22
+ */
23
+ export type PostprocessingFunction = ((value: string) => Promisable<string>) | Function;
20
24
  /**
21
25
  * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
22
26
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Converts anything to string that can be used for debugging and logging
3
+ *
4
+ * @param value String value for logging
5
+ * @private Internal util
6
+ */
7
+ export declare function unknownToString(value: unknown): string;
@@ -1,4 +1,5 @@
1
1
  import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';
2
+ import { PostprocessingFunction } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions';
2
3
  import type { ModelRequirements } from './ModelRequirements';
3
4
  import type { Expectations } from './PromptbookJson/PromptTemplateJson';
4
5
  /**
@@ -24,6 +25,10 @@ export type Prompt = {
24
25
  * Requirements for the model
25
26
  */
26
27
  readonly modelRequirements: ModelRequirements;
28
+ /**
29
+ * List of postprocessing steps that are executed after the prompt
30
+ */
31
+ readonly postprocessing?: Array<PostprocessingFunction>;
27
32
  /**
28
33
  * Expectations for the answer
29
34
  *
@@ -121,6 +121,7 @@ interface PromptTemplateJsonCommon {
121
121
  * Expect this format of the answer
122
122
  *
123
123
  * Note: Expectations are performed after all postprocessing steps
124
+ * @deprecated [💝]
124
125
  */
125
126
  readonly expectFormat?: ExpectFormatCommand['format'];
126
127
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.44.0-9",
3
+ "version": "0.44.0",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -28,7 +28,7 @@
28
28
  "text-generation",
29
29
  "language-model"
30
30
  ],
31
- "license": "SEE LICENSE IN LICENSE",
31
+ "license": "CC-BY-4.0",
32
32
  "bugs": {
33
33
  "url": "https://github.com/webgptorg/promptbook/issues"
34
34
  },
@@ -36,10 +36,10 @@
36
36
  "dependencies": {
37
37
  "colors": "1.4.0",
38
38
  "socket.io": "4.7.2",
39
- "spacetrim": "0.11.2"
39
+ "spacetrim": "0.11.20"
40
40
  },
41
41
  "peerDependencies": {
42
- "@promptbook/core": "0.44.0-9"
42
+ "@promptbook/core": "0.44.0"
43
43
  },
44
44
  "main": "./umd/index.umd.js",
45
45
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -1,14 +1,13 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('http'), require('socket.io'), require('spacetrim')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'colors', 'http', 'socket.io', 'spacetrim'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.colors, global.http, global.socket_io, global.spaceTrim));
5
- })(this, (function (exports, colors, http, socket_io, spaceTrim) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.colors, global.http, global.socket_io, global.spacetrim));
5
+ })(this, (function (exports, colors, http, socket_io, spacetrim) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
9
  var colors__default = /*#__PURE__*/_interopDefaultLegacy(colors);
10
10
  var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
11
- var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
12
11
 
13
12
  /*! *****************************************************************************
14
13
  Copyright (c) Microsoft Corporation.
@@ -96,7 +95,7 @@
96
95
  /**
97
96
  * The version of the Promptbook library
98
97
  */
99
- var PROMPTBOOK_VERSION = '0.44.0-8';
98
+ var PROMPTBOOK_VERSION = '0.44.0-23';
100
99
 
101
100
  /**
102
101
  * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
@@ -114,7 +113,7 @@
114
113
  if ((_a = request.url) === null || _a === void 0 ? void 0 : _a.includes('socket.io')) {
115
114
  return;
116
115
  }
117
- response.write(spaceTrim__default["default"]("\n Server for processing promptbook remote requests is running.\n\n Version: ".concat(PROMPTBOOK_VERSION, "\n\n For more information look at:\n https://github.com/webgptorg/promptbook\n\n ")));
116
+ response.write(spacetrim.spaceTrim("\n Server for processing promptbook remote requests is running.\n\n Version: ".concat(PROMPTBOOK_VERSION, "\n\n For more information look at:\n https://github.com/webgptorg/promptbook\n\n ")));
118
117
  response.end();
119
118
  });
120
119
  var server = new socket_io.Server(httpServer, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/errors/PromptbookExecutionError.ts","../../../src/version.ts","../../../src/execution/plugins/natural-execution-tools/remote/startRemoteServer.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null],"names":["http","spaceTrim","Server","colors"],"mappings":";;;;;;;;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;AACF;IACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;IAC7C,QAAQ,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;IAClG,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG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AU,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,CAAC,KAAK,EAAE,CAAC;aAClB;SACJ,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/errors/PromptbookExecutionError.ts","../../../src/version.ts","../../../src/execution/plugins/natural-execution-tools/remote/startRemoteServer.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null],"names":["http","spaceTrim","Server","colors"],"mappings":";;;;;;;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,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;;;4BAE/E,IAAI,EAAE,OAAK,YAAY,KAAK,CAAC,EAAE;gCAC3B,MAAM,OAAK,CAAC;6BACf;4BAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,OAAK,CAAC,OAAO,EAAoC,CAAC,CAAC;;;4BAExF,MAAM,CAAC,UAAU,EAAE,CAAC;;;;;iBAE3B,CAAC,CAAC;YAEH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE;;gBAEpB,IAAI,SAAS,EAAE;oBACX,OAAO,CAAC,IAAI,CAACA,0BAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;iBAC/D;aACJ,CAAC,CAAC;SACN,CAAC,CAAC;QAEH,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;QAGxB,OAAO,CAAC,IAAI,CAACA,0BAAM,CAAC,OAAO,CAAC,8CAAuC,IAAI,CAAE,CAAC,CAAC,CAAC;QAC5E,IAAI,SAAS,EAAE;YACX,OAAO,CAAC,IAAI,CAACA,0BAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;SACzD;QAED,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,OAAO;YACH,IAAI,WAAW;gBACX,OAAO,WAAW,CAAC;aACtB;YACD,OAAO;gBACH,IAAI,WAAW,EAAE;oBACb,OAAO;iBACV;gBACD,WAAW,GAAG,IAAI,CAAC;gBACnB,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,CAAC,KAAK,EAAE,CAAC;aAClB;SACJ,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import { spaceTrim } from 'spacetrim';
1
2
  import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
2
3
  import { parseNumber } from '../conversion/utils/parseNumber';
3
4
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
@@ -44,17 +45,18 @@ import { unwrapResult } from '../utils/unwrapResult';
44
45
  export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
45
46
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
46
47
  extractOneBlockFromMarkdown, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
47
- prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
+ prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
48
49
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
49
50
  export { splitIntoSentences };
50
51
  export declare const normalizeTo: {
51
52
  camelCase: typeof normalizeTo_camelCase;
52
53
  PascalCase: typeof normalizeTo_PascalCase;
53
- 'SCREAMING-CASE': typeof normalizeTo_SCREAMING_CASE;
54
+ SCREAMING_CASE: typeof normalizeTo_SCREAMING_CASE;
54
55
  snake_case: typeof normalizeTo_snake_case;
55
56
  'kebab-case': typeof normalizeToKebabCase;
56
57
  };
57
58
  export { capitalize, decapitalize, DIACRITIC_VARIANTS_LETTERS, IKeywords, isValidKeyword, nameToUriPart, nameToUriParts, normalizeTo_camelCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_snake_case, normalizeToKebabCase, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, };
58
59
  /**
59
60
  * TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
61
+ * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
60
62
  */
@@ -1,11 +1,15 @@
1
1
  import type { Expectations } from '../../../../types/PromptbookJson/PromptTemplateJson';
2
+ import { PostprocessingFunction } from '../../script-execution-tools/javascript/JavascriptExecutionToolsOptions';
2
3
  /**
3
4
  * Gets the expectations and creates a fake text that meets the expectations
4
5
  *
6
+ * Note: You can provide postprocessing functions to modify the text before checking the expectations
7
+ * The result will be the text BEFORE the postprocessing
8
+ *
5
9
  * @private internal util for MockedFackedNaturalExecutionTools
6
10
  */
7
- export declare function $fakeTextToExpectations(expectations: Expectations): string;
11
+ export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>;
8
12
  /**
9
- * TODO: Implement better
13
+ * TODO: Implement better - create FakeLLM from this
10
14
  * TODO: [💝] Unite object for expecting amount and format - use here also a format
11
15
  */
@@ -15,8 +15,12 @@ export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
15
15
  * Note: There are also some built-in functions available:
16
16
  * @see ./JavascriptEvalExecutionTools.ts
17
17
  */
18
- functions?: Record<string_javascript_name, ((value: string) => Promisable<string>) | Function>;
18
+ functions?: Record<string_javascript_name, PostprocessingFunction>;
19
19
  };
20
+ /**
21
+ * Function that can be used to postprocess the output of the LLM
22
+ */
23
+ export type PostprocessingFunction = ((value: string) => Promisable<string>) | Function;
20
24
  /**
21
25
  * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
22
26
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Converts anything to string that can be used for debugging and logging
3
+ *
4
+ * @param value String value for logging
5
+ * @private Internal util
6
+ */
7
+ export declare function unknownToString(value: unknown): string;
@@ -1,4 +1,5 @@
1
1
  import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';
2
+ import { PostprocessingFunction } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions';
2
3
  import type { ModelRequirements } from './ModelRequirements';
3
4
  import type { Expectations } from './PromptbookJson/PromptTemplateJson';
4
5
  /**
@@ -24,6 +25,10 @@ export type Prompt = {
24
25
  * Requirements for the model
25
26
  */
26
27
  readonly modelRequirements: ModelRequirements;
28
+ /**
29
+ * List of postprocessing steps that are executed after the prompt
30
+ */
31
+ readonly postprocessing?: Array<PostprocessingFunction>;
27
32
  /**
28
33
  * Expectations for the answer
29
34
  *
@@ -121,6 +121,7 @@ interface PromptTemplateJsonCommon {
121
121
  * Expect this format of the answer
122
122
  *
123
123
  * Note: Expectations are performed after all postprocessing steps
124
+ * @deprecated [💝]
124
125
  */
125
126
  readonly expectFormat?: ExpectFormatCommand['format'];
126
127
  /**