@promptbook/openai 0.35.1 → 0.36.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +1 -1
  2. package/esm/index.es.js +1 -1
  3. package/esm/typings/_packages/core.index.d.ts +8 -8
  4. package/esm/typings/_packages/remote-server.index.d.ts +2 -2
  5. package/esm/typings/_packages/types.index.d.ts +8 -8
  6. package/esm/typings/classes/PromptbookLibrary.d.ts +61 -0
  7. package/esm/typings/conversion/_importPromptbook.d.ts +12 -0
  8. package/esm/typings/conversion/promptbookStringToJson.d.ts +13 -0
  9. package/esm/typings/conversion/validatePromptbookJson.d.ts +26 -0
  10. package/{umd/typings/execution/PtpExecutor.d.ts → esm/typings/execution/PromptbookExecutor.d.ts} +5 -5
  11. package/esm/typings/execution/assertsExecutionSuccessful.d.ts +2 -2
  12. package/esm/typings/execution/createPromptbookExecutor.d.ts +40 -0
  13. package/esm/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +1 -1
  14. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +1 -1
  15. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +1 -1
  16. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +1 -1
  17. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Error.d.ts → Promptbook_Server_Error.d.ts} +1 -1
  18. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Progress.d.ts → Promptbook_Server_Progress.d.ts} +1 -1
  19. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Request.d.ts → Promptbook_Server_Request.d.ts} +2 -2
  20. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Response.d.ts → Promptbook_Server_Response.d.ts} +2 -2
  21. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +3 -3
  22. package/{umd/typings/execution/plugins/natural-execution-tools/remote/runRemoteServer.d.ts → esm/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts} +2 -2
  23. package/esm/typings/types/Command.d.ts +12 -12
  24. package/esm/typings/types/Parameters.d.ts +3 -3
  25. package/esm/typings/types/Prompt.d.ts +5 -5
  26. package/{umd/typings/types/PromptTemplatePipelineJson → esm/typings/types/PromptbookJson}/PromptTemplateJson.d.ts +4 -4
  27. package/esm/typings/types/{PromptTemplatePipelineJson → PromptbookJson}/PromptTemplateParameterJson.d.ts +2 -2
  28. package/{umd/typings/types/PromptTemplatePipelineJson/PromptTemplatePipelineJson.d.ts → esm/typings/types/PromptbookJson/PromptbookJson.d.ts} +11 -15
  29. package/esm/typings/types/PromptbookString.d.ts +12 -0
  30. package/esm/typings/types/TaskProgress.d.ts +1 -1
  31. package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +10 -10
  32. package/esm/typings/types/typeAliases.d.ts +4 -4
  33. package/esm/typings/utils/expectation-counters/countCharacters.d.ts +1 -1
  34. package/esm/typings/utils/expectation-counters/countLines.d.ts +1 -1
  35. package/esm/typings/utils/expectation-counters/countPages.d.ts +1 -1
  36. package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +1 -1
  37. package/esm/typings/utils/expectation-counters/countSentences.d.ts +1 -1
  38. package/esm/typings/utils/expectation-counters/countWords.d.ts +1 -1
  39. package/esm/typings/utils/expectation-counters/index.d.ts +1 -1
  40. package/esm/typings/utils/isRunningInWhatever.d.ts +12 -0
  41. package/esm/typings/version.d.ts +1 -1
  42. package/package.json +2 -2
  43. package/umd/index.umd.js +1 -1
  44. package/umd/typings/_packages/core.index.d.ts +8 -8
  45. package/umd/typings/_packages/remote-server.index.d.ts +2 -2
  46. package/umd/typings/_packages/types.index.d.ts +8 -8
  47. package/umd/typings/classes/PromptbookLibrary.d.ts +61 -0
  48. package/umd/typings/conversion/_importPromptbook.d.ts +12 -0
  49. package/umd/typings/conversion/promptbookStringToJson.d.ts +13 -0
  50. package/umd/typings/conversion/validatePromptbookJson.d.ts +26 -0
  51. package/{esm/typings/execution/PtpExecutor.d.ts → umd/typings/execution/PromptbookExecutor.d.ts} +5 -5
  52. package/umd/typings/execution/assertsExecutionSuccessful.d.ts +2 -2
  53. package/umd/typings/execution/createPromptbookExecutor.d.ts +40 -0
  54. package/umd/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +1 -1
  55. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +1 -1
  56. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +1 -1
  57. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +1 -1
  58. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Error.d.ts → Promptbook_Server_Error.d.ts} +1 -1
  59. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Progress.d.ts → Promptbook_Server_Progress.d.ts} +1 -1
  60. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Request.d.ts → Promptbook_Server_Request.d.ts} +2 -2
  61. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/{Ptps_Response.d.ts → Promptbook_Server_Response.d.ts} +2 -2
  62. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +3 -3
  63. package/{esm/typings/execution/plugins/natural-execution-tools/remote/runRemoteServer.d.ts → umd/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts} +2 -2
  64. package/umd/typings/types/Command.d.ts +12 -12
  65. package/umd/typings/types/Parameters.d.ts +3 -3
  66. package/umd/typings/types/Prompt.d.ts +5 -5
  67. package/{esm/typings/types/PromptTemplatePipelineJson → umd/typings/types/PromptbookJson}/PromptTemplateJson.d.ts +4 -4
  68. package/umd/typings/types/{PromptTemplatePipelineJson → PromptbookJson}/PromptTemplateParameterJson.d.ts +2 -2
  69. package/{esm/typings/types/PromptTemplatePipelineJson/PromptTemplatePipelineJson.d.ts → umd/typings/types/PromptbookJson/PromptbookJson.d.ts} +11 -15
  70. package/umd/typings/types/PromptbookString.d.ts +12 -0
  71. package/umd/typings/types/TaskProgress.d.ts +1 -1
  72. package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +10 -10
  73. package/umd/typings/types/typeAliases.d.ts +4 -4
  74. package/umd/typings/utils/expectation-counters/countCharacters.d.ts +1 -1
  75. package/umd/typings/utils/expectation-counters/countLines.d.ts +1 -1
  76. package/umd/typings/utils/expectation-counters/countPages.d.ts +1 -1
  77. package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +1 -1
  78. package/umd/typings/utils/expectation-counters/countSentences.d.ts +1 -1
  79. package/umd/typings/utils/expectation-counters/countWords.d.ts +1 -1
  80. package/umd/typings/utils/expectation-counters/index.d.ts +1 -1
  81. package/umd/typings/utils/isRunningInWhatever.d.ts +12 -0
  82. package/umd/typings/version.d.ts +1 -1
  83. package/esm/typings/classes/PromptTemplatePipelineLibrary.d.ts +0 -71
  84. package/esm/typings/config.d.ts +0 -12
  85. package/esm/typings/conversion/_importPtp.d.ts +0 -12
  86. package/esm/typings/conversion/promptTemplatePipelineStringToJson.d.ts +0 -13
  87. package/esm/typings/conversion/validatePromptTemplatePipelineJson.d.ts +0 -26
  88. package/esm/typings/execution/createPtpExecutor.d.ts +0 -40
  89. package/esm/typings/types/PromptTemplatePipelineString.d.ts +0 -16
  90. package/umd/typings/classes/PromptTemplatePipelineLibrary.d.ts +0 -71
  91. package/umd/typings/config.d.ts +0 -12
  92. package/umd/typings/conversion/_importPtp.d.ts +0 -12
  93. package/umd/typings/conversion/promptTemplatePipelineStringToJson.d.ts +0 -13
  94. package/umd/typings/conversion/validatePromptTemplatePipelineJson.d.ts +0 -26
  95. package/umd/typings/execution/createPtpExecutor.d.ts +0 -40
  96. package/umd/typings/types/PromptTemplatePipelineString.d.ts +0 -16
  97. /package/esm/typings/conversion/{promptTemplatePipelineStringToJson-syntaxErrors.test.d.ts → promptbookStringToJson-syntaxErrors.test.d.ts} +0 -0
  98. /package/esm/typings/conversion/{promptTemplatePipelineStringToJson.test.d.ts → promptbookStringToJson.test.d.ts} +0 -0
  99. /package/esm/typings/conversion/{validatePromptTemplatePipelineJson-logicErrors.test.d.ts → validatePromptbookJson-logicErrors.test.d.ts} +0 -0
  100. /package/esm/typings/conversion/{validatePromptTemplatePipelineJson.test.d.ts → validatePromptbookJson.test.d.ts} +0 -0
  101. /package/umd/typings/conversion/{promptTemplatePipelineStringToJson-syntaxErrors.test.d.ts → promptbookStringToJson-syntaxErrors.test.d.ts} +0 -0
  102. /package/umd/typings/conversion/{promptTemplatePipelineStringToJson.test.d.ts → promptbookStringToJson.test.d.ts} +0 -0
  103. /package/umd/typings/conversion/{validatePromptTemplatePipelineJson-logicErrors.test.d.ts → validatePromptbookJson-logicErrors.test.d.ts} +0 -0
  104. /package/umd/typings/conversion/{validatePromptTemplatePipelineJson.test.d.ts → validatePromptbookJson.test.d.ts} +0 -0
