@promptbook/openai 0.94.0-7 → 0.95.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 +10 -23
- package/esm/index.es.js +40 -45
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +2 -2
- package/esm/typings/src/_packages/{wizzard.index.d.ts → wizard.index.d.ts} +2 -2
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -1
- package/esm/typings/src/conversion/archive/loadArchive.d.ts +1 -1
- package/esm/typings/src/conversion/archive/saveArchive.d.ts +2 -2
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +1 -1
- package/esm/typings/src/dialogs/callback/CallbackInterfaceTools.d.ts +1 -1
- package/esm/typings/src/execution/AbstractTaskResult.d.ts +2 -2
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +1 -1
- package/esm/typings/src/execution/execution-report/ExecutionPromptReportJson.d.ts +2 -2
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/{$provideLlmToolsForWizzardOrCli.d.ts → $provideLlmToolsForWizardOrCli.d.ts} +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -1
- package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -1
- package/esm/typings/src/llm-providers/ollama/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/ollama/register-constructor.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
- package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +1 -1
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +2 -2
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +2 -2
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -4
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +2 -2
- package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/markitdown/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +2 -2
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +2 -2
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -1
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +2 -2
- package/esm/typings/src/types/typeAliases.d.ts +1 -1
- package/esm/typings/src/utils/files/listAllFiles.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/{wizzard → wizard}/$getCompiledBook.d.ts +2 -2
- package/esm/typings/src/{wizzard/wizzard.d.ts → wizard/wizard.d.ts} +6 -6
- package/package.json +25 -14
- package/umd/index.umd.js +40 -45
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -25,10 +25,6 @@ Write AI applications using plain human language across multiple models and plat
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
<blockquote style="color: #ff8811">
|
|
29
|
-
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
30
|
-
</blockquote>
|
|
31
|
-
|
|
32
28
|
## 📦 Package `@promptbook/openai`
|
|
33
29
|
|
|
34
30
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -112,11 +108,11 @@ console.info(outputParameters);
|
|
|
112
108
|
Run books without any settings, boilerplate or struggle in Node.js:
|
|
113
109
|
|
|
114
110
|
```typescript
|
|
115
|
-
import {
|
|
111
|
+
import { wizard } from '@promptbook/wizard';
|
|
116
112
|
|
|
117
113
|
const {
|
|
118
114
|
outputParameters: { joke },
|
|
119
|
-
} = await
|
|
115
|
+
} = await wizard.execute(`https://github.com/webgptorg/book/blob/main/books/templates/generic.book`, {
|
|
120
116
|
topic: 'Prague',
|
|
121
117
|
});
|
|
122
118
|
|
|
@@ -259,17 +255,15 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
259
255
|
|
|
260
256
|
## 🤍 The Book Abstract
|
|
261
257
|
|
|
262
|
-
**It's time for a paradigm shift! The future of software is in plain English, French or Latin.**
|
|
258
|
+
**It's time for a paradigm shift! The future of software is written in plain English, French, or Latin.**
|
|
263
259
|
|
|
264
260
|
During the computer revolution, we have seen [multiple generations of computer languages](https://github.com/webgptorg/promptbook/discussions/180), from the physical rewiring of the vacuum tubes through low-level machine code to the high-level languages like Python or JavaScript. And now, we're on the edge of the **next revolution**!
|
|
265
261
|
|
|
266
|
-
|
|
267
|
-
|
|
268
262
|
It's a revolution of writing software in **plain human language** that is understandable and executable by both humans and machines – and it's going to change everything!
|
|
269
263
|
|
|
270
264
|
The incredible growth in power of microprocessors and the Moore's Law have been the driving force behind the ever-more powerful languages, and it's been an amazing journey! Similarly, the large language models (like GPT or Claude) are the next big thing in language technology, and they're set to transform the way we interact with computers.
|
|
271
265
|
|
|
272
|
-
This shift
|
|
266
|
+
This shift will happen whether we're ready or not. Our mission is to make it excellent, not just good.
|
|
273
267
|
|
|
274
268
|
**Join us in this journey!**
|
|
275
269
|
|
|
@@ -390,9 +384,6 @@ Join our growing community of developers and users:
|
|
|
390
384
|
|
|
391
385
|
_A concise, Markdown-based DSL for crafting AI workflows and automations._
|
|
392
386
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
387
|
### Introduction
|
|
397
388
|
|
|
398
389
|
Book is a Markdown-based language that simplifies the creation of AI applications, workflows, and automations. With human-readable commands, you can define inputs, outputs, personas, knowledge sources, and actions—without needing model-specific details.
|
|
@@ -420,7 +411,7 @@ Book is a Markdown-based language that simplifies the creation of AI application
|
|
|
420
411
|
→ {article}
|
|
421
412
|
```
|
|
422
413
|
|
|
423
|
-
Each part of the book defines one of
|
|
414
|
+
Each part of the book defines one of three circles:
|
|
424
415
|
|
|
425
416
|
### **1. What:** Workflows, Tasks and Parameters
|
|
426
417
|
|
|
@@ -442,8 +433,6 @@ Personas can have access to different knowledge, tools and actions. They can als
|
|
|
442
433
|
|
|
443
434
|
- [PERSONA](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PERSONA.md)
|
|
444
435
|
|
|
445
|
-
|
|
446
|
-
|
|
447
436
|
### **3. How:** Knowledge, Instruments and Actions
|
|
448
437
|
|
|
449
438
|
The resources used by the personas are used to do the work.
|
|
@@ -458,9 +447,9 @@ The resources used by the personas are used to do the work.
|
|
|
458
447
|
|
|
459
448
|
Book language is based on markdown. It is subset of markdown. It is designed to be easy to read and write. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
|
|
460
449
|
|
|
461
|
-
The file has `.book` extension
|
|
450
|
+
The file has a `.book` extension and uses UTF-8 encoding without BOM.
|
|
462
451
|
|
|
463
|
-
|
|
452
|
+
Books have two variants: flat — just a prompt without structure, and full — with tasks, commands, and prompts.
|
|
464
453
|
|
|
465
454
|
As it is source code, it can leverage all the features of version control systems like git and does not suffer from the problems of binary formats, proprietary formats, or no-code solutions.
|
|
466
455
|
|
|
@@ -491,13 +480,13 @@ Or you can install them separately:
|
|
|
491
480
|
|
|
492
481
|
- ⭐ **[ptbk](https://www.npmjs.com/package/ptbk)** - Bundle of all packages, when you want to install everything and you don't care about the size
|
|
493
482
|
- **[promptbook](https://www.npmjs.com/package/promptbook)** - Same as `ptbk`
|
|
494
|
-
- ⭐🧙♂️ **[@promptbook/
|
|
483
|
+
- ⭐🧙♂️ **[@promptbook/wizard](https://www.npmjs.com/package/@promptbook/wizard)** - Wizard to just run the books in node without any struggle
|
|
495
484
|
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
496
485
|
- **[@promptbook/node](https://www.npmjs.com/package/@promptbook/node)** - Core of the library for Node.js environment
|
|
497
486
|
- **[@promptbook/browser](https://www.npmjs.com/package/@promptbook/browser)** - Core of the library for browser environment
|
|
498
487
|
- ⭐ **[@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
|
|
499
488
|
- **[@promptbook/markdown-utils](https://www.npmjs.com/package/@promptbook/markdown-utils)** - Utility functions used for processing markdown
|
|
500
|
-
- _(Not finished)_ **[@promptbook/
|
|
489
|
+
- _(Not finished)_ **[@promptbook/wizard](https://www.npmjs.com/package/@promptbook/wizard)** - Wizard for creating+running promptbooks in single line
|
|
501
490
|
- **[@promptbook/javascript](https://www.npmjs.com/package/@promptbook/javascript)** - Execution tools for javascript inside promptbooks
|
|
502
491
|
- **[@promptbook/openai](https://www.npmjs.com/package/@promptbook/openai)** - Execution tools for OpenAI API, wrapper around OpenAI SDK
|
|
503
492
|
- **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
|
|
@@ -541,9 +530,7 @@ The following glossary is used to clarify certain concepts:
|
|
|
541
530
|
- **Retrieval-augmented generation** is a machine learning paradigm where a model generates text by retrieving relevant information from a large database of text. This approach combines the benefits of generative models and retrieval models.
|
|
542
531
|
- **Longtail** refers to non-common or rare events, items, or entities that are not well-represented in the training data of machine learning models. Longtail items are often challenging for models to predict accurately.
|
|
543
532
|
|
|
544
|
-
_Note: This section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
545
|
-
|
|
546
|
-
|
|
533
|
+
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
547
534
|
|
|
548
535
|
### 💯 Core concepts
|
|
549
536
|
|
package/esm/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.95.0';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -514,7 +514,7 @@ function checkSerializableAsJson(options) {
|
|
|
514
514
|
else {
|
|
515
515
|
for (const [subName, subValue] of Object.entries(value)) {
|
|
516
516
|
if (subValue === undefined) {
|
|
517
|
-
// Note: undefined in object is serializable - it is just
|
|
517
|
+
// Note: undefined in object is serializable - it is just omitted
|
|
518
518
|
continue;
|
|
519
519
|
}
|
|
520
520
|
checkSerializableAsJson({ name: `${name}.${subName}`, value: subValue, message });
|
|
@@ -1295,7 +1295,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1295
1295
|
modelVariant: 'COMPLETION',
|
|
1296
1296
|
modelTitle: 'davinci-002',
|
|
1297
1297
|
modelName: 'davinci-002',
|
|
1298
|
-
modelDescription: 'Legacy completion model with
|
|
1298
|
+
modelDescription: 'Legacy completion model with 4K token context window. Excels at complex text generation, creative writing, and detailed content creation with strong contextual understanding. Optimized for instructions requiring nuanced outputs and extended reasoning. Suitable for applications needing high-quality text generation without conversation management.',
|
|
1299
1299
|
pricing: {
|
|
1300
1300
|
prompt: pricing(`$2.00 / 1M tokens`),
|
|
1301
1301
|
output: pricing(`$2.00 / 1M tokens`),
|
|
@@ -1313,7 +1313,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1313
1313
|
modelVariant: 'CHAT',
|
|
1314
1314
|
modelTitle: 'gpt-3.5-turbo-16k',
|
|
1315
1315
|
modelName: 'gpt-3.5-turbo-16k',
|
|
1316
|
-
modelDescription: 'GPT-3.5 Turbo with
|
|
1316
|
+
modelDescription: 'Extended context GPT-3.5 Turbo with 16K token window. Maintains core capabilities of standard 3.5 Turbo while supporting longer conversations and documents. Features good balance of performance and cost for applications requiring more context than standard 4K models. Effective for document analysis, extended conversations, and multi-step reasoning tasks.',
|
|
1317
1317
|
pricing: {
|
|
1318
1318
|
prompt: pricing(`$3.00 / 1M tokens`),
|
|
1319
1319
|
output: pricing(`$4.00 / 1M tokens`),
|
|
@@ -1337,7 +1337,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1337
1337
|
modelVariant: 'CHAT',
|
|
1338
1338
|
modelTitle: 'gpt-4',
|
|
1339
1339
|
modelName: 'gpt-4',
|
|
1340
|
-
modelDescription: '
|
|
1340
|
+
modelDescription: 'Powerful language model with 8K context window featuring sophisticated reasoning, instruction-following, and knowledge capabilities. Demonstrates strong performance on complex tasks requiring deep understanding and multi-step reasoning. Excels at code generation, logical analysis, and nuanced content creation. Suitable for advanced applications requiring high-quality outputs.',
|
|
1341
1341
|
pricing: {
|
|
1342
1342
|
prompt: pricing(`$30.00 / 1M tokens`),
|
|
1343
1343
|
output: pricing(`$60.00 / 1M tokens`),
|
|
@@ -1349,7 +1349,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1349
1349
|
modelVariant: 'CHAT',
|
|
1350
1350
|
modelTitle: 'gpt-4-32k',
|
|
1351
1351
|
modelName: 'gpt-4-32k',
|
|
1352
|
-
modelDescription: 'Extended context version of GPT-4 with
|
|
1352
|
+
modelDescription: 'Extended context version of GPT-4 with 32K token window. Maintains all capabilities of standard GPT-4 while supporting analysis of very lengthy documents, code bases, and conversations. Features enhanced ability to maintain context over long interactions and process detailed information from large inputs. Ideal for document analysis, legal review, and complex problem-solving.',
|
|
1353
1353
|
pricing: {
|
|
1354
1354
|
prompt: pricing(`$60.00 / 1M tokens`),
|
|
1355
1355
|
output: pricing(`$120.00 / 1M tokens`),
|
|
@@ -1372,7 +1372,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1372
1372
|
modelVariant: 'CHAT',
|
|
1373
1373
|
modelTitle: 'gpt-4-turbo-2024-04-09',
|
|
1374
1374
|
modelName: 'gpt-4-turbo-2024-04-09',
|
|
1375
|
-
modelDescription: 'Latest stable GPT-4 Turbo
|
|
1375
|
+
modelDescription: 'Latest stable GPT-4 Turbo from April 2024 with 128K context window. Features enhanced reasoning chains, improved factual accuracy with 40% reduction in hallucinations, and better instruction following compared to earlier versions. Includes advanced function calling capabilities and knowledge up to April 2024. Provides optimal performance for enterprise applications requiring reliability.',
|
|
1376
1376
|
pricing: {
|
|
1377
1377
|
prompt: pricing(`$10.00 / 1M tokens`),
|
|
1378
1378
|
output: pricing(`$30.00 / 1M tokens`),
|
|
@@ -1384,7 +1384,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1384
1384
|
modelVariant: 'CHAT',
|
|
1385
1385
|
modelTitle: 'gpt-3.5-turbo-1106',
|
|
1386
1386
|
modelName: 'gpt-3.5-turbo-1106',
|
|
1387
|
-
modelDescription: 'November 2023 version of GPT-3.5 Turbo with improved instruction following and
|
|
1387
|
+
modelDescription: 'November 2023 version of GPT-3.5 Turbo with 16K token context window. Features improved instruction following, more consistent output formatting, and enhanced function calling capabilities. Includes knowledge cutoff from April 2023. Suitable for applications requiring good performance at lower cost than GPT-4 models.',
|
|
1388
1388
|
pricing: {
|
|
1389
1389
|
prompt: pricing(`$1.00 / 1M tokens`),
|
|
1390
1390
|
output: pricing(`$2.00 / 1M tokens`),
|
|
@@ -1396,7 +1396,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1396
1396
|
modelVariant: 'CHAT',
|
|
1397
1397
|
modelTitle: 'gpt-4-turbo',
|
|
1398
1398
|
modelName: 'gpt-4-turbo',
|
|
1399
|
-
modelDescription: 'More capable
|
|
1399
|
+
modelDescription: 'More capable and cost-efficient version of GPT-4 with 128K token context window. Features improved instruction following, advanced function calling capabilities, and better performance on coding tasks. Maintains superior reasoning and knowledge while offering substantial cost reduction compared to base GPT-4. Ideal for complex applications requiring extensive context processing.',
|
|
1400
1400
|
pricing: {
|
|
1401
1401
|
prompt: pricing(`$10.00 / 1M tokens`),
|
|
1402
1402
|
output: pricing(`$30.00 / 1M tokens`),
|
|
@@ -1408,10 +1408,10 @@ const OPENAI_MODELS = exportJson({
|
|
|
1408
1408
|
modelVariant: 'COMPLETION',
|
|
1409
1409
|
modelTitle: 'gpt-3.5-turbo-instruct-0914',
|
|
1410
1410
|
modelName: 'gpt-3.5-turbo-instruct-0914',
|
|
1411
|
-
modelDescription: 'September 2023 version of GPT-3.5 Turbo
|
|
1411
|
+
modelDescription: 'September 2023 version of GPT-3.5 Turbo Instruct with 4K context window. Optimized for completion-style instruction following with deterministic responses. Better suited than chat models for applications requiring specific formatted outputs without conversation management. Knowledge cutoff from September 2021.',
|
|
1412
1412
|
pricing: {
|
|
1413
1413
|
prompt: pricing(`$1.50 / 1M tokens`),
|
|
1414
|
-
output: pricing(`$2.00 / 1M tokens`),
|
|
1414
|
+
output: pricing(`$2.00 / 1M tokens`),
|
|
1415
1415
|
},
|
|
1416
1416
|
},
|
|
1417
1417
|
/**/
|
|
@@ -1420,7 +1420,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1420
1420
|
modelVariant: 'COMPLETION',
|
|
1421
1421
|
modelTitle: 'gpt-3.5-turbo-instruct',
|
|
1422
1422
|
modelName: 'gpt-3.5-turbo-instruct',
|
|
1423
|
-
modelDescription: 'Optimized version of GPT-3.5 for completion-style API with
|
|
1423
|
+
modelDescription: 'Optimized version of GPT-3.5 for completion-style API with 4K token context window. Features strong instruction following with single-turn design rather than multi-turn conversation. Provides more consistent, deterministic outputs compared to chat models. Well-suited for templated content generation and structured text transformation tasks.',
|
|
1424
1424
|
pricing: {
|
|
1425
1425
|
prompt: pricing(`$1.50 / 1M tokens`),
|
|
1426
1426
|
output: pricing(`$2.00 / 1M tokens`),
|
|
@@ -1438,7 +1438,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1438
1438
|
modelVariant: 'CHAT',
|
|
1439
1439
|
modelTitle: 'gpt-3.5-turbo',
|
|
1440
1440
|
modelName: 'gpt-3.5-turbo',
|
|
1441
|
-
modelDescription: 'Latest version of GPT-3.5 Turbo with improved performance
|
|
1441
|
+
modelDescription: 'Latest version of GPT-3.5 Turbo with 4K token default context window (16K available). Features continually improved performance with enhanced instruction following and reduced hallucinations. Offers excellent balance between capability and cost efficiency. Suitable for most general-purpose applications requiring good AI capabilities at reasonable cost.',
|
|
1442
1442
|
pricing: {
|
|
1443
1443
|
prompt: pricing(`$0.50 / 1M tokens`),
|
|
1444
1444
|
output: pricing(`$1.50 / 1M tokens`),
|
|
@@ -1450,7 +1450,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1450
1450
|
modelVariant: 'CHAT',
|
|
1451
1451
|
modelTitle: 'gpt-3.5-turbo-0301',
|
|
1452
1452
|
modelName: 'gpt-3.5-turbo-0301',
|
|
1453
|
-
modelDescription: 'March 2023 version of GPT-3.5 Turbo with
|
|
1453
|
+
modelDescription: 'March 2023 version of GPT-3.5 Turbo with 4K token context window. Legacy model maintained for backward compatibility with specific application behaviors. Features solid conversational abilities and basic instruction following. Knowledge cutoff from September 2021. Suitable for applications explicitly designed for this version.',
|
|
1454
1454
|
pricing: {
|
|
1455
1455
|
prompt: pricing(`$1.50 / 1M tokens`),
|
|
1456
1456
|
output: pricing(`$2.00 / 1M tokens`),
|
|
@@ -1462,7 +1462,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1462
1462
|
modelVariant: 'COMPLETION',
|
|
1463
1463
|
modelTitle: 'babbage-002',
|
|
1464
1464
|
modelName: 'babbage-002',
|
|
1465
|
-
modelDescription: 'Efficient legacy completion model with
|
|
1465
|
+
modelDescription: 'Efficient legacy completion model with 4K context window balancing performance and speed. Features moderate reasoning capabilities with focus on straightforward text generation tasks. Significantly more efficient than davinci models while maintaining adequate quality for many applications. Suitable for high-volume, cost-sensitive text generation needs.',
|
|
1466
1466
|
pricing: {
|
|
1467
1467
|
prompt: pricing(`$0.40 / 1M tokens`),
|
|
1468
1468
|
output: pricing(`$0.40 / 1M tokens`),
|
|
@@ -1474,7 +1474,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1474
1474
|
modelVariant: 'CHAT',
|
|
1475
1475
|
modelTitle: 'gpt-4-1106-preview',
|
|
1476
1476
|
modelName: 'gpt-4-1106-preview',
|
|
1477
|
-
modelDescription: 'November 2023 preview version of GPT-4 Turbo with improved instruction following and
|
|
1477
|
+
modelDescription: 'November 2023 preview version of GPT-4 Turbo with 128K token context window. Features improved instruction following, better function calling capabilities, and enhanced reasoning. Includes knowledge cutoff from April 2023. Suitable for complex applications requiring extensive document understanding and sophisticated interactions.',
|
|
1478
1478
|
pricing: {
|
|
1479
1479
|
prompt: pricing(`$10.00 / 1M tokens`),
|
|
1480
1480
|
output: pricing(`$30.00 / 1M tokens`),
|
|
@@ -1486,7 +1486,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1486
1486
|
modelVariant: 'CHAT',
|
|
1487
1487
|
modelTitle: 'gpt-4-0125-preview',
|
|
1488
1488
|
modelName: 'gpt-4-0125-preview',
|
|
1489
|
-
modelDescription: 'January 2024 preview version of GPT-4 Turbo with improved reasoning capabilities and
|
|
1489
|
+
modelDescription: 'January 2024 preview version of GPT-4 Turbo with 128K token context window. Features improved reasoning capabilities, enhanced tool use, and more reliable function calling. Includes knowledge cutoff from October 2023. Offers better performance on complex logical tasks and more consistent outputs than previous preview versions.',
|
|
1490
1490
|
pricing: {
|
|
1491
1491
|
prompt: pricing(`$10.00 / 1M tokens`),
|
|
1492
1492
|
output: pricing(`$30.00 / 1M tokens`),
|
|
@@ -1504,7 +1504,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1504
1504
|
modelVariant: 'CHAT',
|
|
1505
1505
|
modelTitle: 'gpt-3.5-turbo-0125',
|
|
1506
1506
|
modelName: 'gpt-3.5-turbo-0125',
|
|
1507
|
-
modelDescription: 'January 2024 version of GPT-3.5 Turbo with improved reasoning capabilities and
|
|
1507
|
+
modelDescription: 'January 2024 version of GPT-3.5 Turbo with 16K token context window. Features improved reasoning capabilities, better instruction adherence, and reduced hallucinations compared to previous versions. Includes knowledge cutoff from September 2021. Provides good performance for most general applications at reasonable cost.',
|
|
1508
1508
|
pricing: {
|
|
1509
1509
|
prompt: pricing(`$0.50 / 1M tokens`),
|
|
1510
1510
|
output: pricing(`$1.50 / 1M tokens`),
|
|
@@ -1516,7 +1516,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1516
1516
|
modelVariant: 'CHAT',
|
|
1517
1517
|
modelTitle: 'gpt-4-turbo-preview',
|
|
1518
1518
|
modelName: 'gpt-4-turbo-preview',
|
|
1519
|
-
modelDescription: 'Preview version of GPT-4 Turbo that points to the latest model
|
|
1519
|
+
modelDescription: 'Preview version of GPT-4 Turbo with 128K token context window that points to the latest development model. Features cutting-edge improvements to instruction following, knowledge representation, and tool use capabilities. Provides access to newest features but may have occasional behavior changes. Best for non-critical applications wanting latest capabilities.',
|
|
1520
1520
|
pricing: {
|
|
1521
1521
|
prompt: pricing(`$10.00 / 1M tokens`),
|
|
1522
1522
|
output: pricing(`$30.00 / 1M tokens`),
|
|
@@ -1528,11 +1528,10 @@ const OPENAI_MODELS = exportJson({
|
|
|
1528
1528
|
modelVariant: 'EMBEDDING',
|
|
1529
1529
|
modelTitle: 'text-embedding-3-large',
|
|
1530
1530
|
modelName: 'text-embedding-3-large',
|
|
1531
|
-
modelDescription: "OpenAI's most capable text embedding model
|
|
1531
|
+
modelDescription: "OpenAI's most capable text embedding model generating 3072-dimensional vectors. Designed for high-quality embeddings for complex similarity tasks, clustering, and information retrieval. Features enhanced cross-lingual capabilities and significantly improved performance on retrieval and classification benchmarks. Ideal for sophisticated RAG systems and semantic search applications.",
|
|
1532
1532
|
pricing: {
|
|
1533
1533
|
prompt: pricing(`$0.13 / 1M tokens`),
|
|
1534
|
-
|
|
1535
|
-
output: 0, // <- Note: [🆖] In Embedding models you dont pay for output
|
|
1534
|
+
output: 0,
|
|
1536
1535
|
},
|
|
1537
1536
|
},
|
|
1538
1537
|
/**/
|
|
@@ -1541,11 +1540,10 @@ const OPENAI_MODELS = exportJson({
|
|
|
1541
1540
|
modelVariant: 'EMBEDDING',
|
|
1542
1541
|
modelTitle: 'text-embedding-3-small',
|
|
1543
1542
|
modelName: 'text-embedding-3-small',
|
|
1544
|
-
modelDescription: 'Cost-effective embedding model
|
|
1543
|
+
modelDescription: 'Cost-effective embedding model generating 1536-dimensional vectors. Balances quality and efficiency for simpler tasks while maintaining good performance on text similarity and retrieval applications. Offers 20% better quality than ada-002 at significantly lower cost. Ideal for production embedding applications with cost constraints.',
|
|
1545
1544
|
pricing: {
|
|
1546
1545
|
prompt: pricing(`$0.02 / 1M tokens`),
|
|
1547
|
-
|
|
1548
|
-
output: 0, // <- Note: [🆖] In Embedding models you dont pay for output
|
|
1546
|
+
output: 0,
|
|
1549
1547
|
},
|
|
1550
1548
|
},
|
|
1551
1549
|
/**/
|
|
@@ -1554,7 +1552,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1554
1552
|
modelVariant: 'CHAT',
|
|
1555
1553
|
modelTitle: 'gpt-3.5-turbo-0613',
|
|
1556
1554
|
modelName: 'gpt-3.5-turbo-0613',
|
|
1557
|
-
modelDescription:
|
|
1555
|
+
modelDescription: "June 2023 version of GPT-3.5 Turbo with 4K token context window. Features function calling capabilities for structured data extraction and API interaction. Includes knowledge cutoff from September 2021. Maintained for applications specifically designed for this version's behaviors and capabilities.",
|
|
1558
1556
|
pricing: {
|
|
1559
1557
|
prompt: pricing(`$1.50 / 1M tokens`),
|
|
1560
1558
|
output: pricing(`$2.00 / 1M tokens`),
|
|
@@ -1566,11 +1564,10 @@ const OPENAI_MODELS = exportJson({
|
|
|
1566
1564
|
modelVariant: 'EMBEDDING',
|
|
1567
1565
|
modelTitle: 'text-embedding-ada-002',
|
|
1568
1566
|
modelName: 'text-embedding-ada-002',
|
|
1569
|
-
modelDescription: 'Legacy text embedding model suitable for text similarity and retrieval
|
|
1567
|
+
modelDescription: 'Legacy text embedding model generating 1536-dimensional vectors suitable for text similarity and retrieval applications. Processes up to 8K tokens per request with consistent embedding quality. While superseded by newer embedding-3 models, still maintains adequate performance for many semantic search and classification tasks.',
|
|
1570
1568
|
pricing: {
|
|
1571
1569
|
prompt: pricing(`$0.1 / 1M tokens`),
|
|
1572
|
-
|
|
1573
|
-
output: 0, // <- Note: [🆖] In Embedding models you dont pay for output
|
|
1570
|
+
output: 0,
|
|
1574
1571
|
},
|
|
1575
1572
|
},
|
|
1576
1573
|
/**/
|
|
@@ -1597,7 +1594,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1597
1594
|
modelVariant: 'CHAT',
|
|
1598
1595
|
modelTitle: 'gpt-4o-2024-05-13',
|
|
1599
1596
|
modelName: 'gpt-4o-2024-05-13',
|
|
1600
|
-
modelDescription: 'May 2024 version of GPT-4o with enhanced multimodal capabilities
|
|
1597
|
+
modelDescription: 'May 2024 version of GPT-4o with 128K context window. Features enhanced multimodal capabilities including superior image understanding (up to 20MP), audio processing, and improved reasoning. Optimized for 2x lower latency than GPT-4 Turbo while maintaining high performance. Includes knowledge up to October 2023. Ideal for production applications requiring reliable multimodal capabilities.',
|
|
1601
1598
|
pricing: {
|
|
1602
1599
|
prompt: pricing(`$5.00 / 1M tokens`),
|
|
1603
1600
|
output: pricing(`$15.00 / 1M tokens`),
|
|
@@ -1609,7 +1606,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1609
1606
|
modelVariant: 'CHAT',
|
|
1610
1607
|
modelTitle: 'gpt-4o',
|
|
1611
1608
|
modelName: 'gpt-4o',
|
|
1612
|
-
modelDescription: "OpenAI's most advanced multimodal model
|
|
1609
|
+
modelDescription: "OpenAI's most advanced general-purpose multimodal model with 128K context window. Optimized for balanced performance, speed, and cost with 2x faster responses than GPT-4 Turbo. Features excellent vision processing, audio understanding, reasoning, and text generation quality. Represents optimal balance of capability and efficiency for most advanced applications.",
|
|
1613
1610
|
pricing: {
|
|
1614
1611
|
prompt: pricing(`$5.00 / 1M tokens`),
|
|
1615
1612
|
output: pricing(`$15.00 / 1M tokens`),
|
|
@@ -1621,7 +1618,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1621
1618
|
modelVariant: 'CHAT',
|
|
1622
1619
|
modelTitle: 'gpt-4o-mini',
|
|
1623
1620
|
modelName: 'gpt-4o-mini',
|
|
1624
|
-
modelDescription: 'Smaller, more cost-effective version of GPT-4o with
|
|
1621
|
+
modelDescription: 'Smaller, more cost-effective version of GPT-4o with 128K context window. Maintains impressive capabilities across text, vision, and audio tasks while operating at significantly lower cost. Features 3x faster inference than GPT-4o with good performance on general tasks. Excellent for applications requiring good quality multimodal capabilities at scale.',
|
|
1625
1622
|
pricing: {
|
|
1626
1623
|
prompt: pricing(`$0.15 / 1M tokens`),
|
|
1627
1624
|
output: pricing(`$0.60 / 1M tokens`),
|
|
@@ -1633,7 +1630,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1633
1630
|
modelVariant: 'CHAT',
|
|
1634
1631
|
modelTitle: 'o1-preview',
|
|
1635
1632
|
modelName: 'o1-preview',
|
|
1636
|
-
modelDescription: 'Advanced reasoning model with
|
|
1633
|
+
modelDescription: 'Advanced reasoning model with 128K context window specializing in complex logical, mathematical, and analytical tasks. Features exceptional step-by-step problem-solving capabilities, advanced mathematical and scientific reasoning, and superior performance on STEM-focused problems. Significantly outperforms GPT-4 on quantitative reasoning benchmarks. Ideal for professional and specialized applications.',
|
|
1637
1634
|
pricing: {
|
|
1638
1635
|
prompt: pricing(`$15.00 / 1M tokens`),
|
|
1639
1636
|
output: pricing(`$60.00 / 1M tokens`),
|
|
@@ -1645,8 +1642,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1645
1642
|
modelVariant: 'CHAT',
|
|
1646
1643
|
modelTitle: 'o1-preview-2024-09-12',
|
|
1647
1644
|
modelName: 'o1-preview-2024-09-12',
|
|
1648
|
-
modelDescription: 'September 2024 version of O1 preview with specialized reasoning capabilities for
|
|
1649
|
-
// <- TODO: [💩] Some better system to organize these date suffixes and versions
|
|
1645
|
+
modelDescription: 'September 2024 version of O1 preview with 128K context window. Features specialized reasoning capabilities with 30% improvement on mathematical and scientific accuracy over previous versions. Includes enhanced support for formal logic, statistical analysis, and technical domains. Optimized for professional applications requiring precise analytical thinking and rigorous methodologies.',
|
|
1650
1646
|
pricing: {
|
|
1651
1647
|
prompt: pricing(`$15.00 / 1M tokens`),
|
|
1652
1648
|
output: pricing(`$60.00 / 1M tokens`),
|
|
@@ -1658,7 +1654,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1658
1654
|
modelVariant: 'CHAT',
|
|
1659
1655
|
modelTitle: 'o1-mini',
|
|
1660
1656
|
modelName: 'o1-mini',
|
|
1661
|
-
modelDescription: 'Smaller, cost-effective version of the O1 model with good performance on
|
|
1657
|
+
modelDescription: 'Smaller, cost-effective version of the O1 model with 128K context window. Maintains strong analytical reasoning abilities while reducing computational requirements by 70%. Features good performance on mathematical, logical, and scientific tasks at significantly lower cost than full O1. Excellent for everyday analytical applications that benefit from reasoning focus.',
|
|
1662
1658
|
pricing: {
|
|
1663
1659
|
prompt: pricing(`$3.00 / 1M tokens`),
|
|
1664
1660
|
output: pricing(`$12.00 / 1M tokens`),
|
|
@@ -1670,7 +1666,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1670
1666
|
modelVariant: 'CHAT',
|
|
1671
1667
|
modelTitle: 'o1',
|
|
1672
1668
|
modelName: 'o1',
|
|
1673
|
-
modelDescription: "OpenAI's advanced reasoning model
|
|
1669
|
+
modelDescription: "OpenAI's advanced reasoning model with 128K context window focusing on logical problem-solving and analytical thinking. Features exceptional performance on quantitative tasks, step-by-step deduction, and complex technical problems. Maintains 95%+ of o1-preview capabilities with production-ready stability. Ideal for scientific computing, financial analysis, and professional applications.",
|
|
1674
1670
|
pricing: {
|
|
1675
1671
|
prompt: pricing(`$15.00 / 1M tokens`),
|
|
1676
1672
|
output: pricing(`$60.00 / 1M tokens`),
|
|
@@ -1682,11 +1678,10 @@ const OPENAI_MODELS = exportJson({
|
|
|
1682
1678
|
modelVariant: 'CHAT',
|
|
1683
1679
|
modelTitle: 'o3-mini',
|
|
1684
1680
|
modelName: 'o3-mini',
|
|
1685
|
-
modelDescription: 'Cost-effective reasoning model optimized for academic and scientific problem-solving.
|
|
1681
|
+
modelDescription: 'Cost-effective reasoning model with 128K context window optimized for academic and scientific problem-solving. Features efficient performance on STEM tasks with specialized capabilities in mathematics, physics, chemistry, and computer science. Offers 80% of O1 performance on technical domains at significantly lower cost. Ideal for educational applications and research support.',
|
|
1686
1682
|
pricing: {
|
|
1687
1683
|
prompt: pricing(`$3.00 / 1M tokens`),
|
|
1688
1684
|
output: pricing(`$12.00 / 1M tokens`),
|
|
1689
|
-
// <- TODO: !! Unsure, check the pricing
|
|
1690
1685
|
},
|
|
1691
1686
|
},
|
|
1692
1687
|
/**/
|
|
@@ -1695,7 +1690,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1695
1690
|
modelVariant: 'CHAT',
|
|
1696
1691
|
modelTitle: 'o1-mini-2024-09-12',
|
|
1697
1692
|
modelName: 'o1-mini-2024-09-12',
|
|
1698
|
-
modelDescription: "September 2024 version of O1-mini with balanced reasoning capabilities and cost-efficiency.
|
|
1693
|
+
modelDescription: "September 2024 version of O1-mini with 128K context window featuring balanced reasoning capabilities and cost-efficiency. Includes 25% improvement in mathematical accuracy and enhanced performance on coding tasks compared to previous versions. Maintains efficient resource utilization while delivering improved results for analytical applications that don't require the full O1 model.",
|
|
1699
1694
|
pricing: {
|
|
1700
1695
|
prompt: pricing(`$3.00 / 1M tokens`),
|
|
1701
1696
|
output: pricing(`$12.00 / 1M tokens`),
|
|
@@ -1707,7 +1702,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
1707
1702
|
modelVariant: 'CHAT',
|
|
1708
1703
|
modelTitle: 'gpt-3.5-turbo-16k-0613',
|
|
1709
1704
|
modelName: 'gpt-3.5-turbo-16k-0613',
|
|
1710
|
-
modelDescription:
|
|
1705
|
+
modelDescription: "June 2023 version of GPT-3.5 Turbo with extended 16K token context window. Features good handling of longer conversations and documents with improved memory management across extended contexts. Includes knowledge cutoff from September 2021. Maintained for applications specifically designed for this version's behaviors and capabilities.",
|
|
1711
1706
|
pricing: {
|
|
1712
1707
|
prompt: pricing(`$3.00 / 1M tokens`),
|
|
1713
1708
|
output: pricing(`$4.00 / 1M tokens`),
|
|
@@ -2242,7 +2237,7 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
2242
2237
|
});
|
|
2243
2238
|
const rawRequest = {
|
|
2244
2239
|
// TODO: [👨👨👧👧] ...modelSettings,
|
|
2245
|
-
// TODO: [👨👨👧👧][🧠] What about system message for assistants, does it make
|
|
2240
|
+
// TODO: [👨👨👧👧][🧠] What about system message for assistants, does it make sense - combination of OpenAI assistants with Promptbook Personas
|
|
2246
2241
|
assistant_id: this.assistantId,
|
|
2247
2242
|
thread: {
|
|
2248
2243
|
messages: [
|
|
@@ -2330,7 +2325,7 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
2330
2325
|
}
|
|
2331
2326
|
}
|
|
2332
2327
|
/**
|
|
2333
|
-
* TODO: [🧠][🧙♂️] Maybe there can be some
|
|
2328
|
+
* TODO: [🧠][🧙♂️] Maybe there can be some wizard for those who want to use just OpenAI
|
|
2334
2329
|
* TODO: Maybe make custom OpenAiError
|
|
2335
2330
|
* TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
2336
2331
|
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
@@ -2523,7 +2518,7 @@ const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
|
|
|
2523
2518
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
|
|
2524
2519
|
*
|
|
2525
2520
|
* @public exported from `@promptbook/openai`
|
|
2526
|
-
* @public exported from `@promptbook/
|
|
2521
|
+
* @public exported from `@promptbook/wizard`
|
|
2527
2522
|
* @public exported from `@promptbook/cli`
|
|
2528
2523
|
*/
|
|
2529
2524
|
const _OpenAiRegistration = $llmToolsRegister.register(createOpenAiExecutionTools);
|
|
@@ -2533,7 +2528,7 @@ const _OpenAiRegistration = $llmToolsRegister.register(createOpenAiExecutionTool
|
|
|
2533
2528
|
* Note: [🏐] Configurations registrations are done in register-constructor.ts BUT constructor register-constructor.ts
|
|
2534
2529
|
*
|
|
2535
2530
|
* @public exported from `@promptbook/openai`
|
|
2536
|
-
* @public exported from `@promptbook/
|
|
2531
|
+
* @public exported from `@promptbook/wizard`
|
|
2537
2532
|
* @public exported from `@promptbook/cli`
|
|
2538
2533
|
*/
|
|
2539
2534
|
const _OpenAiAssistantRegistration = $llmToolsRegister.register(createOpenAiAssistantExecutionTools);
|