Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

@promptbook/anthropic-claude

Package Overview
Dependencies
Maintainers
1
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptbook/anthropic-claude - npm Package Compare versions

Comparing version 0.68.0-0 to 0.68.0-1

esm/typings/src/commands/FOREACH/ForeachCommand.d.ts

23

esm/typings/promptbook-collection/index.d.ts

@@ -11,12 +11,9 @@ declare const _default: ({

}[];
promptTemplates: {
templates: {
blockType: string;
name: string;
title: string;
modelRequirements: {
modelVariant: string;
};
content: string;
resultingParameterName: string;
dependentParameterNames: string[];
resultingParameterName: string;
}[];

@@ -38,10 +35,8 @@ knowledgeSources: never[];

}[];
promptTemplates: {
templates: {
blockType: string;
name: string;
title: string;
modelRequirements: {
modelVariant: string;
};
content: string;
resultingParameterName: string;
expectations: {

@@ -54,3 +49,2 @@ words: {

dependentParameterNames: string[];
resultingParameterName: string;
}[];

@@ -72,13 +66,10 @@ knowledgeSources: never[];

}[];
promptTemplates: {
templates: {
blockType: string;
name: string;
title: string;
modelRequirements: {
modelVariant: string;
};
content: string;
expectFormat: string;
resultingParameterName: string;
format: string;
dependentParameterNames: string[];
resultingParameterName: string;
}[];

@@ -85,0 +76,0 @@ knowledgeSources: never[];

@@ -35,3 +35,3 @@ import { PROMPTBOOK_VERSION } from '../version';

import { NotYetImplementedError } from '../errors/NotYetImplementedError';
import { ParsingError } from '../errors/ParsingError';
import { ParseError } from '../errors/ParseError';
import { PipelineExecutionError } from '../errors/PipelineExecutionError';

@@ -109,3 +109,3 @@ import { PipelineLogicError } from '../errors/PipelineLogicError';

export { NotYetImplementedError };
export { ParsingError };
export { ParseError };
export { PipelineExecutionError };

@@ -112,0 +112,0 @@ export { PipelineLogicError };

import type { PipelineCollection } from '../collection/PipelineCollection';
import type { Command } from '../commands/_common/types/Command';
import type { CommandParser } from '../commands/_common/types/CommandParser';
import type { PipelineBothCommandParser } from '../commands/_common/types/CommandParser';
import type { PipelineHeadCommandParser } from '../commands/_common/types/CommandParser';
import type { PipelineTemplateCommandParser } from '../commands/_common/types/CommandParser';
import type { CommandParserInput } from '../commands/_common/types/CommandParser';
import type { ApplyToPipelineJsonSubjects } from '../commands/_common/types/CommandParser';
import type { CommandUsagePlace } from '../commands/_common/types/CommandUsagePlaces';
import type { BlockType } from '../commands/BLOCK/BlockTypes';
import type { ExpectAmountCommand } from '../commands/EXPECT/ExpectAmountCommand';
import type { ExpectFormatCommand } from '../commands/EXPECT/ExpectFormatCommand';
import type { ExpectCommand } from '../commands/EXPECT/ExpectCommand';
import type { FormatCommand } from '../commands/FORMAT/FormatCommand';
import type { PipelineStringToJsonOptions } from '../conversion/pipelineStringToJson';

@@ -15,3 +17,2 @@ import type { PrettifyOptions } from '../conversion/prettify/PrettifyOptions';

import type { AvailableModel } from '../execution/AvailableModel';
import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
import type { EmbeddingVector } from '../execution/EmbeddingVector';

@@ -27,3 +28,2 @@ import type { ExecutionTools } from '../execution/ExecutionTools';

import type { EmbeddingPromptResult } from '../execution/PromptResult';
import type { CommonPromptResult } from '../execution/PromptResult';
import type { PromptResultUsage } from '../execution/PromptResultUsage';

@@ -77,4 +77,4 @@ import type { PromptResultUsageCounts } from '../execution/PromptResultUsage';

import type { EmbeddingModelRequirements } from '../types/ModelRequirements';
import type { CommonModelRequirements } from '../types/ModelRequirements';
import type { ModelVariant } from '../types/ModelVariant';
import type { DialogTemplateJson } from '../types/PipelineJson/DialogTemplateJson';
import type { Expectations } from '../types/PipelineJson/Expectations';

@@ -86,3 +86,3 @@ import type { ExpectationUnit } from '../types/PipelineJson/Expectations';

import type { KnowledgeSourcePreparedJson } from '../types/PipelineJson/KnowledgeSourceJson';
import type { LlmTemplateJson } from '../types/PipelineJson/LlmTemplateJson';
import type { ParameterJson } from '../types/PipelineJson/ParameterJson';
import type { PersonaJson } from '../types/PipelineJson/PersonaJson';

@@ -92,8 +92,7 @@ import type { PersonaPreparedJson } from '../types/PipelineJson/PersonaJson';

import type { PreparationJson } from '../types/PipelineJson/PreparationJson';
import type { PromptDialogJson } from '../types/PipelineJson/PromptDialogJson';
import type { PromptTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
import type { PromptTemplateJsonCommon } from '../types/PipelineJson/PromptTemplateJsonCommon';
import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
import type { ScriptJson } from '../types/PipelineJson/ScriptJson';
import type { ScriptTemplateJson } from '../types/PipelineJson/ScriptTemplateJson';
import type { SimpleTemplateJson } from '../types/PipelineJson/SimpleTemplateJson';
import type { TemplateJson } from '../types/PipelineJson/TemplateJson';
import type { TemplateJsonCommon } from '../types/PipelineJson/TemplateJsonCommon';
import type { PipelineString } from '../types/PipelineString';

@@ -104,3 +103,2 @@ import type { Prompt } from '../types/Prompt';

import type { EmbeddingPrompt } from '../types/Prompt';
import type { CommonPrompt } from '../types/Prompt';
import type { ScriptLanguage } from '../types/ScriptLanguage';

@@ -236,8 +234,10 @@ import type { TaskProgress } from '../types/TaskProgress';

export type { CommandParser };
export type { PipelineBothCommandParser };
export type { PipelineHeadCommandParser };
export type { PipelineTemplateCommandParser };
export type { CommandParserInput };
export type { ApplyToPipelineJsonSubjects };
export type { CommandUsagePlace };
export type { BlockType };
export type { ExpectAmountCommand };
export type { ExpectFormatCommand };
export type { ExpectCommand };
export type { FormatCommand };
export type { PipelineStringToJsonOptions };

@@ -248,3 +248,2 @@ export type { PrettifyOptions };

export type { AvailableModel };
export type { CommonExecutionToolsOptions };
export type { EmbeddingVector };

@@ -260,3 +259,2 @@ export type { ExecutionTools };

export type { EmbeddingPromptResult };
export type { CommonPromptResult };
export type { PromptResultUsage };

@@ -310,4 +308,4 @@ export type { PromptResultUsageCounts };

export type { EmbeddingModelRequirements };
export type { CommonModelRequirements };
export type { ModelVariant };
export type { DialogTemplateJson };
export type { Expectations };

@@ -319,3 +317,3 @@ export type { ExpectationUnit };

export type { KnowledgeSourcePreparedJson };
export type { LlmTemplateJson };
export type { ParameterJson };
export type { PersonaJson };

@@ -325,8 +323,7 @@ export type { PersonaPreparedJson };

export type { PreparationJson };
export type { PromptDialogJson };
export type { PromptTemplateJson };
export type { PromptTemplateJsonCommon };
export type { PromptTemplateParameterJson };
export type { ScriptJson };
export type { ScriptTemplateJson };
export type { SimpleTemplateJson };
export type { TemplateJson };
export type { TemplateJsonCommon };
export type { PipelineString };

@@ -337,3 +334,2 @@ export type { Prompt };

export type { EmbeddingPrompt };
export type { CommonPrompt };
export type { ScriptLanguage };

@@ -340,0 +336,0 @@ export type { TaskProgress };

import { PROMPTBOOK_VERSION } from '../version';
import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
import { extractParameterNamesFromPromptTemplate } from '../conversion/utils/extractParameterNamesFromPromptTemplate';
import { extractParameterNamesFromTemplate } from '../conversion/utils/extractParameterNamesFromTemplate';
import { extractVariables } from '../conversion/utils/extractVariables';

@@ -74,3 +74,3 @@ import { renameParameter } from '../conversion/utils/renameParameter';

export { renderPromptbookMermaid };
export { extractParameterNamesFromPromptTemplate };
export { extractParameterNamesFromTemplate };
export { extractVariables };

@@ -77,0 +77,0 @@ export { renameParameter };

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineBothCommandParser } from '../_common/types/CommandParser';
import type { BoilerplateCommand } from './BoilerplateCommand';

@@ -6,8 +6,10 @@ /**

*
* @see ./BOILERPLATE-README.md for more details
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.ptbk.md` file
*
* @see ./BOILERPLATE-README.md for more details <- TODO: @@@ Write theese README files OR remove this link + add annotation here (to all commands)
* @private within the commands folder
*/
export declare const boilerplateCommandParser: CommandParser<BoilerplateCommand>;
export declare const boilerplateCommandParser: PipelineBothCommandParser<BoilerplateCommand>;
/**
* TODO: [๐Ÿ’] Implement BOILERPLATE command into `pipelineStringToJsonSync` function
* TODO: !!!!!! Make .ptbk.md file with examples of the BOILERPLATE command and fail
*/

@@ -8,3 +8,3 @@ import type { string_markdown_text } from '../../types/typeAliases';

* @returns parsed command object
* @throws {ParsingError} if the command is invalid
* @throws {ParseError} if the command is invalid
*

@@ -11,0 +11,0 @@ * @private within the pipelineStringToJson

import type { WritableDeep } from 'type-fest';
import type { PromptTemplateJson } from '../../../types/PipelineJson/PromptTemplateJson';
import type { PipelineJson } from '../../../types/PipelineJson/PipelineJson';
import type { TemplateJson } from '../../../types/PipelineJson/TemplateJson';
import type { string_markdown_text } from '../../../types/typeAliases';

@@ -8,58 +8,165 @@ import type { string_name } from '../../../types/typeAliases';

import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
import type { ___and___ } from '../../../utils/organization/___and___';
import type { CommandUsagePlace } from './CommandUsagePlaces';
export type CommandParser<TCommand extends {
/**
* @@@
*
* @private just abstract helper for command parsers
*/
export type CommandBase = {
type: string_name & string_SCREAMING_CASE;
}> = {
};
/**
* @@@
*/
export type CommandParser<TCommand extends CommandBase> = PipelineHeadCommandParser<TCommand> | PipelineTemplateCommandParser<TCommand> | PipelineBothCommandParser<TCommand>;
/**
* @@@
*
* @private just abstract the common properties of the command parsers
*/
export type CommonCommandParser<TCommand extends CommandBase> = {
/**
* @@@
*/
readonly name: string_name & string_SCREAMING_CASE;
/**
* @@@
*/
readonly isUsedInPipelineHead: boolean;
/**
* @@@
*/
readonly isUsedInPipelineTemplate: boolean;
/**
* @@@
*/
readonly aliasNames?: Array<string_name & string_SCREAMING_CASE>;
/**
* @@@
*/
readonly deprecatedNames?: Array<string_name & string_SCREAMING_CASE>;
readonly usagePlaces: Array<CommandUsagePlace>;
/**
* @@@
*/
readonly description: string_markdown_text;
/**
* @@@
*/
readonly documentationUrl: string_promptbook_documentation_url;
/**
* @@@
*/
readonly examples: Array<string_markdown_text>;
/**
* @throws {ParsingError} if the parsing fails
* @throws {ParseError} if the parsing fails
*/
parse(input: CommandParserInput): TCommand;
/**
* @@@ Mutated by the command
* Converts the command back to string
*
* Note: This is used in `pipelineJsonToString` utility
*/
applyToPipelineJson?(command: TCommand, subjects: ApplyToPipelineJsonSubjects): void;
stringify(command: TCommand): string_markdown_text;
};
export type CommandParserInput = {
readonly usagePlace: CommandUsagePlace;
readonly raw: string_markdown_text;
readonly rawArgs: string_markdown_text;
readonly normalized: string_name & string_SCREAMING_CASE;
readonly args: Array<string_name & string_SCREAMING_CASE>;
/**
* @@@
*/
export type PipelineBothCommandParser<TCommand extends CommandBase> = ___and___ & Omit<PipelineHeadCommandParser<TCommand>, 'isUsedInPipelineTemplate'> & Omit<PipelineTemplateCommandParser<TCommand>, 'isUsedInPipelineHead'>;
/**
* @@@
*/
export type PipelineHeadCommandParser<TCommand extends CommandBase> = CommonCommandParser<TCommand> & {
/**
* @@@
*/
readonly isUsedInPipelineHead: true;
/**
* @@@
*/
readonly isUsedInPipelineTemplate: false;
/**
* Apply the command to the `pipelineJson`
*
* Note: `$` is used to indicate that this function mutates given `pipelineJson`
*/
$applyToPipelineJson(command: TCommand, $pipelineJson: $PipelineJson): void;
/**
* Reads the command from the `PipelineJson`
*
* Note: This is used in `pipelineJsonToString` utility
*/
takeFromPipelineJson(pipelineJson: PipelineJson): Array<TCommand>;
};
/**
* @@@ Mutated by the command
* @@@
*/
export type ApplyToPipelineJsonSubjects = {
export type PipelineTemplateCommandParser<TCommand extends CommandBase> = CommonCommandParser<TCommand> & {
/**
* @@@ Mutated by the command
* @@@
*/
readonly pipelineJson: WritableDeep<PipelineJson>;
readonly isUsedInPipelineHead: false;
/**
* @@@
*/
readonly isUsedInPipelineTemplate: true;
/**
* Apply the command to the `pipelineJson`
*
* @@@ Mutated by the command
* Note: `$` is used to indicate that this function mutates given `templateJson` and/or `pipelineJson`
*/
$applyToTemplateJson(command: TCommand, $templateJson: $TemplateJson, $pipelineJson: $PipelineJson): void;
/**
* Reads the command from the `TemplateJson`
*
* When used in
* - `PIPELINE_HEAD` it is `null`
* - `PIPELINE_TEMPLATE` it is the prompt template
* Note: This is used in `pipelineJsonToString` utility
*/
readonly templateJson: null | Partial<WritableDeep<PromptTemplateJson>>;
takeFromTemplateJson($templateJson: $TemplateJson): Array<TCommand>;
};
/**
* TODO: @@@ Annotate all
* TODO: [๐Ÿง][โ™“๏ธ] Add order here
* TODO: [๐Ÿง ] Maybe put flag if it is for whole `.ptbk.md` file of just one section
* TODO: [๐Ÿง] All commands must implement `applyToPipelineJson` method
* which will apply parsed command to the pipeline JSON
* it will be called from `pipelineStringToJsonSync`
* and replace hardcoded switch statement and [๐Ÿ’]
* and throw ParsingError
* @@@
*
* Note: `$` is used to indicate that purpose of this type is to mutate the given object
*
* @private internal helper for command parsers
*/
export type $TemplateJson = {
isBlockTypeSet: boolean;
isTemplateBlock: boolean;
} & Partial<WritableDeep<TemplateJson>>;
/**
* @@@
*
* Note: `$` is used to indicate that purpose of this type is to mutate the given object
*
* @private internal helper for command parsers
*/
export type $PipelineJson = WritableDeep<PipelineJson>;
/**
* @@@
*/
export type CommandParserInput = {
/**
* @@@
*/
readonly usagePlace: CommandUsagePlace;
/**
* @@@
*/
readonly raw: string_markdown_text;
/**
* @@@
*/
readonly rawArgs: string_markdown_text;
/**
* @@@
*/
readonly normalized: string_name & string_SCREAMING_CASE;
/**
* @@@
*/
readonly args: Array<string_name & string_SCREAMING_CASE>;
};
/**
* TODO: [โ™“๏ธ] Add order here
*/

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineTemplateCommandParser } from '../_common/types/CommandParser';
import type { BlockCommand } from './BlockCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const blockCommandParser: CommandParser<BlockCommand>;
export declare const blockCommandParser: PipelineTemplateCommandParser<BlockCommand>;

@@ -15,2 +15,2 @@ import type { TupleToUnion } from 'type-fest';

*/
export declare const BlockTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT", "PROMPT_DIALOG", "SAMPLE", "KNOWLEDGE", "INSTRUMENT", "ACTION"];
export declare const BlockTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT_TEMPLATE", "DIALOG_TEMPLATE", "SAMPLE", "KNOWLEDGE", "INSTRUMENT", "ACTION"];

@@ -1,9 +0,17 @@

import type { ExpectAmountCommand } from "./ExpectAmountCommand";
import type { ExpectFormatCommand } from "./ExpectFormatCommand";
import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
import type { ExpectationUnit } from '../../types/PipelineJson/Expectations';
/**
* Parsed EXPECT command
* Expect amount command describes the desired output of the prompt template (after post-processing)
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
*
* @see ./expectCommandParser.ts for more details
* @private within the commands folder
* Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units.
*/
export type ExpectCommand = ExpectAmountCommand | ExpectFormatCommand;
export type ExpectCommand = {
readonly type: 'EXPECT';
readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';
readonly unit: ExpectationUnit;
readonly amount: ExpectationAmount;
};
/**
* TODO: [๐Ÿ‹] Allow to `EXPECT` relative amounts like `EXPECT MAX 130% {foo} Words`
*/

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineTemplateCommandParser } from '../_common/types/CommandParser';
import type { ExpectCommand } from './ExpectCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const expectCommandParser: CommandParser<ExpectCommand>;
export declare const expectCommandParser: PipelineTemplateCommandParser<ExpectCommand>;

@@ -6,2 +6,2 @@ /**

*/
export declare const COMMANDS: readonly [import("./_common/types/CommandParser").CommandParser<import("./BLOCK/BlockCommand").BlockCommand>, import("./_common/types/CommandParser").CommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").CommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").CommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").CommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").CommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").CommandParser<import("./PROMPTBOOK_VERSION/PromptbookVersionCommand").PromptbookVersionCommand>, import("./_common/types/CommandParser").CommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").CommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").CommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").CommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").CommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").CommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./BLOCK/BlockCommand").BlockCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./PROMPTBOOK_VERSION/PromptbookVersionCommand").PromptbookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineTemplateCommandParser } from '../_common/types/CommandParser';
import type { JokerCommand } from './JokerCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const jokerCommandParser: CommandParser<JokerCommand>;
export declare const jokerCommandParser: PipelineTemplateCommandParser<JokerCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
import type { KnowledgeCommand } from './KnowledgeCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const knowledgeCommandParser: CommandParser<KnowledgeCommand>;
export declare const knowledgeCommandParser: PipelineHeadCommandParser<KnowledgeCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineBothCommandParser } from '../_common/types/CommandParser';
import type { ModelCommand } from './ModelCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const modelCommandParser: CommandParser<ModelCommand>;
export declare const modelCommandParser: PipelineBothCommandParser<ModelCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineBothCommandParser } from '../_common/types/CommandParser';
import type { ParameterCommand } from './ParameterCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const parameterCommandParser: CommandParser<ParameterCommand>;
export declare const parameterCommandParser: PipelineBothCommandParser<ParameterCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineBothCommandParser } from '../_common/types/CommandParser';
import type { PersonaCommand } from './PersonaCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const personaCommandParser: CommandParser<PersonaCommand>;
export declare const personaCommandParser: PipelineBothCommandParser<PersonaCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineTemplateCommandParser } from '../_common/types/CommandParser';
import type { PostprocessCommand } from './PostprocessCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const postprocessCommandParser: CommandParser<PostprocessCommand>;
export declare const postprocessCommandParser: PipelineTemplateCommandParser<PostprocessCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
import type { PromptbookVersionCommand } from './PromptbookVersionCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const promptbookVersionCommandParser: CommandParser<PromptbookVersionCommand>;
export declare const promptbookVersionCommandParser: PipelineHeadCommandParser<PromptbookVersionCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
import type { UrlCommand } from './UrlCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const urlCommandParser: CommandParser<UrlCommand>;
export declare const urlCommandParser: PipelineHeadCommandParser<UrlCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
import type { ActionCommand } from './ActionCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const actionCommandParser: CommandParser<ActionCommand>;
export declare const actionCommandParser: PipelineHeadCommandParser<ActionCommand>;

