@promptbook/markdown-utils 0.105.0-10 → 0.105.0-12
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/esm/index.es.js +1 -1
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +8 -4
- package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +22 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +46 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.test.d.ts +1 -0
- package/esm/typings/src/commitments/index.d.ts +2 -1
- package/esm/typings/src/execution/AvailableModel.d.ts +5 -4
- package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +7 -0
- package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +3 -0
- package/esm/typings/src/types/Prompt.d.ts +4 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +1 -1
package/esm/index.es.js
CHANGED
|
@@ -23,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-12';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -31,7 +31,7 @@ export type AgentCapability = {
|
|
|
31
31
|
/**
|
|
32
32
|
* The type of the capability
|
|
33
33
|
*/
|
|
34
|
-
type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import';
|
|
34
|
+
type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import' | 'image-generator';
|
|
35
35
|
/**
|
|
36
36
|
* The label to display for this capability
|
|
37
37
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { Promisable } from 'type-fest';
|
|
3
|
-
import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
|
|
4
|
-
import type { ChatMessage } from '../types/ChatMessage';
|
|
5
|
-
import type { ChatParticipant } from '../types/ChatParticipant';
|
|
6
|
-
import { string_color } from '../../../types/typeAliases';
|
|
7
3
|
import { Color } from '../../../_packages/color.index';
|
|
8
4
|
import { SpeechRecognition } from '../../../types/SpeechRecognition';
|
|
5
|
+
import { string_color } from '../../../types/typeAliases';
|
|
9
6
|
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
7
|
+
import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
|
|
8
|
+
import type { ChatMessage } from '../types/ChatMessage';
|
|
9
|
+
import type { ChatParticipant } from '../types/ChatParticipant';
|
|
10
10
|
/**
|
|
11
11
|
* @public exported from `@promptbook/components`
|
|
12
12
|
*/
|
|
@@ -203,6 +203,10 @@ export type ChatProps = {
|
|
|
203
203
|
arguments?: TODO_any;
|
|
204
204
|
result?: TODO_any;
|
|
205
205
|
}) => void;
|
|
206
|
+
/**
|
|
207
|
+
* Visual style of the chat component
|
|
208
|
+
*/
|
|
209
|
+
readonly visual: 'STANDALONE' | 'FULL_PAGE';
|
|
206
210
|
};
|
|
207
211
|
/**
|
|
208
212
|
* TODO: [☁️] Export component prop types only to `@promptbook/components` (not `@promptbook/types`)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
2
|
+
/**
|
|
3
|
+
* Utility to format tool call information for user-friendly display.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Technical to user-friendly tool names and emojis
|
|
7
|
+
*
|
|
8
|
+
* @private [🧠] Maybe public?
|
|
9
|
+
*/
|
|
10
|
+
export declare const TOOL_TITLES: Record<string, {
|
|
11
|
+
title: string;
|
|
12
|
+
emoji: string;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the user-friendly text for a tool call chiplet.
|
|
16
|
+
*
|
|
17
|
+
* @private [🧠] Maybe public?
|
|
18
|
+
*/
|
|
19
|
+
export declare function getToolCallChipletText(toolCall: {
|
|
20
|
+
name: string;
|
|
21
|
+
arguments?: string | Record<string, TODO_any>;
|
|
22
|
+
}): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
+
import { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
4
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
5
|
+
/**
|
|
6
|
+
* USE IMAGE GENERATOR commitment definition
|
|
7
|
+
*
|
|
8
|
+
* The `USE IMAGE GENERATOR` commitment indicates that the agent should utilize an image generation tool
|
|
9
|
+
* to create images based on text prompts.
|
|
10
|
+
*
|
|
11
|
+
* Example usage in agent source:
|
|
12
|
+
*
|
|
13
|
+
* ```book
|
|
14
|
+
* USE IMAGE GENERATOR
|
|
15
|
+
* USE IMAGE GENERATOR Create realistic images of nature
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
19
|
+
*/
|
|
20
|
+
export declare class UseImageGeneratorCommitmentDefinition extends BaseCommitmentDefinition<'USE IMAGE GENERATOR' | 'USE IMAGE GENERATION' | 'IMAGE GENERATOR' | 'IMAGE GENERATION' | 'USE IMAGE'> {
|
|
21
|
+
constructor(type?: 'USE IMAGE GENERATOR' | 'USE IMAGE GENERATION' | 'IMAGE GENERATOR' | 'IMAGE GENERATION' | 'USE IMAGE');
|
|
22
|
+
/**
|
|
23
|
+
* Short one-line description of USE IMAGE GENERATOR.
|
|
24
|
+
*/
|
|
25
|
+
get description(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon for this commitment.
|
|
28
|
+
*/
|
|
29
|
+
get icon(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Markdown documentation for USE IMAGE GENERATOR commitment.
|
|
32
|
+
*/
|
|
33
|
+
get documentation(): string;
|
|
34
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
35
|
+
/**
|
|
36
|
+
* Gets human-readable titles for tool functions provided by this commitment.
|
|
37
|
+
*/
|
|
38
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the `generate_image` tool function implementation.
|
|
41
|
+
*/
|
|
42
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
46
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -33,6 +33,7 @@ import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
|
|
33
33
|
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
|
34
34
|
import { UseCommitmentDefinition } from './USE/USE';
|
|
35
35
|
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
36
|
+
import { UseImageGeneratorCommitmentDefinition } from './USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR';
|
|
36
37
|
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
37
38
|
import { UseSearchEngineCommitmentDefinition } from './USE_SEARCH_ENGINE/USE_SEARCH_ENGINE';
|
|
38
39
|
import { UseTimeCommitmentDefinition } from './USE_TIME/USE_TIME';
|
|
@@ -44,7 +45,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
44
45
|
*
|
|
45
46
|
* @private Use functions to access commitments instead of this array directly
|
|
46
47
|
*/
|
|
47
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
48
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
48
49
|
/**
|
|
49
50
|
* Gets a commitment definition by its type
|
|
50
51
|
* @param type The commitment type to look up
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ModelVariant } from '../types/ModelVariant';
|
|
2
|
-
import type { number_usd } from '../types/typeAliases';
|
|
3
|
-
import type { string_model_description } from '../types/typeAliases';
|
|
4
|
-
import type { string_model_name } from '../types/typeAliases';
|
|
5
|
-
import type { string_title } from '../types/typeAliases';
|
|
2
|
+
import type { number_usd, string_model_description, string_model_name, string_title, string_url } from '../types/typeAliases';
|
|
6
3
|
/**
|
|
7
4
|
* Represents a model that can be used for prompt execution
|
|
8
5
|
*/
|
|
@@ -40,6 +37,10 @@ export type AvailableModel = {
|
|
|
40
37
|
readonly prompt: number_usd;
|
|
41
38
|
readonly output: number_usd;
|
|
42
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* URL to the model (or provider) documentation
|
|
42
|
+
*/
|
|
43
|
+
readonly documentationUrl?: string_url;
|
|
43
44
|
/**
|
|
44
45
|
* If the model is deprecated, it should not be used for new tasks
|
|
45
46
|
*/
|
|
@@ -10,5 +10,6 @@ export declare const createGoogleExecutionTools: ((options: GoogleExecutionTools
|
|
|
10
10
|
className: string;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
+
* TODO: !!!!! Rename to `createGoogleLlmExecutionTools`, `...GoogleLlmExecutionTools`
|
|
13
14
|
* TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
|
|
14
15
|
*/
|
|
@@ -33,11 +33,11 @@ export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools
|
|
|
33
33
|
/**
|
|
34
34
|
* Calls OpenAI API to use a chat model.
|
|
35
35
|
*/
|
|
36
|
-
callChatModel(prompt:
|
|
36
|
+
callChatModel(prompt: Prompt): Promise<ChatPromptResult>;
|
|
37
37
|
/**
|
|
38
38
|
* Calls OpenAI API to use a chat model with streaming.
|
|
39
39
|
*/
|
|
40
|
-
callChatModelStream(prompt:
|
|
40
|
+
callChatModelStream(prompt: Prompt, onProgress: (chunk: ChatPromptResult) => void): Promise<ChatPromptResult>;
|
|
41
41
|
/**
|
|
42
42
|
* Get an existing assistant tool wrapper
|
|
43
43
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import OpenAI from 'openai';
|
|
2
|
+
/**
|
|
3
|
+
* Uploads files to OpenAI and returns their IDs
|
|
4
|
+
*
|
|
5
|
+
* @private utility for `OpenAiAssistantExecutionTools` and `OpenAiCompatibleExecutionTools`
|
|
6
|
+
*/
|
|
7
|
+
export declare function uploadFilesToOpenAi(client: OpenAI, files: Array<File>): Promise<Array<string>>;
|
|
@@ -19,6 +19,9 @@ export type OpenAiSpeechRecognitionOptions = {
|
|
|
19
19
|
export declare class OpenAiSpeechRecognition implements SpeechRecognition {
|
|
20
20
|
private readonly options;
|
|
21
21
|
private mediaRecorder;
|
|
22
|
+
private audioContext;
|
|
23
|
+
private analyser;
|
|
24
|
+
private silenceTimeout;
|
|
22
25
|
private audioChunks;
|
|
23
26
|
private callbacks;
|
|
24
27
|
private _state;
|
|
@@ -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.105.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.105.0-11`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
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.105.0-
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-12';
|
|
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
|