@promptbook/openai 0.103.0-43 โ†’ 0.103.0-44

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 (27) hide show
  1. package/README.md +6 -18
  2. package/esm/index.es.js +23 -9
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/types.index.d.ts +8 -0
  5. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +5 -0
  6. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -28
  7. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +61 -9
  8. package/esm/typings/src/errors/DatabaseError.d.ts +3 -0
  9. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  10. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  11. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +2 -1
  12. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  13. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  14. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  15. package/esm/typings/src/types/typeAliases.d.ts +19 -1
  16. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  17. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +5 -2
  18. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  19. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  20. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  21. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  22. package/esm/typings/src/utils/random/$randomToken.d.ts +1 -0
  23. package/esm/typings/src/version.d.ts +1 -1
  24. package/package.json +2 -2
  25. package/umd/index.umd.js +23 -9
  26. package/umd/index.umd.js.map +1 -1
  27. package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
package/README.md CHANGED
@@ -9,8 +9,8 @@ Turn your company's scattered knowledge into AI ready Books
9
9
 
10
10
 
11
11
 
12
- [![NPM Version of ![Promptbook logo - cube with letters P and B](./design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
13
- [![Quality of package ![Promptbook logo - cube with letters P and B](./design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
12
+ [![NPM Version of ![Promptbook logo](./design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
13
+ [![Quality of package ![Promptbook logo](./design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
14
14
  [![Known Vulnerabilities](https://snyk.io/test/github/webgptorg/promptbook/badge.svg)](https://snyk.io/test/github/webgptorg/promptbook)
15
15
  [![๐Ÿงช Test Books](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml)
16
16
  [![๐Ÿงช Test build](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml)
@@ -23,11 +23,7 @@ Turn your company's scattered knowledge into AI ready Books
23
23
 
24
24
  ## ๐ŸŒŸ New Features
25
25
 
26
- - ๐Ÿš€ **GPT-5 Support** - Now includes OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window
27
- - ๐Ÿ’ก VS Code support for `.book` files with syntax highlighting and IntelliSense
28
- - ๐Ÿณ Official Docker image (`hejny/promptbook`) for seamless containerized usage
29
- - ๐Ÿ”ฅ Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
30
- - ๐Ÿ” DeepSeek integration for advanced knowledge search
26
+ - **Gemini 3 Support**
31
27
 
32
28
 
33
29
 
@@ -432,7 +428,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
432
428
  Your job is to provide legal advice and support to the company and its employees.<br/>
433
429
  You are knowledgeable, professional, and detail-oriented.<br/>
434
430
  <br/>
435
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
431
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
436
432
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
437
433
 
438
434
  </td></tr></table>
@@ -454,7 +450,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
454
450
  **RULE** Always ensure compliance with laws and regulations.<br/>
455
451
  **RULE** Never provide legal advice outside your area of expertise.<br/>
456
452
  **RULE** Never provide legal advice about criminal law.<br/>
457
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
453
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
458
454
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
459
455
 
460
456
  </td></tr></table>
@@ -474,7 +470,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
474
470
  **RULE** Always ensure compliance with laws and regulations.<br/>
475
471
  **RULE** Never provide legal advice outside your area of expertise.<br/>
476
472
  **RULE** Never provide legal advice about criminal law.<br/>
477
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
473
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
478
474
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
479
475
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
480
476
 
@@ -525,14 +521,10 @@ Now you want to use it. There are several ways how to write your first book:
525
521
 
526
522
  We have written ai asistant in book who can help you with writing your first book.
527
523
 
528
-
529
-
530
524
  #### Your AI twin
531
525
 
532
526
  Copy your own behavior, personality, and knowledge into book and create your AI twin. It can help you with your work, personal life, or any other task.
533
527
 
534
-
535
-
536
528
  #### AI persona workpool
537
529
 
538
530
  Or you can pick from our library of pre-written books for various roles and tasks. You can find books for customer support, coding, marketing, sales, HR, legal, and many other roles.
@@ -652,8 +644,6 @@ Join our growing community of developers and users:
652
644
 
653
645
 
654
646
 
655
-
656
-
657
647
  ## ๐Ÿ“š Documentation
658
648
 
659
649
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -730,8 +720,6 @@ The following glossary is used to clarify certain concepts:
730
720
 
731
721
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
732
722
 
733
-
734
-
735
723
  ### ๐Ÿ’ฏ Core concepts
736
724
 
737
725
  - [๐Ÿ“š Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -13,14 +13,14 @@ import { io } from 'socket.io-client';
13
13
  * @generated
14
14
  * @see https://github.com/webgptorg/book
15
15
  */
16
- const BOOK_LANGUAGE_VERSION = '1.0.0';
16
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
17
17
  /**
18
18
  * The version of the Promptbook engine
19
19
  *
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-43';
23
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -115,6 +115,7 @@ function $randomToken(randomness) {
115
115
  return randomBytes(randomness).toString('hex');
116
116
  }
117
117
  /**
118
+ * TODO: [๐Ÿคถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
118
119
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
119
120
  */
120
121
 
@@ -2169,7 +2170,7 @@ function pricing(value) {
2169
2170
  /**
2170
2171
  * List of available OpenAI models with pricing
2171
2172
  *
2172
- * Note: Synced with official API docs at 2025-08-20
2173
+ * Note: Synced with official API docs at 2025-11-19
2173
2174
  *
2174
2175
  * @see https://platform.openai.com/docs/models/
2175
2176
  * @see https://openai.com/api/pricing/
@@ -2179,11 +2180,21 @@ const OPENAI_MODELS = exportJson({
2179
2180
  name: 'OPENAI_MODELS',
2180
2181
  value: [
2181
2182
  /**/
2183
+ {
2184
+ modelVariant: 'CHAT',
2185
+ modelTitle: 'gpt-5.1',
2186
+ modelName: 'gpt-5.1',
2187
+ modelDescription: 'The best model for coding and agentic tasks with configurable reasoning effort.',
2188
+ pricing: {
2189
+ prompt: pricing(`$1.25 / 1M tokens`),
2190
+ output: pricing(`$10.00 / 1M tokens`),
2191
+ },
2192
+ },
2182
2193
  {
2183
2194
  modelVariant: 'CHAT',
2184
2195
  modelTitle: 'gpt-5',
2185
2196
  modelName: 'gpt-5',
2186
- modelDescription: "OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window. Features revolutionary improvements in complex problem-solving, scientific reasoning, and creative tasks. Demonstrates human-level performance across diverse domains with enhanced safety measures and alignment. Represents the next generation of AI with superior understanding, nuanced responses, and advanced multimodal capabilities.",
2197
+ modelDescription: "OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window. Features revolutionary improvements in complex problem-solving, scientific reasoning, and creative tasks. Demonstrates human-level performance across diverse domains with enhanced safety measures and alignment. Represents the next generation of AI with superior understanding, nuanced responses, and advanced multimodal capabilities. DEPRECATED: Use gpt-5.1 instead.",
2187
2198
  pricing: {
2188
2199
  prompt: pricing(`$1.25 / 1M tokens`),
2189
2200
  output: pricing(`$10.00 / 1M tokens`),
@@ -3744,11 +3755,11 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
3744
3755
  if (!this.isCreatingNewAssistantsAllowed) {
3745
3756
  throw new NotAllowed(`Creating new assistants is not allowed. Set \`isCreatingNewAssistantsAllowed: true\` in options to enable this feature.`);
3746
3757
  }
3747
- await this.playground();
3758
+ // await this.playground();
3748
3759
  const { name, instructions } = options;
3749
3760
  const client = await this.getClient();
3750
- /*
3751
- TODO: !!!
3761
+ /*/
3762
+ //TODO: !!!
3752
3763
  async function downloadFile(url: string, folder = './tmp'): Promise<string> {
3753
3764
  const filename = path.basename(url.split('?')[0]);
3754
3765
  const filepath = path.join(folder, filename);
@@ -3792,8 +3803,8 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
3792
3803
  const file = await uploadFileToOpenAI(filepath);
3793
3804
  uploadedFiles.push(file.id);
3794
3805
  }
3795
- */
3796
- alert('!!!! Creating new OpenAI assistant');
3806
+ /**/
3807
+ // alert('!!!! Creating new OpenAI assistant');
3797
3808
  // 3๏ธโƒฃ Create assistant with uploaded files
3798
3809
  const assistant = await client.beta.assistants.create({
3799
3810
  name,
@@ -3929,6 +3940,9 @@ class DatabaseError extends Error {
3929
3940
  Object.setPrototypeOf(this, DatabaseError.prototype);
3930
3941
  }
3931
3942
  }
3943
+ /**
3944
+ * TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
3945
+ */
3932
3946
 
3933
3947
  /**
3934
3948
  * This error type indicates that you try to use a feature that is not available in the current environment