@@ -1,2 +0,2 @@

import type { CommandParser } from '../_common/types/CommandParser';
import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
import type { InstrumentCommand } from './InstrumentCommand';

@@ -9,2 +9,2 @@ /**

*/
export declare const instrumentCommandParser: CommandParser<InstrumentCommand>;
export declare const instrumentCommandParser: PipelineHeadCommandParser<InstrumentCommand>;

@@ -12,3 +12,3 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';

/**
* TODO: !!!! Implement new features and commands into `promptTemplateParameterJsonToString`
* TODO: !!!!!! Implement new features and commands into `templateParameterJsonToString`
* TODO: [๐Ÿง ] Is there a way to auto-detect missing features in pipelineJsonToString

@@ -15,0 +15,0 @@ * TODO: [๐Ÿ›] Maybe make some markdown builder

@@ -31,3 +31,3 @@ import type { LlmExecutionTools } from '../execution/LlmExecutionTools';

* @returns {Promptbook} compiled in JSON format (.ptbk.json)
* @throws {ParsingError} if the promptbook string is not valid
* @throws {ParseError} if the promptbook string is not valid
* @public exported from `@promptbook/core`

@@ -34,0 +34,0 @@ */

@@ -16,3 +16,3 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';

* @returns {Promptbook} compiled in JSON format (.ptbk.json)
* @throws {ParsingError} if the promptbook string is not valid
* @throws {ParseError} if the promptbook string is not valid
* @public exported from `@promptbook/core`

