@promptbook/types 0.100.0-8 → 0.100.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 +7 -14
- package/esm/typings/src/_packages/color.index.d.ts +50 -0
- package/esm/typings/src/_packages/components.index.d.ts +36 -0
- package/esm/typings/src/_packages/core.index.d.ts +30 -0
- package/esm/typings/src/_packages/types.index.d.ts +38 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +30 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +26 -0
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +45 -0
- package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +56 -0
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +49 -0
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +46 -0
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +52 -0
- package/esm/typings/src/book-2.0/commitments/_base/BookCommitment.d.ts +5 -0
- package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +48 -0
- package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +22 -0
- package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +19 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +37 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +18 -0
- package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +22 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirements.d.ts +62 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirementsWithCommitments.d.ts +36 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createCommitmentRegex.d.ts +20 -0
- package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +24 -0
- package/esm/typings/src/book-2.0/commitments/_misc/removeCommentsFromSystemMessage.d.ts +11 -0
- package/esm/typings/src/book-2.0/commitments/index.d.ts +56 -0
- package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +39 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +35 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChipFromSource.d.ts +21 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/index.d.ts +2 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +26 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource.d.ts +19 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +35 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +15 -0
- package/esm/typings/src/book-components/BookEditor/config.d.ts +10 -0
- package/esm/typings/src/book-components/BookEditor/injectCssModuleIntoShadowRoot.d.ts +11 -0
- package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +20 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +110 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChat.d.ts +14 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChat.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +24 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +32 -0
- package/esm/typings/src/book-components/Chat/utils/ChatPersistence.d.ts +25 -0
- package/esm/typings/src/book-components/Chat/utils/ExportFormat.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/utils/addUtmParamsToUrl.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/createShortLinkForChat.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/downloadFile.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/utils/exportChatHistory.d.ts +9 -0
- package/esm/typings/src/book-components/Chat/utils/generatePdfContent.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/generateQrDataUrl.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/getPromptbookBranding.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToHtml.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToJson.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToMarkdown.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToText.d.ts +8 -0
- package/esm/typings/src/book-components/_common/react-utils/classNames.d.ts +7 -0
- package/esm/typings/src/book-components/_common/react-utils/collectCssTextsForClass.d.ts +7 -0
- package/esm/typings/src/book-components/_common/react-utils/escapeHtml.d.ts +6 -0
- package/esm/typings/src/book-components/_common/react-utils/escapeRegex.d.ts +6 -0
- package/esm/typings/src/config.d.ts +19 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +4 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +27 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +8 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +6 -1
- package/esm/typings/src/llm-providers/_common/filterModels.d.ts +0 -3
- package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +81 -0
- package/esm/typings/src/llm-providers/_common/profiles/test/llmProviderProfiles.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/ollama/ollama-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +8 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -1
- package/esm/typings/src/playground/permanent/error-handling-playground.d.ts +5 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +0 -2
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/$randomColor.d.ts +11 -0
- package/esm/typings/src/utils/color/Color.d.ts +180 -0
- package/esm/typings/src/utils/color/css-colors.d.ts +159 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +14 -0
- package/esm/typings/src/utils/color/internal-utils/hslToRgb.d.ts +17 -0
- package/esm/typings/src/utils/color/internal-utils/rgbToHsl.d.ts +17 -0
- package/esm/typings/src/utils/color/operators/ColorTransformer.d.ts +5 -0
- package/esm/typings/src/utils/color/operators/darken.d.ts +9 -0
- package/esm/typings/src/utils/color/operators/furthest.d.ts +16 -0
- package/esm/typings/src/utils/color/operators/grayscale.d.ts +9 -0
- package/esm/typings/src/utils/color/operators/lighten.d.ts +12 -0
- package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +11 -0
- package/esm/typings/src/utils/color/operators/nearest.d.ts +10 -0
- package/esm/typings/src/utils/color/operators/negative.d.ts +7 -0
- package/esm/typings/src/utils/color/operators/negativeLightness.d.ts +7 -0
- package/esm/typings/src/utils/color/operators/withAlpha.d.ts +9 -0
- package/esm/typings/src/utils/color/utils/areColorsEqual.d.ts +14 -0
- package/esm/typings/src/utils/color/utils/colorDistance.d.ts +21 -0
- package/esm/typings/src/utils/color/utils/colorHue.d.ts +11 -0
- package/esm/typings/src/utils/color/utils/colorHueDistance.d.ts +11 -0
- package/esm/typings/src/utils/color/utils/colorHueDistance.test.d.ts +1 -0
- package/esm/typings/src/utils/color/utils/colorLuminance.d.ts +9 -0
- package/esm/typings/src/utils/color/utils/colorSatulightion.d.ts +7 -0
- package/esm/typings/src/utils/color/utils/colorSaturation.d.ts +9 -0
- package/esm/typings/src/utils/color/utils/colorToDataUrl.d.ts +10 -0
- package/esm/typings/src/utils/color/utils/mixColors.d.ts +11 -0
- package/esm/typings/src/utils/organization/preserve.d.ts +21 -0
- package/esm/typings/src/utils/take/classes/TakeChain.d.ts +11 -0
- package/esm/typings/src/utils/take/interfaces/ITakeChain.d.ts +12 -0
- package/esm/typings/src/utils/take/interfaces/Takeable.d.ts +7 -0
- package/esm/typings/src/utils/take/take.d.ts +12 -0
- package/esm/typings/src/utils/take/take.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +0 -14
package/README.md
CHANGED
|
@@ -10,14 +10,18 @@ Write AI applications using plain human language across multiple models and plat
|
|
|
10
10
|
[ Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
|
|
11
11
|
[ Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
|
|
12
12
|
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
13
|
-
[](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml)
|
|
14
|
+
[](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml)
|
|
15
|
+
[](https://github.com/webgptorg/promptbook/actions/workflows/test-lint.yml)
|
|
16
|
+
[](https://github.com/webgptorg/promptbook/actions/workflows/test-spell-check.yml)
|
|
17
|
+
[](https://github.com/webgptorg/promptbook/actions/workflows/test-types.yml)
|
|
15
18
|
[](https://github.com/webgptorg/promptbook/issues)
|
|
16
19
|
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
## 🌟 New Features
|
|
20
23
|
|
|
24
|
+
- 🚀 **GPT-5 Support** - Now includes OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window
|
|
21
25
|
- 💡 VS Code support for `.book` files with syntax highlighting and IntelliSense
|
|
22
26
|
- 🐳 Official Docker image (`hejny/promptbook`) for seamless containerized usage
|
|
23
27
|
- 🔥 Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
|
|
@@ -25,10 +29,6 @@ Write AI applications using plain human language across multiple models and plat
|
|
|
25
29
|
|
|
26
30
|
|
|
27
31
|
|
|
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
32
|
## 📦 Package `@promptbook/types`
|
|
33
33
|
|
|
34
34
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -85,8 +85,6 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
85
85
|
|
|
86
86
|
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**!
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
88
|
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!
|
|
91
89
|
|
|
92
90
|
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.
|
|
@@ -212,8 +210,6 @@ Join our growing community of developers and users:
|
|
|
212
210
|
|
|
213
211
|
_A concise, Markdown-based DSL for crafting AI workflows and automations._
|
|
214
212
|
|
|
215
|
-
|
|
216
|
-
|
|
217
213
|
### Introduction
|
|
218
214
|
|
|
219
215
|
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.
|
|
@@ -263,8 +259,6 @@ Personas can have access to different knowledge, tools and actions. They can als
|
|
|
263
259
|
|
|
264
260
|
- [PERSONA](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PERSONA.md)
|
|
265
261
|
|
|
266
|
-
|
|
267
|
-
|
|
268
262
|
### **3. How:** Knowledge, Instruments and Actions
|
|
269
263
|
|
|
270
264
|
The resources used by the personas are used to do the work.
|
|
@@ -339,6 +333,7 @@ Or you can install them separately:
|
|
|
339
333
|
- **[@promptbook/editable](https://www.npmjs.com/package/@promptbook/editable)** - Editable book as native javascript object with imperative object API
|
|
340
334
|
- **[@promptbook/templates](https://www.npmjs.com/package/@promptbook/templates)** - Useful templates and examples of books which can be used as a starting point
|
|
341
335
|
- **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
|
|
336
|
+
- **[@promptbook/color](https://www.npmjs.com/package/@promptbook/color)** - Color manipulation library
|
|
342
337
|
- ⭐ **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
|
|
343
338
|
- 🐋 **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Promptbook server
|
|
344
339
|
|
|
@@ -364,8 +359,6 @@ The following glossary is used to clarify certain concepts:
|
|
|
364
359
|
|
|
365
360
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
366
361
|
|
|
367
|
-
|
|
368
|
-
|
|
369
362
|
### 💯 Core concepts
|
|
370
363
|
|
|
371
364
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { $randomColor } from '../utils/color/$randomColor';
|
|
3
|
+
import { Color } from '../utils/color/Color';
|
|
4
|
+
import { CSS_COLORS } from '../utils/color/css-colors';
|
|
5
|
+
import type { ColorTransformer } from '../utils/color/operators/ColorTransformer';
|
|
6
|
+
import { darken } from '../utils/color/operators/darken';
|
|
7
|
+
import { furthest } from '../utils/color/operators/furthest';
|
|
8
|
+
import { textColor } from '../utils/color/operators/furthest';
|
|
9
|
+
import { grayscale } from '../utils/color/operators/grayscale';
|
|
10
|
+
import { lighten } from '../utils/color/operators/lighten';
|
|
11
|
+
import { mixWithColor } from '../utils/color/operators/mixWithColor';
|
|
12
|
+
import { nearest } from '../utils/color/operators/nearest';
|
|
13
|
+
import { negative } from '../utils/color/operators/negative';
|
|
14
|
+
import { negativeLightness } from '../utils/color/operators/negativeLightness';
|
|
15
|
+
import { withAlpha } from '../utils/color/operators/withAlpha';
|
|
16
|
+
import { areColorsEqual } from '../utils/color/utils/areColorsEqual';
|
|
17
|
+
import { colorDistance } from '../utils/color/utils/colorDistance';
|
|
18
|
+
import { colorDistanceSquared } from '../utils/color/utils/colorDistance';
|
|
19
|
+
import { colorHue } from '../utils/color/utils/colorHue';
|
|
20
|
+
import { colorHueDistance } from '../utils/color/utils/colorHueDistance';
|
|
21
|
+
import { colorLuminance } from '../utils/color/utils/colorLuminance';
|
|
22
|
+
import { colorSatulightion } from '../utils/color/utils/colorSatulightion';
|
|
23
|
+
import { colorSaturation } from '../utils/color/utils/colorSaturation';
|
|
24
|
+
import { colorToDataUrl } from '../utils/color/utils/colorToDataUrl';
|
|
25
|
+
import { mixColors } from '../utils/color/utils/mixColors';
|
|
26
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
27
|
+
export { $randomColor };
|
|
28
|
+
export { Color };
|
|
29
|
+
export { CSS_COLORS };
|
|
30
|
+
export type { ColorTransformer };
|
|
31
|
+
export { darken };
|
|
32
|
+
export { furthest };
|
|
33
|
+
export { textColor };
|
|
34
|
+
export { grayscale };
|
|
35
|
+
export { lighten };
|
|
36
|
+
export { mixWithColor };
|
|
37
|
+
export { nearest };
|
|
38
|
+
export { negative };
|
|
39
|
+
export { negativeLightness };
|
|
40
|
+
export { withAlpha };
|
|
41
|
+
export { areColorsEqual };
|
|
42
|
+
export { colorDistance };
|
|
43
|
+
export { colorDistanceSquared };
|
|
44
|
+
export { colorHue };
|
|
45
|
+
export { colorHueDistance };
|
|
46
|
+
export { colorLuminance };
|
|
47
|
+
export { colorSatulightion };
|
|
48
|
+
export { colorSaturation };
|
|
49
|
+
export { colorToDataUrl };
|
|
50
|
+
export { mixColors };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
|
|
3
|
+
import { AvatarChip } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
|
|
4
|
+
import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
|
5
|
+
import { AvatarChipFromSource } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
|
6
|
+
import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
|
7
|
+
import { AvatarProfile } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
|
8
|
+
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
|
9
|
+
import { AvatarProfileFromSource } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
|
10
|
+
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
|
11
|
+
import { BookEditor } from '../book-components/BookEditor/BookEditor';
|
|
12
|
+
import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
|
|
13
|
+
import { Chat } from '../book-components/Chat/Chat/Chat';
|
|
14
|
+
import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
|
|
15
|
+
import { LlmChat } from '../book-components/Chat/LlmChat/LlmChat';
|
|
16
|
+
import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
|
|
17
|
+
import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
|
|
18
|
+
import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
|
|
19
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
20
|
+
export type { AvatarChipProps };
|
|
21
|
+
export { AvatarChip };
|
|
22
|
+
export type { AvatarChipFromSourceProps };
|
|
23
|
+
export { AvatarChipFromSource };
|
|
24
|
+
export type { AvatarProfileProps };
|
|
25
|
+
export { AvatarProfile };
|
|
26
|
+
export type { AvatarProfileFromSourceProps };
|
|
27
|
+
export { AvatarProfileFromSource };
|
|
28
|
+
export type { BookEditorProps };
|
|
29
|
+
export { BookEditor };
|
|
30
|
+
export { DEFAULT_BOOK_FONT_CLASS };
|
|
31
|
+
export { Chat };
|
|
32
|
+
export type { ChatProps };
|
|
33
|
+
export { LlmChat };
|
|
34
|
+
export type { LlmChatProps };
|
|
35
|
+
export type { ChatMessage };
|
|
36
|
+
export type { ChatParticipant };
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
|
|
3
|
+
import { isValidBook } from '../book-2.0/agent-source/string_book';
|
|
4
|
+
import { validateBook } from '../book-2.0/agent-source/string_book';
|
|
5
|
+
import { DEFAULT_BOOK } from '../book-2.0/agent-source/string_book';
|
|
6
|
+
import { createEmptyAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
|
|
7
|
+
import { createBasicAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
|
|
8
|
+
import { NotYetImplementedCommitmentDefinition } from '../book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition';
|
|
9
|
+
import { createAgentModelRequirements } from '../book-2.0/commitments/_misc/createAgentModelRequirements';
|
|
10
|
+
import { getCommitmentDefinition } from '../book-2.0/commitments/index';
|
|
11
|
+
import { getAllCommitmentDefinitions } from '../book-2.0/commitments/index';
|
|
12
|
+
import { getAllCommitmentTypes } from '../book-2.0/commitments/index';
|
|
13
|
+
import { isCommitmentSupported } from '../book-2.0/commitments/index';
|
|
2
14
|
import { collectionToJson } from '../collection/collectionToJson';
|
|
3
15
|
import { createCollectionFromJson } from '../collection/constructors/createCollectionFromJson';
|
|
4
16
|
import { createCollectionFromPromise } from '../collection/constructors/createCollectionFromPromise';
|
|
@@ -34,8 +46,11 @@ import { DEFAULT_CSV_SETTINGS } from '../config';
|
|
|
34
46
|
import { DEFAULT_IS_VERBOSE } from '../config';
|
|
35
47
|
import { SET_IS_VERBOSE } from '../config';
|
|
36
48
|
import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
|
|
49
|
+
import { DEFAULT_TASK_SIMULATED_DURATION_MS } from '../config';
|
|
37
50
|
import { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME } from '../config';
|
|
38
51
|
import { DEFAULT_MAX_REQUESTS_PER_MINUTE } from '../config';
|
|
52
|
+
import { API_REQUEST_TIMEOUT } from '../config';
|
|
53
|
+
import { PROMPTBOOK_LOGO_URL } from '../config';
|
|
39
54
|
import { MODEL_TRUST_LEVELS } from '../constants';
|
|
40
55
|
import { MODEL_ORDERS } from '../constants';
|
|
41
56
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
|
@@ -148,6 +163,18 @@ import { SectionTypes } from '../types/SectionType';
|
|
|
148
163
|
import { TaskTypes } from '../types/TaskType';
|
|
149
164
|
import { REMOTE_SERVER_URLS } from '../../servers';
|
|
150
165
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
166
|
+
export { parseAgentSource };
|
|
167
|
+
export { isValidBook };
|
|
168
|
+
export { validateBook };
|
|
169
|
+
export { DEFAULT_BOOK };
|
|
170
|
+
export { createEmptyAgentModelRequirements };
|
|
171
|
+
export { createBasicAgentModelRequirements };
|
|
172
|
+
export { NotYetImplementedCommitmentDefinition };
|
|
173
|
+
export { createAgentModelRequirements };
|
|
174
|
+
export { getCommitmentDefinition };
|
|
175
|
+
export { getAllCommitmentDefinitions };
|
|
176
|
+
export { getAllCommitmentTypes };
|
|
177
|
+
export { isCommitmentSupported };
|
|
151
178
|
export { collectionToJson };
|
|
152
179
|
export { createCollectionFromJson };
|
|
153
180
|
export { createCollectionFromPromise };
|
|
@@ -183,8 +210,11 @@ export { DEFAULT_CSV_SETTINGS };
|
|
|
183
210
|
export { DEFAULT_IS_VERBOSE };
|
|
184
211
|
export { SET_IS_VERBOSE };
|
|
185
212
|
export { DEFAULT_IS_AUTO_INSTALLED };
|
|
213
|
+
export { DEFAULT_TASK_SIMULATED_DURATION_MS };
|
|
186
214
|
export { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME };
|
|
187
215
|
export { DEFAULT_MAX_REQUESTS_PER_MINUTE };
|
|
216
|
+
export { API_REQUEST_TIMEOUT };
|
|
217
|
+
export { PROMPTBOOK_LOGO_URL };
|
|
188
218
|
export { MODEL_TRUST_LEVELS };
|
|
189
219
|
export { MODEL_ORDERS };
|
|
190
220
|
export { ORDER_OF_PIPELINE_JSON };
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import type { AgentBasicInformation } from '../book-2.0/agent-source/parseAgentSource';
|
|
2
|
+
import type { string_book } from '../book-2.0/agent-source/string_book';
|
|
3
|
+
import type { BookCommitment } from '../book-2.0/commitments/_base/BookCommitment';
|
|
4
|
+
import type { CommitmentDefinition } from '../book-2.0/commitments/_base/CommitmentDefinition';
|
|
5
|
+
import type { AgentModelRequirements } from '../book-2.0/commitments/_misc/AgentModelRequirements';
|
|
6
|
+
import type { AgentSourceParseResult } from '../book-2.0/commitments/_misc/AgentSourceParseResult';
|
|
7
|
+
import type { ParsedCommitment } from '../book-2.0/commitments/_misc/ParsedCommitment';
|
|
8
|
+
import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
|
|
9
|
+
import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
|
10
|
+
import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
|
11
|
+
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
|
12
|
+
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
|
13
|
+
import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
|
|
14
|
+
import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
|
|
15
|
+
import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
|
|
16
|
+
import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
|
|
1
17
|
import type { PipelineCollection } from '../collection/PipelineCollection';
|
|
2
18
|
import type { Command } from '../commands/_common/types/Command';
|
|
3
19
|
import type { CommandParser } from '../commands/_common/types/CommandParser';
|
|
@@ -177,6 +193,7 @@ import type { InputParameters } from '../types/typeAliases';
|
|
|
177
193
|
import type { string_reserved_parameter_name } from '../types/typeAliases';
|
|
178
194
|
import type { ReservedParameters } from '../types/typeAliases';
|
|
179
195
|
import type { string_title } from '../types/typeAliases';
|
|
196
|
+
import type { string_agent_name } from '../types/typeAliases';
|
|
180
197
|
import type { string_persona_description } from '../types/typeAliases';
|
|
181
198
|
import type { string_model_description } from '../types/typeAliases';
|
|
182
199
|
import type { string_knowledge_source_content } from '../types/typeAliases';
|
|
@@ -282,6 +299,7 @@ import type { number_gigabytes } from '../types/typeAliases';
|
|
|
282
299
|
import type { number_terabytes } from '../types/typeAliases';
|
|
283
300
|
import type { Registered } from '../utils/$Register';
|
|
284
301
|
import type { Registration } from '../utils/$Register';
|
|
302
|
+
import type { ColorTransformer } from '../utils/color/operators/ColorTransformer';
|
|
285
303
|
import type { PipelineEditableSerialized } from '../utils/editable/types/PipelineEditableSerialized';
|
|
286
304
|
import type { ExecCommandOptions } from '../utils/execCommand/ExecCommandOptions';
|
|
287
305
|
import type { ExecCommandOptionsAdvanced } from '../utils/execCommand/ExecCommandOptions';
|
|
@@ -301,7 +319,24 @@ import type { really_any } from '../utils/organization/really_any';
|
|
|
301
319
|
import type { TODO_any } from '../utils/organization/TODO_any';
|
|
302
320
|
import type { CheckSerializableAsJsonOptions } from '../utils/serialization/checkSerializableAsJson';
|
|
303
321
|
import type { ExportJsonOptions } from '../utils/serialization/exportJson';
|
|
322
|
+
import type { ITakeChain } from '../utils/take/interfaces/ITakeChain';
|
|
304
323
|
import type { string_promptbook_version } from '../version';
|
|
324
|
+
export type { AgentBasicInformation };
|
|
325
|
+
export type { string_book };
|
|
326
|
+
export type { BookCommitment };
|
|
327
|
+
export type { CommitmentDefinition };
|
|
328
|
+
export type { AgentModelRequirements };
|
|
329
|
+
export type { AgentSourceParseResult };
|
|
330
|
+
export type { ParsedCommitment };
|
|
331
|
+
export type { AvatarChipProps };
|
|
332
|
+
export type { AvatarChipFromSourceProps };
|
|
333
|
+
export type { AvatarProfileProps };
|
|
334
|
+
export type { AvatarProfileFromSourceProps };
|
|
335
|
+
export type { BookEditorProps };
|
|
336
|
+
export type { ChatProps };
|
|
337
|
+
export type { LlmChatProps };
|
|
338
|
+
export type { ChatMessage };
|
|
339
|
+
export type { ChatParticipant };
|
|
305
340
|
export type { PipelineCollection };
|
|
306
341
|
export type { Command };
|
|
307
342
|
export type { CommandParser };
|
|
@@ -481,6 +516,7 @@ export type { InputParameters };
|
|
|
481
516
|
export type { string_reserved_parameter_name };
|
|
482
517
|
export type { ReservedParameters };
|
|
483
518
|
export type { string_title };
|
|
519
|
+
export type { string_agent_name };
|
|
484
520
|
export type { string_persona_description };
|
|
485
521
|
export type { string_model_description };
|
|
486
522
|
export type { string_knowledge_source_content };
|
|
@@ -586,6 +622,7 @@ export type { number_gigabytes };
|
|
|
586
622
|
export type { number_terabytes };
|
|
587
623
|
export type { Registered };
|
|
588
624
|
export type { Registration };
|
|
625
|
+
export type { ColorTransformer };
|
|
589
626
|
export type { PipelineEditableSerialized };
|
|
590
627
|
export type { ExecCommandOptions };
|
|
591
628
|
export type { ExecCommandOptionsAdvanced };
|
|
@@ -605,4 +642,5 @@ export type { really_any };
|
|
|
605
642
|
export type { TODO_any };
|
|
606
643
|
export type { CheckSerializableAsJsonOptions };
|
|
607
644
|
export type { ExportJsonOptions };
|
|
645
|
+
export type { ITakeChain };
|
|
608
646
|
export type { string_promptbook_version };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { string_agent_name } from '../../types/typeAliases';
|
|
2
|
+
import type { string_url_image } from '../../types/typeAliases';
|
|
3
|
+
import type { string_book } from './string_book';
|
|
4
|
+
export interface AgentBasicInformation {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the agent
|
|
7
|
+
* This is the first line of the agent source
|
|
8
|
+
*/
|
|
9
|
+
agentName: string_agent_name | null;
|
|
10
|
+
/**
|
|
11
|
+
* Optional description of the agent
|
|
12
|
+
* This is the line starting with "PERSONA"
|
|
13
|
+
*/
|
|
14
|
+
personaDescription: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Optional profile image URL
|
|
17
|
+
* This is the line starting with "META IMAGE"
|
|
18
|
+
*/
|
|
19
|
+
profileImageUrl: string_url_image;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parses basic information from agent source
|
|
23
|
+
*
|
|
24
|
+
* There are 2 similar functions:
|
|
25
|
+
* - `parseAgentSource` which is a lightweight parser for agent source, it parses basic information and its purpose is to be quick and synchronous. The commitments there are hardcoded.
|
|
26
|
+
* - `createAgentModelRequirements` which is an asynchronous function that creates model requirements it applies each commitment one by one and works asynchronously.
|
|
27
|
+
*
|
|
28
|
+
* @public exported from `@promptbook/core`
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseAgentSource(agentSource: string_book): AgentBasicInformation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded type for books
|
|
3
|
+
*/
|
|
4
|
+
export type string_book = string & {
|
|
5
|
+
readonly __type: 'book';
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Type guard to check if a string is a valid agent source
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/core`
|
|
11
|
+
*/
|
|
12
|
+
export declare function isValidBook(value: string): value is string_book;
|
|
13
|
+
/**
|
|
14
|
+
* Validates and converts a string to agent source branded type
|
|
15
|
+
* This function should be used when you have a string that you know represents agent source
|
|
16
|
+
* but need to convert it to the branded type for type safety
|
|
17
|
+
*
|
|
18
|
+
* @public exported from `@promptbook/core`
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateBook(source: string): string_book;
|
|
21
|
+
/**
|
|
22
|
+
* Default book
|
|
23
|
+
*
|
|
24
|
+
* @public exported from `@promptbook/core`
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_BOOK: string_book;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
+
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
|
+
/**
|
|
4
|
+
* ACTION commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The ACTION commitment defines specific actions or capabilities that the agent can perform.
|
|
7
|
+
* This helps define what the agent is capable of doing and how it should approach tasks.
|
|
8
|
+
*
|
|
9
|
+
* Example usage in agent source:
|
|
10
|
+
*
|
|
11
|
+
* ```book
|
|
12
|
+
* ACTION Can generate code snippets and explain programming concepts
|
|
13
|
+
* ACTION Able to analyze data and provide insights
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
17
|
+
*/
|
|
18
|
+
export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition<'ACTION'> {
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Short one-line description of ACTION.
|
|
22
|
+
*/
|
|
23
|
+
get description(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Markdown documentation for ACTION commitment.
|
|
26
|
+
*/
|
|
27
|
+
get documentation(): string;
|
|
28
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Singleton instance of the ACTION commitment definition
|
|
32
|
+
*
|
|
33
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
34
|
+
*/
|
|
35
|
+
export declare const ActionCommitment: ActionCommitmentDefinition;
|
|
36
|
+
/**
|
|
37
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
38
|
+
*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
+
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
|
+
/**
|
|
4
|
+
* FORMAT commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The FORMAT commitment defines the specific output structure and formatting
|
|
7
|
+
* that the agent should use in its responses. This includes data formats,
|
|
8
|
+
* response templates, and structural requirements.
|
|
9
|
+
*
|
|
10
|
+
* Example usage in agent source:
|
|
11
|
+
*
|
|
12
|
+
* ```book
|
|
13
|
+
* FORMAT Always respond in JSON format with 'status' and 'data' fields
|
|
14
|
+
* FORMAT Use markdown formatting for all code blocks
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
18
|
+
*/
|
|
19
|
+
export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition<'FORMAT'> {
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of FORMAT.
|
|
23
|
+
*/
|
|
24
|
+
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Markdown documentation for FORMAT commitment.
|
|
27
|
+
*/
|
|
28
|
+
get documentation(): string;
|
|
29
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Singleton instance of the FORMAT commitment definition
|
|
33
|
+
*
|
|
34
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
35
|
+
*/
|
|
36
|
+
export declare const FormatCommitment: FormatCommitmentDefinition;
|
|
37
|
+
/**
|
|
38
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
39
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
+
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
|
+
/**
|
|
4
|
+
* KNOWLEDGE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The KNOWLEDGE commitment adds specific knowledge, facts, or context to the agent
|
|
7
|
+
* using RAG (Retrieval-Augmented Generation) approach for external sources.
|
|
8
|
+
*
|
|
9
|
+
* Supports both direct text knowledge and external sources like PDFs.
|
|
10
|
+
*
|
|
11
|
+
* Example usage in agent source:
|
|
12
|
+
*
|
|
13
|
+
* ```book
|
|
14
|
+
* KNOWLEDGE The company was founded in 2020 and specializes in AI-powered solutions
|
|
15
|
+
* KNOWLEDGE https://example.com/company-handbook.pdf
|
|
16
|
+
* KNOWLEDGE https://example.com/product-documentation.pdf
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
20
|
+
*/
|
|
21
|
+
export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition<'KNOWLEDGE'> {
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Short one-line description of KNOWLEDGE.
|
|
25
|
+
*/
|
|
26
|
+
get description(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Markdown documentation for KNOWLEDGE commitment.
|
|
29
|
+
*/
|
|
30
|
+
get documentation(): string;
|
|
31
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
32
|
+
/**
|
|
33
|
+
* Check if content is a URL
|
|
34
|
+
*/
|
|
35
|
+
private isUrl;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Singleton instance of the KNOWLEDGE commitment definition
|
|
39
|
+
*
|
|
40
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
41
|
+
*/
|
|
42
|
+
export declare const KnowledgeCommitment: KnowledgeCommitmentDefinition;
|
|
43
|
+
/**
|
|
44
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
45
|
+
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
+
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
|
+
/**
|
|
4
|
+
* META IMAGE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The META IMAGE commitment sets the agent's avatar/profile image URL.
|
|
7
|
+
* This commitment is special because it doesn't affect the system message,
|
|
8
|
+
* but is handled separately in the parsing logic.
|
|
9
|
+
*
|
|
10
|
+
* Example usage in agent source:
|
|
11
|
+
*
|
|
12
|
+
* ```book
|
|
13
|
+
* META IMAGE https://example.com/avatar.jpg
|
|
14
|
+
* META IMAGE /assets/agent-avatar.png
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
18
|
+
*/
|
|
19
|
+
export declare class MetaImageCommitmentDefinition extends BaseCommitmentDefinition<'META IMAGE'> {
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of META IMAGE.
|
|
23
|
+
*/
|
|
24
|
+
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Markdown documentation for META IMAGE commitment.
|
|
27
|
+
*/
|
|
28
|
+
get documentation(): string;
|
|
29
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts the profile image URL from the content
|
|
32
|
+
* This is used by the parsing logic
|
|
33
|
+
*/
|
|
34
|
+
extractProfileImageUrl(content: string): string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Singleton instance of the META IMAGE commitment definition
|
|
38
|
+
*
|
|
39
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
40
|
+
*/
|
|
41
|
+
export declare const MetaImageCommitment: MetaImageCommitmentDefinition;
|
|
42
|
+
/**
|
|
43
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
44
|
+
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
+
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
|
+
/**
|
|
4
|
+
* META LINK commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The `META LINK` commitment represents the link to the person from whom the agent is created.
|
|
7
|
+
* This commitment is special because it doesn't affect the system message,
|
|
8
|
+
* but is handled separately in the parsing logic for profile display.
|
|
9
|
+
*
|
|
10
|
+
* Example usage in agent source:
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* META LINK https://twitter.com/username
|
|
14
|
+
* META LINK https://linkedin.com/in/profile
|
|
15
|
+
* META LINK https://github.com/username
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Multiple `META LINK` commitments can be used when there are multiple sources:
|
|
19
|
+
*
|
|
20
|
+
* ```book
|
|
21
|
+
* META LINK https://twitter.com/username
|
|
22
|
+
* META LINK https://linkedin.com/in/profile
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
26
|
+
*/
|
|
27
|
+
export declare class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition<'META LINK'> {
|
|
28
|
+
constructor();
|
|
29
|
+
/**
|
|
30
|
+
* Short one-line description of META LINK.
|
|
31
|
+
*/
|
|
32
|
+
get description(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Markdown documentation for META LINK commitment.
|
|
35
|
+
*/
|
|
36
|
+
get documentation(): string;
|
|
37
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the profile link URL from the content
|
|
40
|
+
* This is used by the parsing logic
|
|
41
|
+
*/
|
|
42
|
+
extractProfileLinkUrl(content: string): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Validates if the provided content is a valid URL
|
|
45
|
+
*/
|
|
46
|
+
isValidUrl(content: string): boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Singleton instance of the META LINK commitment definition
|
|
50
|
+
*
|
|
51
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
52
|
+
*/
|
|
53
|
+
export declare const MetaLinkCommitment: MetaLinkCommitmentDefinition;
|
|
54
|
+
/**
|
|
55
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
56
|
+
*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
+
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
|
+
/**
|
|
4
|
+
* MODEL commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The MODEL commitment specifies which AI model to use and can also set
|
|
7
|
+
* model-specific parameters like temperature, topP, and topK.
|
|
8
|
+
*
|
|
9
|
+
* Example usage in agent source:
|
|
10
|
+
*
|
|
11
|
+
* ```book
|
|
12
|
+
* MODEL gpt-4
|
|
13
|
+
* MODEL claude-3-opus temperature=0.3
|
|
14
|
+
* MODEL gpt-3.5-turbo temperature=0.8 topP=0.9
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
18
|
+
*/
|
|
19
|
+
export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL'> {
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of MODEL.
|
|
23
|
+
*/
|
|
24
|
+
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Markdown documentation for MODEL commitment.
|
|
27
|
+
*/
|
|
28
|
+
get documentation(): string;
|
|
29
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Singleton instance of the MODEL commitment definition
|
|
33
|
+
*
|
|
34
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
35
|
+
*/
|
|
36
|
+
export declare const ModelCommitment: ModelCommitmentDefinition;
|
|
37
|
+
/**
|
|
38
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
39
|
+
*/
|