@promptbook/types 0.103.0-34 → 0.103.0-35
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 +57 -21
- package/esm/typings/src/_packages/cli.index.d.ts +3 -1
- package/esm/typings/src/_packages/core.index.d.ts +3 -1
- package/esm/typings/src/_packages/wizard.index.d.ts +3 -1
- package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +2 -1
- package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +13 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +15 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.test.d.ts +1 -0
- package/esm/typings/src/transpilers/{openai → openai-sdk}/register.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- /package/esm/typings/src/transpilers/{openai → openai-sdk}/OpenAiSdkTranspiler.d.ts +0 -0
- /package/esm/typings/src/{playground/permanent/transpilers-playground.d.ts → transpilers/openai-sdk/playground/playground.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -314,11 +314,15 @@ The main challenge is to narrow it down, constrain it, set the proper **context,
|
|
|
314
314
|
|
|
315
315
|
Promptbook takes the best from both worlds. You are defining your AI behavior by simple **books**, which are very explicit. They are automatically enforced, but they are very easy to understand, very easy to write, and very reliable and portable.
|
|
316
316
|
|
|
317
|
+
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
317
318
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
/>
|
|
319
|
+
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
320
|
+
<br/>
|
|
321
|
+
**PERSONA** You are a company lawyer.<br/>
|
|
322
|
+
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
323
|
+
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
324
|
+
|
|
325
|
+
</td></tr></table>
|
|
322
326
|
|
|
323
327
|
<div style="page-break-after: always;"></div>
|
|
324
328
|
|
|
@@ -332,11 +336,15 @@ You can look at it as prompting (or writing a system message), but decorated by
|
|
|
332
336
|
|
|
333
337
|
Personas define the character of your AI persona, its role, and how it should interact with users. It sets the tone and style of communication.
|
|
334
338
|
|
|
339
|
+
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
340
|
+
|
|
341
|
+
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
342
|
+
<br/>
|
|
343
|
+
**PERSONA** You are a company lawyer.<br/>
|
|
344
|
+
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
345
|
+
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
335
346
|
|
|
336
|
-
|
|
337
|
-
alt="Paul Smith & Associés Book"
|
|
338
|
-
src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.&width=800&height=450&nonce=0"
|
|
339
|
-
/>
|
|
347
|
+
</td></tr></table>
|
|
340
348
|
|
|
341
349
|
#### `Knowledge` commitment
|
|
342
350
|
|
|
@@ -346,11 +354,18 @@ This can include domain-specific knowledge, company policies, or any other relev
|
|
|
346
354
|
|
|
347
355
|
Promptbook Engine will automatically enforce this knowledge during interactions. When the knowledge is short enough, it will be included in the prompt. When it is too long, it will be stored in vector databases and RAG retrieved when needed. But you don't need to care about it.
|
|
348
356
|
|
|
357
|
+
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
358
|
+
|
|
359
|
+
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
360
|
+
<br/>
|
|
361
|
+
**PERSONA** You are a company lawyer.<br/>
|
|
362
|
+
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
363
|
+
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
364
|
+
<br/>
|
|
365
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
366
|
+
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
349
367
|
|
|
350
|
-
|
|
351
|
-
alt="Paul Smith & Associés Book"
|
|
352
|
-
src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20%20https%3A%2F%2Fcompany.com%2Fcompany-policies.pdf%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20https%3A%2F%2Fcompany.com%2Finternal-documents%2Femployee-handbook.docx&width=800&height=450&nonce=0"
|
|
353
|
-
/>
|
|
368
|
+
</td></tr></table>
|
|
354
369
|
|
|
355
370
|
#### `Rule` commitment
|
|
356
371
|
|
|
@@ -358,21 +373,42 @@ Rules will enforce specific behaviors or constraints on the AI's responses. This
|
|
|
358
373
|
|
|
359
374
|
Depending on rule strictness, Promptbook will either propagate it to the prompt or use other techniques, like adversary agent, to enforce it.
|
|
360
375
|
|
|
376
|
+
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
361
377
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
/>
|
|
378
|
+
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
379
|
+
<br/>
|
|
380
|
+
**PERSONA** You are a company lawyer.<br/>
|
|
381
|
+
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
382
|
+
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
383
|
+
<br/>
|
|
384
|
+
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
385
|
+
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
386
|
+
**RULE** Never provide legal advice about criminal law.<br/>
|
|
387
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
388
|
+
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
389
|
+
|
|
390
|
+
</td></tr></table>
|
|
366
391
|
|
|
367
392
|
#### `Action` commitment
|
|
368
393
|
|
|
369
394
|
Action Commitment allows you to define specific actions that the AI can take during interactions. This can include things like posting on a social media platform, sending emails, creating calendar events, or interacting with your internal systems.
|
|
370
395
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
/>
|
|
396
|
+
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
397
|
+
|
|
398
|
+
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
399
|
+
<br/>
|
|
400
|
+
**PERSONA** You are a company lawyer.<br/>
|
|
401
|
+
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
402
|
+
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
403
|
+
<br/>
|
|
404
|
+
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
405
|
+
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
406
|
+
**RULE** Never provide legal advice about criminal law.<br/>
|
|
407
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
408
|
+
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
409
|
+
**ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
|
|
410
|
+
|
|
411
|
+
</td></tr></table>
|
|
376
412
|
|
|
377
413
|
[Read more about the language](./BLUEPRINT.md)
|
|
378
414
|
|
|
@@ -30,7 +30,8 @@ import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
|
|
|
30
30
|
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
31
31
|
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
32
32
|
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
33
|
-
import {
|
|
33
|
+
import { _FormattedBookInMarkdownTranspilerRegistration } from '../transpilers/formatted-book-in-markdown/register';
|
|
34
|
+
import { _OpenAiSdkTranspilerRegistration } from '../transpilers/openai-sdk/register';
|
|
34
35
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
35
36
|
export { _CLI };
|
|
36
37
|
export { _AnthropicClaudeMetadataRegistration };
|
|
@@ -63,4 +64,5 @@ export { _PdfScraperRegistration };
|
|
|
63
64
|
export { _PdfScraperMetadataRegistration };
|
|
64
65
|
export { _WebsiteScraperRegistration };
|
|
65
66
|
export { _WebsiteScraperMetadataRegistration };
|
|
67
|
+
export { _FormattedBookInMarkdownTranspilerRegistration };
|
|
66
68
|
export { _OpenAiSdkTranspilerRegistration };
|
|
@@ -172,7 +172,8 @@ import { BlackholeStorage } from '../storage/blackhole/BlackholeStorage';
|
|
|
172
172
|
import { MemoryStorage } from '../storage/memory/MemoryStorage';
|
|
173
173
|
import { PrefixStorage } from '../storage/utils/PrefixStorage';
|
|
174
174
|
import { $bookTranspilersRegister } from '../transpilers/_common/register/$bookTranspilersRegister';
|
|
175
|
-
import {
|
|
175
|
+
import { FormattedBookInMarkdownTranspiler } from '../transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler';
|
|
176
|
+
import { OpenAiSdkTranspiler } from '../transpilers/openai-sdk/OpenAiSdkTranspiler';
|
|
176
177
|
import { MODEL_VARIANTS } from '../types/ModelVariant';
|
|
177
178
|
import { NonTaskSectionTypes } from '../types/SectionType';
|
|
178
179
|
import { SectionTypes } from '../types/SectionType';
|
|
@@ -353,6 +354,7 @@ export { BlackholeStorage };
|
|
|
353
354
|
export { MemoryStorage };
|
|
354
355
|
export { PrefixStorage };
|
|
355
356
|
export { $bookTranspilersRegister };
|
|
357
|
+
export { FormattedBookInMarkdownTranspiler };
|
|
356
358
|
export { OpenAiSdkTranspiler };
|
|
357
359
|
export { MODEL_VARIANTS };
|
|
358
360
|
export { NonTaskSectionTypes };
|
|
@@ -29,7 +29,8 @@ import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
|
|
|
29
29
|
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
30
30
|
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
31
31
|
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
32
|
-
import {
|
|
32
|
+
import { _FormattedBookInMarkdownTranspilerRegistration } from '../transpilers/formatted-book-in-markdown/register';
|
|
33
|
+
import { _OpenAiSdkTranspilerRegistration } from '../transpilers/openai-sdk/register';
|
|
33
34
|
import { wizard } from '../wizard/wizard';
|
|
34
35
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
35
36
|
export { _AnthropicClaudeMetadataRegistration };
|
|
@@ -62,5 +63,6 @@ export { _PdfScraperRegistration };
|
|
|
62
63
|
export { _PdfScraperMetadataRegistration };
|
|
63
64
|
export { _WebsiteScraperRegistration };
|
|
64
65
|
export { _WebsiteScraperMetadataRegistration };
|
|
66
|
+
export { _FormattedBookInMarkdownTranspilerRegistration };
|
|
65
67
|
export { _OpenAiSdkTranspilerRegistration };
|
|
66
68
|
export { wizard };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Promisable } from 'type-fest';
|
|
1
2
|
import { BookTranspilerOptions, ExecutionTools, Registered, string_book, string_name, string_script, string_title } from '../../_packages/types.index';
|
|
2
3
|
/**
|
|
3
4
|
* Transpiler takes a book and transpiles it into another format (e.g., Langchain).
|
|
@@ -24,5 +25,5 @@ export type BookTranspiler = Registered & {
|
|
|
24
25
|
* @param options additional options for the transpiler
|
|
25
26
|
* @returns transpiled book
|
|
26
27
|
*/
|
|
27
|
-
transpileBook(book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions):
|
|
28
|
+
transpileBook(book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions): Promisable<string_script>;
|
|
28
29
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BookTranspilerOptions, ExecutionTools, string_book, string_markdown } from '../../_packages/types.index';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a book into a 1:1 formatted markdown
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
|
+
*/
|
|
7
|
+
export declare const FormattedBookInMarkdownTranspiler: {
|
|
8
|
+
readonly name: "formatted-book-in-markdown";
|
|
9
|
+
readonly title: "Formatted Book in Markdown";
|
|
10
|
+
readonly packageName: "@promptbook/core";
|
|
11
|
+
readonly className: "FormattedBookInMarkdownTranspiler";
|
|
12
|
+
readonly transpileBook: (book: string_book, tools: ExecutionTools, options?: BookTranspilerOptions) => string_markdown;
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Registration } from '../../_packages/types.index';
|
|
2
|
+
/**
|
|
3
|
+
* Registration of transpiler
|
|
4
|
+
*
|
|
5
|
+
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/wizard`
|
|
8
|
+
* @public exported from `@promptbook/cli`
|
|
9
|
+
*
|
|
10
|
+
* TODO: !!!! Which package should export this?
|
|
11
|
+
*/
|
|
12
|
+
export declare const _FormattedBookInMarkdownTranspilerRegistration: Registration;
|
|
13
|
+
/**
|
|
14
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.103.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.103.0-34`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/types",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-35",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
},
|
|
93
93
|
"typings": "./esm/typings/src/_packages/types.index.d.ts",
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@promptbook/core": "0.103.0-
|
|
95
|
+
"@promptbook/core": "0.103.0-35"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
File without changes
|