@@ -29,3 +29,3 @@ */

* TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
import type { PromptTemplateJson } from '../../types/PipelineJson/PromptTemplateJson';
import type { TemplateJson } from '../../types/PipelineJson/TemplateJson';
import type { string_href } from '../../types/typeAliases';

@@ -11,3 +11,3 @@ /**

*/
linkPromptTemplate?(promptTemplate: PromptTemplateJson): {
linkTemplate?(template: TemplateJson): {
href: string_href;

@@ -14,0 +14,0 @@ title: string;

@@ -8,3 +8,3 @@ import type { string_javascript } from '../../types/typeAliases';

* @returns the list of variable names
* @throws {ParsingError} if the script is invalid
* @throws {ParseError} if the script is invalid
* @public exported from `@promptbook/utils`

@@ -11,0 +11,0 @@ */

@@ -15,3 +15,3 @@ import type { string_json } from '../../types/typeAliases';

* TODO: [๐Ÿง ] Maybe more elegant solution than replacing via regex
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -7,3 +7,3 @@ import { CollectionError } from './CollectionError';

import { NotYetImplementedError } from './NotYetImplementedError';
import { ParsingError } from './ParsingError';
import { ParseError } from './ParseError';
import { PipelineExecutionError } from './PipelineExecutionError';

@@ -25,3 +25,3 @@ import { PipelineLogicError } from './PipelineLogicError';

readonly NotYetImplementedError: typeof NotYetImplementedError;
readonly ParsingError: typeof ParsingError;
readonly ParseError: typeof ParseError;
readonly PipelineExecutionError: typeof PipelineExecutionError;

@@ -28,0 +28,0 @@ readonly PipelineLogicError: typeof PipelineLogicError;

@@ -0,1 +1,6 @@

/**
* @@@
*
* @private just abstract the common properties for the execution tools
*/
export type CommonExecutionToolsOptions = {

@@ -2,0 +7,0 @@ /**

@@ -66,3 +66,3 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';

* TODO: [โ™ˆ] Probbably move expectations from templates to parameters
* TODO: [๐Ÿง ] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
* TODO: [๐Ÿง ] When not meet expectations in DIALOG_TEMPLATE, make some way to tell the user
* TODO: [๐Ÿ‘ง] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json

@@ -69,0 +69,0 @@ * Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder

@@ -42,2 +42,4 @@ import type { string_date_iso8601 } from '../types/typeAliases';

* Note: [๐Ÿš‰] This is fully serializable as JSON
*
* @private just abstract the common properties of the prompt results
*/

@@ -44,0 +46,0 @@ export type CommonPromptResult = {

@@ -32,3 +32,3 @@ import type { KebabCase } from 'type-fest';

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -16,3 +16,3 @@ import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';

/**
* Trigger window.PROMPT DIALOG
* Trigger window.DIALOG BLOCK
*/

@@ -19,0 +19,0 @@ promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;

@@ -42,3 +42,3 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
callChatModel(prompt: Pick<Prompt, 'content' | 'parameters' | 'modelRequirements' | 'expectFormat'>): Promise<ChatPromptResult>;
callChatModel(prompt: Pick<Prompt, 'content' | 'parameters' | 'modelRequirements' | 'format'>): Promise<ChatPromptResult>;
/**

@@ -45,0 +45,0 @@ * Calls OpenAI API to use a complete model.

@@ -5,3 +5,3 @@ import type { string_markdown } from '../../types/typeAliases';

*
* - When there are multiple or no code blocks the function throws a `ParsingError`
* - When there are multiple or no code blocks the function throws a `ParseError`
*

@@ -15,4 +15,4 @@ * Note: There are multiple simmilar function:

* @public exported from `@promptbook/markdown-utils`
* @throws {ParsingError} if there is not exactly one code block in the markdown
* @throws {ParseError} if there is not exactly one code block in the markdown
*/
export declare function extractBlock(markdown: string_markdown): string;

@@ -8,4 +8,4 @@ import type { string_json } from '../../types/typeAliases';

* - When given string is a valid JSON as it is, it just returns it
* - When there is no JSON code block the function throws a `ParsingError`
* - When there are multiple JSON code blocks the function throws a `ParsingError`
* - When there is no JSON code block the function throws a `ParseError`
* - When there are multiple JSON code blocks the function throws a `ParseError`
*

@@ -20,3 +20,3 @@ * Note: It is not important if marked as ```json BUT if it is VALID JSON

* @public exported from `@promptbook/markdown-utils`
* @throws {ParsingError} if there is no valid JSON block in the markdown
* @throws {ParseError} if there is no valid JSON block in the markdown
*/

@@ -23,0 +23,0 @@ export declare function extractJsonBlock(markdown: string_markdown): string_json<really_unknown>;

import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
import type { PromptTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
import type { TemplateJson } from '../types/PipelineJson/TemplateJson';
import type { PrepareOptions } from './PrepareOptions';
type PrepareTemplateInput = Pick<PipelineJson, 'promptTemplates' | 'parameters'> & {
type PrepareTemplateInput = Pick<PipelineJson, 'templates' | 'parameters'> & {
/**

@@ -14,3 +14,3 @@ * @@@

*/
readonly promptTemplatesPrepared: Array<PromptTemplateJson>;
readonly templatesPrepared: Array<TemplateJson>;
};

@@ -32,3 +32,2 @@ /**

* TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
* TODO: [๐Ÿง ][๐Ÿฅœ]
*/

@@ -11,3 +11,3 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';

* TODO: Write tests for `preparePipeline`
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -1,2 +0,2 @@

import { Promisable } from 'type-fest';
import type { Promisable } from 'type-fest';
/**

@@ -3,0 +3,0 @@ * Storage of objects with asynchronous API

@@ -1,2 +0,2 @@

import { Promisable } from 'type-fest';
import type { Promisable } from 'type-fest';
import type { PromptbookStorage } from '../_common/PromptbookStorage';

@@ -3,0 +3,0 @@ /**

@@ -55,2 +55,4 @@ import type { ModelVariant } from './ModelVariant';

* Note: [๐Ÿš‰] This is fully serializable as JSON
*
* @private just abstract the common properties of the model requirements
*/

@@ -57,0 +59,0 @@ export type CommonModelRequirements = {

@@ -39,3 +39,3 @@ import type { TupleToUnion } from 'type-fest';

/**
* TODO: [๐Ÿ’] Unite object for expecting amount and format - remove expectFormat
* TODO: [๐Ÿ’] Unite object for expecting amount and format - remove format
*/

@@ -71,3 +71,3 @@ import type { EmbeddingVector } from '../../execution/EmbeddingVector';

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -36,3 +36,3 @@ import type { number_id } from '../typeAliases';

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -44,3 +44,3 @@ import type { ChatModelRequirements } from '../ModelRequirements';

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -0,1 +1,2 @@

import type { ModelRequirements } from '../ModelRequirements';
import type { string_file_path } from '../typeAliases';

@@ -8,7 +9,7 @@ import type { string_markdown_text } from '../typeAliases';

import type { KnowledgeSourcePreparedJson } from './KnowledgeSourceJson';
import type { ParameterJson } from './ParameterJson';
import type { PersonaJson } from './PersonaJson';
import type { PersonaPreparedJson } from './PersonaJson';
import type { PreparationJson } from './PreparationJson';
import type { PromptTemplateJson } from './PromptTemplateJson';
import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
import type { TemplateJson } from './TemplateJson';
/**

@@ -54,7 +55,11 @@ * Promptbook is the **core concept of this package**.

*/
readonly parameters: Array<PromptTemplateParameterJson>;
readonly parameters: Array<ParameterJson>;
/**
* Default model requirements for the model for all `templates`
*/
readonly defaultModelRequirements?: Partial<ModelRequirements>;
/**
* Sequence of prompt templates that are chained together to form a pipeline
*/
readonly promptTemplates: Array<PromptTemplateJson>;
readonly templates: Array<TemplateJson>;
/**

@@ -86,3 +91,3 @@ * Set of information that are used as external knowledge in the pipeline

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
* TODO: [๐Ÿง ] Maybe wrap all {parameterNames} in brackets for example { "resultingParameterName": "{foo}" }

@@ -89,0 +94,0 @@ * Note: [๐Ÿ’ผ] There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a

@@ -19,5 +19,5 @@ import type { PromptResultUsage } from '../../execution/PromptResultUsage';

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
* TODO: Maybe put here used `modelName`
* TODO: [๐Ÿฅ] When using `date` it changes all samples .ptbk.json files each time so until some more elegant solution omit the time from prepared pipeline
*/

@@ -1,15 +0,26 @@

import type { ___ } from '../../utils/organization/___';
import type { LlmTemplateJson } from './LlmTemplateJson';
import type { PromptDialogJson } from './PromptDialogJson';
import type { ScriptJson } from './ScriptJson';
import type { SimpleTemplateJson } from './SimpleTemplateJson';
import type { ModelRequirements } from '../ModelRequirements';
import type { string_name } from '../typeAliases';
import type { TemplateJsonCommon } from './TemplateJsonCommon';
/**
* Describes one prompt template in the promptbook
* Template for prompt to LLM
*
* Note: [๐Ÿš‰] This is fully serializable as JSON
*/
export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptJson | PromptDialogJson | ___ | ___ | ___ | ___;
export type PromptTemplateJson = TemplateJsonCommon & {
readonly blockType: 'PROMPT_TEMPLATE';
/**
* Name of the persona who will be responding to this prompt
*/
readonly personaName?: string_name;
/**
* Requirements for the model
* - This is required only for blockType PROMPT_TEMPLATE
*/
readonly modelRequirements?: Partial<ModelRequirements>;
};
/**
* TODO: [๐Ÿง ][๐Ÿฅœ] What is propper name for this - "Template", "Prompt template",...
* TODO: [๐Ÿง ][๐Ÿฅœ] Reduce confusion of `PromptTemplateJson` vs (`LlmTemplateJson` which is 'PROMPT_TEMPLATE')
* TODO: [๐Ÿ‘™][๐Ÿง ] Maybe add `knowledge`, `actions` and `instruments` to be available granularly for each template
* @see https://github.com/webgptorg/promptbook/discussions/79
* TODO: [๐Ÿ’•][๐Ÿง ] Just selecting gpt3 or gpt4 level of model
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -1,2 +0,2 @@

import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';
import type { TemplateJsonCommon } from './TemplateJsonCommon';
/**

@@ -8,7 +8,7 @@ * Template for simple concatenation of strings

*/
export type SimpleTemplateJson = PromptTemplateJsonCommon & {
export type SimpleTemplateJson = TemplateJsonCommon & {
readonly blockType: 'SIMPLE_TEMPLATE';
};
/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/

@@ -1,2 +0,2 @@

import type { ExpectFormatCommand } from '../commands/EXPECT/ExpectFormatCommand';
import type { FormatCommand } from '../commands/FORMAT/FormatCommand';
import type { ChatModelRequirements } from './ModelRequirements';

@@ -57,2 +57,4 @@ import type { CompletionModelRequirements } from './ModelRequirements';

* Note: [๐Ÿš‰] This is fully serializable as JSON
*
* @private just abstract the common properties of the prompts
*/

@@ -93,3 +95,3 @@ export type CommonPrompt = {

*/
readonly expectFormat?: ExpectFormatCommand['format'];
readonly format?: FormatCommand['format'];
/**

@@ -96,0 +98,0 @@ * Unique identifier of the pipeline with specific template name as hash

@@ -13,3 +13,4 @@ import type { string_markdown } from '../../types/typeAliases';

/**
* TODO: !!!!!! Somw way how to connect this with commands
* TODO: [๐Ÿ›] This can be part of markdown builder
*/

@@ -30,3 +30,3 @@ import type { string_markdown } from '../../types/typeAliases';

* @returns code blocks with language and content
* @throws {ParsingError} if block is not closed properly
* @throws {ParseError} if block is not closed properly
* @public exported from `@promptbook/markdown-utils`

@@ -33,0 +33,0 @@ */

@@ -6,3 +6,3 @@ import type { string_markdown } from '../../types/typeAliases';

*
* - When there are multiple or no code blocks the function throws a `ParsingError`
* - When there are multiple or no code blocks the function throws a `ParseError`
*

@@ -18,3 +18,3 @@ * Note: There are multiple simmilar function:

* @public exported from `@promptbook/markdown-utils`
* @throws {ParsingError} if there is not exactly one code block in the markdown
* @throws {ParseError} if there is not exactly one code block in the markdown
*/

@@ -21,0 +21,0 @@ export declare function extractOneBlockFromMarkdown(markdown: string_markdown): CodeBlock;

@@ -8,3 +8,3 @@ /**

* @returns parsed number
* @throws {ParsingError} if the value is not a number
* @throws {ParseError} if the value is not a number
*

@@ -11,0 +11,0 @@ * @public exported from `@promptbook/utils`

@@ -12,3 +12,3 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';

/**
* TODO: [๐Ÿ™] Make some standart order of json properties
* TODO: [๐Ÿ™] Make some standard order of json properties
*/
{
"name": "@promptbook/anthropic-claude",
"version": "0.68.0-0",
"version": "0.68.0-1",
"description": "Supercharge your use of large language models",

@@ -50,3 +50,3 @@ "private": false,

"peerDependencies": {
"@promptbook/core": "0.68.0-0"
"@promptbook/core": "0.68.0-1"
},

@@ -53,0 +53,0 @@ "dependencies": {

@@ -254,3 +254,3 @@ <!-- โš ๏ธ WARNING: This code has been generated so that any manual changes will be overwritten -->

>
> - PROMPT DIALOG
> - DIALOG BLOCK
>

@@ -289,3 +289,3 @@ > ```

>
> - PROMPT DIALOG
> - DIALOG BLOCK
>

@@ -292,0 +292,0 @@ > ```

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc