@promptbook/openai 0.72.0-33 → 0.72.0-34

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
@@ -228,15 +228,15 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
228
228
 
229
229
 
230
230
 
231
- If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
231
+ If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 3, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
232
232
 
233
- But often you will struggle with the limitations of LLMs, such as hallucinations, off-topic responses, poor quality output, language drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses. When this happens, you generally have three options:
233
+ But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses**. When this happens, you generally have three options:
234
234
 
235
235
  1. **Fine-tune** the model to your specifications or even train your own.
236
236
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
237
237
  3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
238
238
 
239
- In all of these situations, but especially in 3., the Promptbook library can make your life easier.
239
+ In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
240
240
 
241
241
  - [**Separates concerns**](https://github.com/webgptorg/promptbook/discussions/32) between prompt-engineer and programmer, between code files and prompt files, and between prompts and their execution logic.
242
242
  - Establishes a [**common format `.ptbk.md`**](https://github.com/webgptorg/promptbook/discussions/85) that can be used to describe your prompt business logic without having to write code or deal with the technicalities of LLMs.
package/esm/index.es.js CHANGED
@@ -6,7 +6,7 @@ import OpenAI from 'openai';
6
6
  /**
7
7
  * The version of the Promptbook library
8
8
  */
9
- var PROMPTBOOK_VERSION = '0.72.0-32';
9
+ var PROMPTBOOK_VERSION = '0.72.0-33';
10
10
  // TODO: [main] !!!! List here all the versions and annotate + put into script
11
11
 
12
12
  /*! *****************************************************************************
@@ -1850,11 +1850,11 @@ var OpenAiAssistantExecutionTools = /** @class */ (function (_super) {
1850
1850
  assistant_id: this.assistantId,
1851
1851
  thread: {
1852
1852
  messages: [
1853
- // TODO: [🗯] !!!!!! Allow threads to be passed
1853
+ // TODO: [🗯] !! Allow threads to be passed
1854
1854
  { role: 'user', content: rawPromptContent },
1855
1855
  ],
1856
1856
  },
1857
- // !!!!!! user: this.options.user,
1857
+ // <- TODO: Add user identification here> user: this.options.user,
1858
1858
  };
1859
1859
  start = getCurrentIsoDate();
1860
1860
  if (this.options.isVerbose) {
@@ -1905,7 +1905,7 @@ var OpenAiAssistantExecutionTools = /** @class */ (function (_super) {
1905
1905
  throw new PipelineExecutionError("There is NOT 'text' BUT ".concat((_b = rawResponse[0].content[0]) === null || _b === void 0 ? void 0 : _b.type, " finalMessages content type from OpenAI"));
1906
1906
  }
1907
1907
  resultContent = (_c = rawResponse[0].content[0]) === null || _c === void 0 ? void 0 : _c.text.value;
1908
- // <- TODO: !!!!!! There are also annotations, maybe use them
1908
+ // <- TODO: [🧠] There are also annotations, maybe use them
1909
1909
  // eslint-disable-next-line prefer-const
1910
1910
  complete = getCurrentIsoDate();
1911
1911
  usage = UNCERTAIN_USAGE;
@@ -4,7 +4,7 @@ import type { string_executable_path } from '../../types/typeAliases';
4
4
  *
5
5
  * @private within the repository
6
6
  */
7
- export declare function locateLibreoffice(): Promise<string_executable_path>;
7
+ export declare function locateLibreoffice(): Promise<string_executable_path | null>;
8
8
  /**
9
9
  * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
10
10
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -4,7 +4,7 @@ import type { string_executable_path } from '../../types/typeAliases';
4
4
  *
5
5
  * @private within the repository
6
6
  */
7
- export declare function locatePandoc(): Promise<string_executable_path>;
7
+ export declare function locatePandoc(): Promise<string_executable_path | null>;
8
8
  /**
9
9
  * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
10
10
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -26,7 +26,7 @@ export interface LocateAppOptions {
26
26
  *
27
27
  * @private within the repository
28
28
  */
29
- export declare function locateApp(options: RequireAtLeastOne<LocateAppOptions, 'linuxWhich' | 'windowsSuffix' | 'macOsName'>): Promise<string_executable_path>;
29
+ export declare function locateApp(options: RequireAtLeastOne<LocateAppOptions, 'linuxWhich' | 'windowsSuffix' | 'macOsName'>): Promise<string_executable_path | null>;
30
30
  /**
31
31
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
32
32
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -1,11 +1,11 @@
1
- import type { LocateAppOptions } from '../locateApp';
2
1
  import type { string_executable_path } from '../../types/typeAliases';
2
+ import type { LocateAppOptions } from '../locateApp';
3
3
  /**
4
4
  * @@@
5
5
  *
6
6
  * @private within the repository
7
7
  */
8
- export declare function locateAppOnLinux({ appName, linuxWhich, }: Pick<Required<LocateAppOptions>, 'appName' | 'linuxWhich'>): Promise<string_executable_path>;
8
+ export declare function locateAppOnLinux({ appName, linuxWhich, }: Pick<Required<LocateAppOptions>, 'appName' | 'linuxWhich'>): Promise<string_executable_path | null>;
9
9
  /**
10
10
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -5,7 +5,7 @@ import type { LocateAppOptions } from '../locateApp';
5
5
  *
6
6
  * @private within the repository
7
7
  */
8
- export declare function locateAppOnMacOs({ appName, macOsName, }: Pick<Required<LocateAppOptions>, 'appName' | 'macOsName'>): Promise<string_executable_path>;
8
+ export declare function locateAppOnMacOs({ appName, macOsName, }: Pick<Required<LocateAppOptions>, 'appName' | 'macOsName'>): Promise<string_executable_path | null>;
9
9
  /**
10
10
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -5,7 +5,7 @@ import type { LocateAppOptions } from '../locateApp';
5
5
  *
6
6
  * @private within the repository
7
7
  */
8
- export declare function locateAppOnWindows({ appName, windowsSuffix, }: Pick<Required<LocateAppOptions>, 'appName' | 'windowsSuffix'>): Promise<string_executable_path>;
8
+ export declare function locateAppOnWindows({ appName, windowsSuffix, }: Pick<Required<LocateAppOptions>, 'appName' | 'windowsSuffix'>): Promise<string_executable_path | null>;
9
9
  /**
10
10
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.72.0-33",
3
+ "version": "0.72.0-34",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -52,7 +52,7 @@
52
52
  "module": "./esm/index.es.js",
53
53
  "typings": "./esm/typings/src/_packages/openai.index.d.ts",
54
54
  "peerDependencies": {
55
- "@promptbook/core": "0.72.0-33"
55
+ "@promptbook/core": "0.72.0-34"
56
56
  },
57
57
  "dependencies": {
58
58
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * The version of the Promptbook library
16
16
  */
17
- var PROMPTBOOK_VERSION = '0.72.0-32';
17
+ var PROMPTBOOK_VERSION = '0.72.0-33';
18
18
  // TODO: [main] !!!! List here all the versions and annotate + put into script
19
19
 
20
20
  /*! *****************************************************************************
@@ -1858,11 +1858,11 @@
1858
1858
  assistant_id: this.assistantId,
1859
1859
  thread: {
1860
1860
  messages: [
1861
- // TODO: [🗯] !!!!!! Allow threads to be passed
1861
+ // TODO: [🗯] !! Allow threads to be passed
1862
1862
  { role: 'user', content: rawPromptContent },
1863
1863
  ],
1864
1864
  },
1865
- // !!!!!! user: this.options.user,
1865
+ // <- TODO: Add user identification here> user: this.options.user,
1866
1866
  };
1867
1867
  start = getCurrentIsoDate();
1868
1868
  if (this.options.isVerbose) {
@@ -1913,7 +1913,7 @@
1913
1913
  throw new PipelineExecutionError("There is NOT 'text' BUT ".concat((_b = rawResponse[0].content[0]) === null || _b === void 0 ? void 0 : _b.type, " finalMessages content type from OpenAI"));
1914
1914
  }
1915
1915
  resultContent = (_c = rawResponse[0].content[0]) === null || _c === void 0 ? void 0 : _c.text.value;
1916
- // <- TODO: !!!!!! There are also annotations, maybe use them
1916
+ // <- TODO: [🧠] There are also annotations, maybe use them
1917
1917
  // eslint-disable-next-line prefer-const
1918
1918
  complete = getCurrentIsoDate();
1919
1919
  usage = UNCERTAIN_USAGE;