@promptbook/azure-openai 0.103.0-34 → 0.103.0-36

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
@@ -269,11 +269,15 @@ The main challenge is to narrow it down, constrain it, set the proper **context,
269
269
 
270
270
  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.
271
271
 
272
+ <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
272
273
 
273
- <img
274
- alt="Paul Smith & Associés Book"
275
- 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"
276
- />
274
+ **<ins>Paul Smith & Associés</ins>**<br/>
275
+ <br/>
276
+ **PERSONA** You are a company lawyer.<br/>
277
+ Your job is to provide legal advice and support to the company and its employees.<br/>
278
+ You are knowledgeable, professional, and detail-oriented.<br/>
279
+
280
+ </td></tr></table>
277
281
 
278
282
  <div style="page-break-after: always;"></div>
279
283
 
@@ -287,11 +291,15 @@ You can look at it as prompting (or writing a system message), but decorated by
287
291
 
288
292
  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.
289
293
 
294
+ <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
295
+
296
+ **<ins>Paul Smith & Associés</ins>**<br/>
297
+ <br/>
298
+ **PERSONA** You are a company lawyer.<br/>
299
+ Your job is to provide legal advice and support to the company and its employees.<br/>
300
+ You are knowledgeable, professional, and detail-oriented.<br/>
290
301
 
291
- <img
292
- alt="Paul Smith & Associés Book"
293
- 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"
294
- />
302
+ </td></tr></table>
295
303
 
296
304
  #### `Knowledge` commitment
297
305
 
@@ -301,11 +309,18 @@ This can include domain-specific knowledge, company policies, or any other relev
301
309
 
302
310
  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.
303
311
 
312
+ <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
313
+
314
+ **<ins>Paul Smith & Associés</ins>**<br/>
315
+ <br/>
316
+ **PERSONA** You are a company lawyer.<br/>
317
+ Your job is to provide legal advice and support to the company and its employees.<br/>
318
+ You are knowledgeable, professional, and detail-oriented.<br/>
319
+ <br/>
320
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
321
+ **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
304
322
 
305
- <img
306
- alt="Paul Smith & Associés Book"
307
- 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"
308
- />
323
+ </td></tr></table>
309
324
 
310
325
  #### `Rule` commitment
311
326
 
@@ -313,21 +328,42 @@ Rules will enforce specific behaviors or constraints on the AI's responses. This
313
328
 
314
329
  Depending on rule strictness, Promptbook will either propagate it to the prompt or use other techniques, like adversary agent, to enforce it.
315
330
 
331
+ <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
316
332
 
317
- <img
318
- alt="Paul Smith & Associés Book"
319
- 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%20RULE%20Always%20ensure%20compliance%20with%20laws%20and%20regulations.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20outside%20your%20area%20of%20expertise.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20about%20criminal%20law.%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"
320
- />
333
+ **<ins>Paul Smith & Associés</ins>**<br/>
334
+ <br/>
335
+ **PERSONA** You are a company lawyer.<br/>
336
+ Your job is to provide legal advice and support to the company and its employees.<br/>
337
+ You are knowledgeable, professional, and detail-oriented.<br/>
338
+ <br/>
339
+ **RULE** Always ensure compliance with laws and regulations.<br/>
340
+ **RULE** Never provide legal advice outside your area of expertise.<br/>
341
+ **RULE** Never provide legal advice about criminal law.<br/>
342
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
343
+ **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
344
+
345
+ </td></tr></table>
321
346
 
322
347
  #### `Action` commitment
323
348
 
324
349
  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.
325
350
 
