๐Ÿš€ Socket Launch Week ๐Ÿš€ Day 5: Introducing Socket Fix.Learn More โ†’

@promptbook/fake-llm

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptbook/fake-llm - npm Package Compare versions

Comparing version

to
0.61.0-24

@@ -35,2 +35,13 @@ import { spaceTrim } from 'spacetrim';

var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {

@@ -442,2 +453,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

return __awaiter(this, void 0, void 0, function () {
var modelName;
return __generator(this, function (_a) {

@@ -447,5 +459,6 @@ if (this.options.isVerbose) {

}
modelName = 'mocked-echo';
return [2 /*return*/, {
content: spaceTrim(function (block) { return "\n You said:\n ".concat(block(replaceParameters(prompt.content, prompt.parameters)), "\n "); }),
modelName: 'mocked-echo',
content: spaceTrim(function (block) { return "\n You said:\n ".concat(block(replaceParameters(prompt.content, __assign(__assign({}, prompt.parameters), { modelName: modelName }))), "\n "); }),
modelName: modelName,
timing: {

@@ -469,2 +482,3 @@ start: getCurrentIsoDate(),

return __awaiter(this, void 0, void 0, function () {
var modelName;
return __generator(this, function (_a) {

@@ -474,5 +488,6 @@ if (this.options.isVerbose) {

}
modelName = 'mocked-echo';
return [2 /*return*/, {
content: spaceTrim(function (block) { return "\n ".concat(block(replaceParameters(prompt.content, prompt.parameters)), "\n And so on...\n "); }),
modelName: 'mocked-echo',
content: spaceTrim(function (block) { return "\n ".concat(block(replaceParameters(prompt.content, __assign(__assign({}, prompt.parameters), { modelName: modelName }))), "\n And so on...\n "); }),
modelName: modelName,
timing: {

@@ -1137,3 +1152,3 @@ start: getCurrentIsoDate(),

*/
var PROMPTBOOK_VERSION = '0.61.0-22';
var PROMPTBOOK_VERSION = '0.61.0-23';
// TODO: !!!! List here all the versions and annotate + put into script

@@ -1140,0 +1155,0 @@

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

* TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -13,2 +13,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
*/

@@ -27,1 +27,4 @@ import type { KebabCase } from 'type-fest';

export type PromptResultUsageCounts = Record<`${KebabCase<'TOKENS' | ExpectationUnit>}Count`, UncertainNumber>;
/**
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

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

/**
* TODO: !!!!! Index the samples and maybe templates
* TODO: [๐Ÿ”ผ] !!! Export via `@promptbook/core`

@@ -14,0 +13,0 @@ * TODO: Write tests for `preparePipeline`

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

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

@@ -68,1 +68,4 @@ import type { EmbeddingVector } from '../../execution/EmbeddingVector';

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

@@ -25,1 +25,4 @@ import type { number_id } from '../typeAliases';

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

@@ -24,2 +24,3 @@ import type { ModelRequirements } from '../ModelRequirements';

* TODO: [๐Ÿ’•][๐Ÿง ] Just selecting gpt3 or gpt4 level of model
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -39,1 +39,4 @@ import type { ChatModelRequirements } from '../ModelRequirements';

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

@@ -82,2 +82,3 @@ import type { string_file_path } from '../typeAliases';

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

@@ -84,0 +85,0 @@ * Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a

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

/**
* TODO: [๐Ÿ™] Make some standart 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
*/

@@ -7,7 +7,8 @@ import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';

*/
export interface PromptDialogJson extends PromptTemplateJsonCommon {
export type PromptDialogJson = PromptTemplateJsonCommon & {
readonly blockType: 'PROMPT_DIALOG';
}
};
/**
* TODO: [๐Ÿง ][๐Ÿฅœ]
*/
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -52,5 +52,15 @@ import type { BlockType } from '../../commands/BLOCK/BlockTypes';

* Content of the template with {placeholders} for parameters
*
* @@@ content vs preparedContent
*/
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
/**
* @@@ Content of the template with {placeholders} for parameters
*
* @@@ content vs preparedContent
*
* @default "{content}"
*/
readonly preparedContent?: (string_prompt | string_javascript | string_markdown) & string_template;
/**
* List of postprocessing steps that are executed after the prompt template

@@ -57,0 +67,0 @@ *

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

* TODO: [โ™ˆ] Probbably move expectations from templates to parameters
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -8,3 +8,3 @@ import type { ScriptLanguage } from '../ScriptLanguage';

*/
export interface ScriptJson extends PromptTemplateJsonCommon {
export type ScriptJson = PromptTemplateJsonCommon & {
readonly blockType: 'SCRIPT';

@@ -17,2 +17,5 @@ /**

readonly contentLanguage?: ScriptLanguage;
}
};
/**
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -7,4 +7,7 @@ import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';

*/
export interface SimpleTemplateJson extends PromptTemplateJsonCommon {
export type SimpleTemplateJson = PromptTemplateJsonCommon & {
readonly blockType: 'SIMPLE_TEMPLATE';
}
};
/**
* TODO: [๐Ÿ™] Make some standart order of json properties
*/
{
"name": "@promptbook/fake-llm",
"version": "0.61.0-23",
"version": "0.61.0-24",
"description": "Supercharge your use of large language models",

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

"peerDependencies": {
"@promptbook/core": "0.61.0-23"
"@promptbook/core": "0.61.0-24"
},

@@ -54,0 +54,0 @@ "main": "./umd/index.umd.js",

@@ -38,2 +38,13 @@ (function (global, factory) {

var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {

@@ -445,2 +456,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

return __awaiter(this, void 0, void 0, function () {
var modelName;
return __generator(this, function (_a) {

@@ -450,5 +462,6 @@ if (this.options.isVerbose) {

}
modelName = 'mocked-echo';
return [2 /*return*/, {
content: spacetrim.spaceTrim(function (block) { return "\n You said:\n ".concat(block(replaceParameters(prompt.content, prompt.parameters)), "\n "); }),
modelName: 'mocked-echo',
content: spacetrim.spaceTrim(function (block) { return "\n You said:\n ".concat(block(replaceParameters(prompt.content, __assign(__assign({}, prompt.parameters), { modelName: modelName }))), "\n "); }),
modelName: modelName,
timing: {

@@ -472,2 +485,3 @@ start: getCurrentIsoDate(),

return __awaiter(this, void 0, void 0, function () {
var modelName;
return __generator(this, function (_a) {

@@ -477,5 +491,6 @@ if (this.options.isVerbose) {

}
modelName = 'mocked-echo';
return [2 /*return*/, {
content: spacetrim.spaceTrim(function (block) { return "\n ".concat(block(replaceParameters(prompt.content, prompt.parameters)), "\n And so on...\n "); }),
modelName: 'mocked-echo',
content: spacetrim.spaceTrim(function (block) { return "\n ".concat(block(replaceParameters(prompt.content, __assign(__assign({}, prompt.parameters), { modelName: modelName }))), "\n And so on...\n "); }),
modelName: modelName,
timing: {

@@ -1140,3 +1155,3 @@ start: getCurrentIsoDate(),

*/
var PROMPTBOOK_VERSION = '0.61.0-22';
var PROMPTBOOK_VERSION = '0.61.0-23';
// TODO: !!!! List here all the versions and annotate + put into script

@@ -1143,0 +1158,0 @@

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

* TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -13,2 +13,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
*/

@@ -27,1 +27,4 @@ import type { KebabCase } from 'type-fest';

export type PromptResultUsageCounts = Record<`${KebabCase<'TOKENS' | ExpectationUnit>}Count`, UncertainNumber>;
/**
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

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

/**
* TODO: !!!!! Index the samples and maybe templates
* TODO: [๐Ÿ”ผ] !!! Export via `@promptbook/core`

@@ -14,0 +13,0 @@ * TODO: Write tests for `preparePipeline`

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

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

@@ -68,1 +68,4 @@ import type { EmbeddingVector } from '../../execution/EmbeddingVector';

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

@@ -25,1 +25,4 @@ import type { number_id } from '../typeAliases';

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

@@ -24,2 +24,3 @@ import type { ModelRequirements } from '../ModelRequirements';

* TODO: [๐Ÿ’•][๐Ÿง ] Just selecting gpt3 or gpt4 level of model
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -39,1 +39,4 @@ import type { ChatModelRequirements } from '../ModelRequirements';

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

@@ -82,2 +82,3 @@ import type { string_file_path } from '../typeAliases';

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

@@ -84,0 +85,0 @@ * Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a

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

/**
* TODO: [๐Ÿ™] Make some standart 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
*/

@@ -7,7 +7,8 @@ import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';

*/
export interface PromptDialogJson extends PromptTemplateJsonCommon {
export type PromptDialogJson = PromptTemplateJsonCommon & {
readonly blockType: 'PROMPT_DIALOG';
}
};
/**
* TODO: [๐Ÿง ][๐Ÿฅœ]
*/
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -52,5 +52,15 @@ import type { BlockType } from '../../commands/BLOCK/BlockTypes';

* Content of the template with {placeholders} for parameters
*
* @@@ content vs preparedContent
*/
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
/**
* @@@ Content of the template with {placeholders} for parameters
*
* @@@ content vs preparedContent
*
* @default "{content}"
*/
readonly preparedContent?: (string_prompt | string_javascript | string_markdown) & string_template;
/**
* List of postprocessing steps that are executed after the prompt template

@@ -57,0 +67,0 @@ *

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

* TODO: [โ™ˆ] Probbably move expectations from templates to parameters
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -8,3 +8,3 @@ import type { ScriptLanguage } from '../ScriptLanguage';

*/
export interface ScriptJson extends PromptTemplateJsonCommon {
export type ScriptJson = PromptTemplateJsonCommon & {
readonly blockType: 'SCRIPT';

@@ -17,2 +17,5 @@ /**

readonly contentLanguage?: ScriptLanguage;
}
};
/**
* TODO: [๐Ÿ™] Make some standart order of json properties
*/

@@ -7,4 +7,7 @@ import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet