@promptbook/ollama 0.100.4-0 → 0.101.0-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/esm/index.es.js +8 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +4 -2
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +14 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -6
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +21 -0
- package/esm/typings/src/book-2.0/{commitments/_misc → agent-source}/AgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/book-2.0/{commitments/_misc → agent-source}/AgentSourceParseResult.d.ts +3 -1
- package/esm/typings/src/book-2.0/{commitments/_misc → agent-source}/createAgentModelRequirements.d.ts +2 -2
- package/esm/typings/src/book-2.0/{commitments/_misc → agent-source}/createAgentModelRequirementsWithCommitments.d.ts +3 -3
- package/esm/typings/src/book-2.0/{commitments/_misc → agent-source}/createCommitmentRegex.d.ts +2 -2
- package/esm/typings/src/book-2.0/agent-source/extractMetaLinks.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +4 -19
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +9 -0
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/{_misc → _base}/ParsedCommitment.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/book-2.0/utils/extractAgentMetadata.d.ts +17 -0
- package/esm/typings/src/book-2.0/utils/extractProfileImageFromSystemMessage.d.ts +12 -0
- package/esm/typings/src/book-2.0/utils/generateGravatarUrl.d.ts +10 -0
- package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +10 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +1 -1
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +2 -8
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +3 -1
- package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +12 -0
- package/esm/typings/src/utils/markdown/humanizeAiText.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +12 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +12 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextQuotes.d.ts +12 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +12 -0
- package/esm/typings/src/utils/markdown/promptbookifyAiText.d.ts +11 -0
- package/esm/typings/src/utils/markdown/promptbookifyAiText.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeMarkdownLinks.d.ts +11 -0
- package/esm/typings/src/utils/markdown/removeMarkdownLinks.test.d.ts +4 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +8 -1
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +0 -24
- package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +0 -39
- /package/esm/typings/src/book-2.0/{commitments/_misc → agent-source}/removeCommentsFromSystemMessage.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* META LINK commitment definition
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* MODEL commitment definition
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* NOTE commitment definition
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* PERSONA commitment definition
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* RULE commitment definition
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* SAMPLE commitment definition
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
2
|
-
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
|
|
3
3
|
/**
|
|
4
4
|
* STYLE commitment definition
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
2
2
|
import type { CommitmentDefinition } from './CommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* Base implementation of CommitmentDefinition that provides common functionality
|
package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from './BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* Placeholder commitment definition for commitments that are not yet implemented
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
2
2
|
/**
|
|
3
3
|
* Creates an empty/basic agent model requirements object
|
|
4
4
|
* This serves as the starting point for the reduce-like pattern
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { string_url_image } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts persona, examples, and profile image from agent definition text
|
|
4
|
+
* @param systemMessage The original system message that may contain PERSONA, EXAMPLE, and META IMAGE lines
|
|
5
|
+
* @returns Object with extracted information and cleaned system message
|
|
6
|
+
*
|
|
7
|
+
* @private - TODO: [🧠] Maybe should be public?
|
|
8
|
+
*/
|
|
9
|
+
export declare function extractAgentMetadata(systemMessage: string): {
|
|
10
|
+
persona?: {
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
};
|
|
14
|
+
examples: string[];
|
|
15
|
+
profileImageUrl?: string_url_image;
|
|
16
|
+
cleanedSystemMessage: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { string_url_image } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts profile image URL from agent definition text and returns cleaned system message
|
|
4
|
+
* @param systemMessage The original system message that may contain META IMAGE line
|
|
5
|
+
* @returns Object with profileImageUrl (if found) and cleanedSystemMessage (without META IMAGE line)
|
|
6
|
+
*
|
|
7
|
+
* @private - TODO: [🧠] Maybe should be public?
|
|
8
|
+
*/
|
|
9
|
+
export declare function extractProfileImageFromSystemMessage(systemMessage: string): {
|
|
10
|
+
profileImageUrl?: string_url_image;
|
|
11
|
+
cleanedSystemMessage: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { string_agent_name } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a gravatar URL based on agent name for fallback avatar
|
|
4
|
+
*
|
|
5
|
+
* @param agentName The agent name to generate avatar for
|
|
6
|
+
* @returns Gravatar URL
|
|
7
|
+
*
|
|
8
|
+
* @private - [🤹] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateGravatarUrl(agentName?: string_agent_name): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { string_agent_name, string_url_image } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Generates an image for the agent to use as profile image
|
|
4
|
+
*
|
|
5
|
+
* @param agentName The agent name to generate avatar for
|
|
6
|
+
* @returns The placeholder profile image URL for the agent
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
9
|
+
*/
|
|
10
|
+
export declare function generatePlaceholderAgentProfileImageUrl(agentName?: string_agent_name): string_url_image;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentBasicInformation } from '../../../book-2.0/agent-source/
|
|
1
|
+
import type { AgentBasicInformation } from '../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
2
|
import type { string_css_class } from '../../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Props of `AvatarChip`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentBasicInformation } from '../../../book-2.0/agent-source/
|
|
1
|
+
import type { AgentBasicInformation } from '../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
2
|
import type { string_css_class } from '../../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Props of `AvatarProfile`
|
|
@@ -9,10 +9,7 @@ export type AvatarProfileProps = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Agent to be shown
|
|
11
11
|
*/
|
|
12
|
-
readonly agent: AgentBasicInformation
|
|
13
|
-
agentTitle?: string;
|
|
14
|
-
agentDescription?: string;
|
|
15
|
-
};
|
|
12
|
+
readonly agent: AgentBasicInformation;
|
|
16
13
|
/**
|
|
17
14
|
* Optional CSS class name which will be added to root <div> element
|
|
18
15
|
*/
|
|
@@ -24,6 +21,3 @@ export type AvatarProfileProps = {
|
|
|
24
21
|
* @public exported from `@promptbook/components`
|
|
25
22
|
*/
|
|
26
23
|
export declare function AvatarProfile(props: AvatarProfileProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
/**
|
|
28
|
-
* TODO: [🕛] Unite `AvatarProfileProps`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
29
|
-
*/
|
|
@@ -79,6 +79,12 @@ export type ChatProps = {
|
|
|
79
79
|
onAssistantVoiceResponse?: (content: string, isVoiceCall: boolean) => void;
|
|
80
80
|
onVoiceCallStateChange?: (isVoiceCalling: boolean) => void;
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Indicates whether a the text is AI-generated and should be humanized
|
|
84
|
+
*
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
readonly isAiTextHumanized?: boolean;
|
|
82
88
|
/**
|
|
83
89
|
* Indicates whether a voice call is currently active
|
|
84
90
|
*/
|
|
@@ -28,5 +28,5 @@ export type ChatParticipant = {
|
|
|
28
28
|
color: string_color | Color;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* TODO: [🕛] Unite `
|
|
31
|
+
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
32
32
|
*/
|
|
@@ -76,6 +76,6 @@ export declare function getLlmProviderProfile(providerKey: keyof typeof LLM_PROV
|
|
|
76
76
|
export declare function createCustomLlmProfile(baseProfile: ChatParticipant, overrides: Partial<ChatParticipant>): ChatParticipant;
|
|
77
77
|
/**
|
|
78
78
|
* TODO: Refactor this - each profile must be alongside the provider definition
|
|
79
|
-
* TODO: [🕛] Unite `
|
|
79
|
+
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
80
80
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
81
81
|
*/
|
|
@@ -7,4 +7,5 @@ import type { ExpectationAmount } from '../../pipeline/PipelineJson/Expectations
|
|
|
7
7
|
export declare function countCharacters(text: string): ExpectationAmount;
|
|
8
8
|
/**
|
|
9
9
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
10
|
-
|
|
10
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
11
|
+
*/
|
|
@@ -9,4 +9,5 @@ import type { ExpectationAmount } from '../../pipeline/PipelineJson/Expectations
|
|
|
9
9
|
export declare function countLines(text: string): ExpectationAmount;
|
|
10
10
|
/**
|
|
11
11
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
12
|
-
|
|
12
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
13
|
+
*/
|
|
@@ -9,4 +9,5 @@ import type { ExpectationAmount } from '../../pipeline/PipelineJson/Expectations
|
|
|
9
9
|
export declare function countPages(text: string): ExpectationAmount;
|
|
10
10
|
/**
|
|
11
11
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
12
|
-
|
|
12
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
13
|
+
*/
|
|
@@ -7,4 +7,5 @@ import type { ExpectationAmount } from '../../pipeline/PipelineJson/Expectations
|
|
|
7
7
|
export declare function countParagraphs(text: string): ExpectationAmount;
|
|
8
8
|
/**
|
|
9
9
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
10
|
-
|
|
10
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
11
|
+
*/
|
|
@@ -13,4 +13,5 @@ export declare function splitIntoSentences(text: string): ReadonlyArray<string>;
|
|
|
13
13
|
export declare function countSentences(text: string): ExpectationAmount;
|
|
14
14
|
/**
|
|
15
15
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
16
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
16
17
|
*/
|
|
@@ -7,4 +7,6 @@ import type { ExpectationAmount } from '../../pipeline/PipelineJson/Expectations
|
|
|
7
7
|
export declare function countWords(text: string): ExpectationAmount;
|
|
8
8
|
/**
|
|
9
9
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
10
|
-
|
|
10
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
11
|
+
* TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
12
|
+
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { string_markdown } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Function `humanizeAiText` will remove traces of AI text generation artifacts
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want more control, look for other functions for example `humanizeAiTextEmdashed` exported `@promptbook/markdown-utils`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
8
|
+
*/
|
|
9
|
+
export declare function humanizeAiText(aiText: string_markdown): string_markdown;
|
|
10
|
+
/**
|
|
11
|
+
* TODO: [🅾️] !!! Use this across the project where AI text is involved
|
|
12
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { string_markdown } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Change ellipsis character to three dots `…` -> `...`
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want to do the full cleanup, look for `humanizeAiText` exported `@promptbook/markdown-utils`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
8
|
+
*/
|
|
9
|
+
export declare function humanizeAiTextEllipsis(aiText: string_markdown): string_markdown;
|
|
10
|
+
/**
|
|
11
|
+
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
12
|
+
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { string_markdown } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Change em-dashes to regular dashes `—` -> `-`
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want to do the full cleanup, look for `humanizeAiText` exported `@promptbook/markdown-utils`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
8
|
+
*/
|
|
9
|
+
export declare function humanizeAiTextEmdashed(aiText: string_markdown): string_markdown;
|
|
10
|
+
/**
|
|
11
|
+
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
12
|
+
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { string_markdown } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Change smart quotes to regular quotes
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want to do the full cleanup, look for `humanizeAiText` exported `@promptbook/markdown-utils`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
8
|
+
*/
|
|
9
|
+
export declare function humanizeAiTextQuotes(aiText: string_markdown): string_markdown;
|
|
10
|
+
/**
|
|
11
|
+
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
12
|
+
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { string_markdown } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Change unprintable hard spaces to regular spaces
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want to do the full cleanup, look for `humanizeAiText` exported `@promptbook/markdown-utils`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
8
|
+
*/
|
|
9
|
+
export declare function humanizeAiTextWhitespace(aiText: string_markdown): string_markdown;
|
|
10
|
+
/**
|
|
11
|
+
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
12
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { string_markdown } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Function `promptbookifyAiText` will slightly modify the text so we know it was processed by Promptbook
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
6
|
+
*/
|
|
7
|
+
export declare function promptbookifyAiText(text: string_markdown): string_markdown;
|
|
8
|
+
/**
|
|
9
|
+
* TODO: [🅾️]!!! Use this across the project where AI text is involved
|
|
10
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes Markdown link tags from a string.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} str - The string to remove Markdown tags from.
|
|
5
|
+
* @returns {string} The input string with all Markdown tags removed.
|
|
6
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
7
|
+
*/
|
|
8
|
+
export declare function removeMarkdownLinks(str: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* @see https://chat.openai.com/chat/bb7c3a5b-fe9c-4ccc-9057-f47e0fd66489
|
|
11
|
+
*/
|
|
@@ -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.100.
|
|
18
|
+
* It follows semantic versioning (e.g., `0.100.4-0`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/ollama",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.101.0-0",
|
|
4
4
|
"description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"module": "./esm/index.es.js",
|
|
95
95
|
"typings": "./esm/typings/src/_packages/ollama.index.d.ts",
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@promptbook/core": "0.
|
|
97
|
+
"@promptbook/core": "0.101.0-0"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"bottleneck": "^2.19.5",
|
package/umd/index.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-0';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -681,6 +681,7 @@
|
|
|
681
681
|
}
|
|
682
682
|
/**
|
|
683
683
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
684
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
684
685
|
*/
|
|
685
686
|
|
|
686
687
|
/**
|
|
@@ -715,6 +716,7 @@
|
|
|
715
716
|
}
|
|
716
717
|
/**
|
|
717
718
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
719
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
718
720
|
*/
|
|
719
721
|
|
|
720
722
|
/**
|
|
@@ -729,6 +731,7 @@
|
|
|
729
731
|
}
|
|
730
732
|
/**
|
|
731
733
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
734
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
732
735
|
*/
|
|
733
736
|
|
|
734
737
|
/**
|
|
@@ -741,6 +744,7 @@
|
|
|
741
744
|
}
|
|
742
745
|
/**
|
|
743
746
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
747
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
744
748
|
*/
|
|
745
749
|
|
|
746
750
|
/**
|
|
@@ -761,6 +765,7 @@
|
|
|
761
765
|
}
|
|
762
766
|
/**
|
|
763
767
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
768
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
764
769
|
*/
|
|
765
770
|
|
|
766
771
|
const defaultDiacriticsRemovalMap = [
|
|
@@ -1038,6 +1043,8 @@
|
|
|
1038
1043
|
}
|
|
1039
1044
|
/**
|
|
1040
1045
|
* TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
1046
|
+
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
1047
|
+
* TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
1041
1048
|
*/
|
|
1042
1049
|
|
|
1043
1050
|
/**
|