@@ -1,40 +0,0 @@
1
- import { PromptTemplatePipelineJson } from '../_packages/types.index';
2
- import { ExecutionTools } from './ExecutionTools';
3
- import { PtpExecutor } from './PtpExecutor';
4
- export interface CreatePtpExecutorSettings {
5
- /**
6
- * When executor does not satisfy expectations it will be retried this amount of times
7
- *
8
- * @default 3
9
- */
10
- readonly maxExecutionAttempts: number;
11
- }
12
- /**
13
- * Options for creating a PTP (Prompt Template Pipeline) executor
14
- */
15
- interface CreatePtpExecutorOptions {
16
- /**
17
- * The Prompt Template Pipeline (PTP) to be executed
18
- */
19
- readonly ptp: PromptTemplatePipelineJson;
20
- /**
21
- * The execution tools to be used during the execution of the PTP
22
- */
23
- readonly tools: ExecutionTools;
24
- /**
25
- * Optional settings for the PTP executor
26
- */
27
- readonly settings?: Partial<CreatePtpExecutorSettings>;
28
- }
29
- /**
30
- * Creates executor function from prompt template pipeline and execution tools.
31
- *
32
- * Note: Consider using getExecutor method of the library instead of using this function
33
- */
34
- export declare function createPtpExecutor(options: CreatePtpExecutorOptions): PtpExecutor;
35
- export {};
36
- /**
37
- * TODO: [🧠] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
38
- * TODO: [👧] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
39
- * Note: CreatePtpExecutorOptions are just connected to PtpExecutor so do not extract to types folder
40
- */
@@ -1,16 +0,0 @@
1
- /**
2
- * Prompt template pipeline is the **core concept of this library**.
3
- * It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
4
- *
5
- * It can have 3 formats:
6
- * - _(this)_ **.ptbk.md file** in custom markdown format described above
7
- * - **JSON** format, parsed from the .ptbk.md file
8
- *
9
- * @see https://github.com/webgptorg/promptbook#prompt-template-pipeline
10
- */
11
- export type PromptTemplatePipelineString = string & {
12
- readonly _type: 'PromptTemplatePipeline';
13
- };
14
- /**
15
- * TODO: !! Better validation (validatePromptTemplatePipelineString) or remove branded type and make it just string
16
- */