326
-
327
- <img
328
- alt="Paul Smith & Associés Book"
329
- 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%20RULE%20Always%20ensure%20compliance%20with%20laws%20and%20regulations.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20outside%20your%20area%20of%20expertise.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20about%20criminal%20law.%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%0A%20%20%20%20%20%20%7C%20ACTION%20When%20a%20user%20asks%20about%20an%20issue%20that%20could%20be%20treated%20as%20a%20crime%2C%20notify%20legal%40company.com.&width=800&height=450&nonce=0"
330
- />
351
+ <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
352
+
353
+ **<ins>Paul Smith & Associés</ins>**<br/>
354
+ <br/>
355
+ **PERSONA** You are a company lawyer.<br/>
356
+ Your job is to provide legal advice and support to the company and its employees.<br/>
357
+ You are knowledgeable, professional, and detail-oriented.<br/>
358
+ <br/>
359
+ **RULE** Always ensure compliance with laws and regulations.<br/>
360
+ **RULE** Never provide legal advice outside your area of expertise.<br/>
361
+ **RULE** Never provide legal advice about criminal law.<br/>
362
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
363
+ **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
364
+ **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
365
+
366
+ </td></tr></table>
331
367
 
332
368
  [Read more about the language](./BLUEPRINT.md)
333
369
 
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.103.0-34';
21
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-36';
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
@@ -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 { _OpenAiSdkTranspilerRegistration } from '../transpilers/openai/register';
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 { OpenAiSdkTranspiler } from '../transpilers/openai/OpenAiSdkTranspiler';
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 { _OpenAiSdkTranspilerRegistration } from '../transpilers/openai/register';
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 };
@@ -0,0 +1,47 @@
1
+ import { ReactNode } from 'react';
2
+ type TooltipProps = {
3
+ /**
4
+ * The content to display in the tooltip
5
+ */
6
+ content: string;
7
+ /**
8
+ * The element that triggers the tooltip
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * The position of the tooltip relative to the trigger element
13
+ * @default "top"
14
+ */
15
+ position?: 'top' | 'right' | 'bottom' | 'left';
16
+ /**
17
+ * Optional delay before showing the tooltip (in milliseconds)
18
+ * @default 0
19
+ */
20
+ delay?: number;
21
+ /**
22
+ * Render the tooltip wrapper as a block-level element that spans full width.
23
+ * Useful when wrapping grid/list items so the clickable area matches the visual card.
24
+ * @default false
25
+ */
26
+ block?: boolean;
27
+ /**
28
+ * Enable tooltip on touch devices. By default tooltips are disabled on touch to avoid
29
+ * stealing clicks from the underlying element (eg. agent card selection).
30
+ * @default false
31
+ */
32
+ isEnabledOnTouch?: boolean;
33
+ /**
34
+ * If true, the tooltip will not be displayed but the content will still be rendered.
35
+ * In this case <Tooltip> is equivalent to a <React.Fragment> with the content.
36
+ *
37
+ * Note: Tooltip sometimes breaks the hover, temporarily disable via this prop
38
+ */
39
+ isDisabled?: boolean;
40
+ };
41
+ /**
42
+ * A tooltip component that displays additional information when hovering over an element
43
+ *
44
+ * @private Used internally in book components
45
+ */
46
+ export declare function Tooltip({ content, children, position, delay, block, isEnabledOnTouch: enableOnTouch, isDisabled, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
47
+ export {};
@@ -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): Promise<string_script>;
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
+ */
@@ -1,6 +1,6 @@
1
1
  import { Registration } from '../../_packages/types.index';
2
2
  /**
3
- * Registration of LLM provider
3
+ * Registration of transpiler
4
4
  *
5
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
6
  *
@@ -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-33`).
18
+ * It follows semantic versioning (e.g., `0.103.0-35`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/azure-openai",
3
- "version": "0.103.0-34",
3
+ "version": "0.103.0-36",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -105,7 +105,7 @@
105
105
  "module": "./esm/index.es.js",
106
106
  "typings": "./esm/typings/src/_packages/azure-openai.index.d.ts",
107
107
  "peerDependencies": {
108
- "@promptbook/core": "0.103.0-34"
108
+ "@promptbook/core": "0.103.0-36"
109
109
  },
110
110
  "dependencies": {
111
111
  "@azure/openai": "1.0.0-beta.13",
package/umd/index.umd.js CHANGED
@@ -24,7 +24,7 @@
24
24
  * @generated
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-34';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-36';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name