@promptbook/anthropic-claude
Advanced tools
Comparing version 0.61.0-23 to 0.61.0-24
@@ -769,3 +769,3 @@ import Anthropic from '@anthropic-ai/sdk'; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var content, parameters, modelRequirements, rawRequest, start, complete, rawResponse, resultContent, usage; | ||
var content, parameters, modelRequirements, modelName, rawRequest, start, complete, rawResponse, resultContent, usage; | ||
return __generator(this, function (_a) { | ||
@@ -782,2 +782,3 @@ switch (_a.label) { | ||
} | ||
modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName; | ||
rawRequest = { | ||
@@ -794,3 +795,3 @@ model: modelRequirements.modelName || this.getDefaultChatModel().modelName, | ||
role: 'user', | ||
content: replaceParameters(content, parameters), | ||
content: replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName })), | ||
}, | ||
@@ -856,5 +857,5 @@ ], | ||
const model = modelRequirements.modelName || this.getDefaultChatModel().modelName; | ||
const modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName; | ||
const modelSettings = { | ||
model: rawResponse.model || model, | ||
model: modelName, | ||
max_tokens: modelRequirements.maxTokens || 2000, // <- Note: 2000 is for lagacy reasons | ||
@@ -867,3 +868,3 @@ // <- TODO: [๐พ] Make some global max cap for maxTokens | ||
...modelSettings, | ||
prompt: replaceParameters(content, parameters), | ||
prompt: replaceParameters(content, { ...parameters, modelName }), | ||
user: this.options.user, | ||
@@ -956,3 +957,3 @@ }; | ||
*/ | ||
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 | ||
@@ -959,0 +960,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/anthropic-claude", | ||
"version": "0.61.0-23", | ||
"version": "0.61.0-24", | ||
"description": "Supercharge your use of large language models", | ||
@@ -52,3 +52,3 @@ "private": false, | ||
"peerDependencies": { | ||
"@promptbook/core": "0.61.0-23" | ||
"@promptbook/core": "0.61.0-24" | ||
}, | ||
@@ -55,0 +55,0 @@ "main": "./umd/index.umd.js", |
@@ -777,3 +777,3 @@ (function (global, factory) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var content, parameters, modelRequirements, rawRequest, start, complete, rawResponse, resultContent, usage; | ||
var content, parameters, modelRequirements, modelName, rawRequest, start, complete, rawResponse, resultContent, usage; | ||
return __generator(this, function (_a) { | ||
@@ -790,2 +790,3 @@ switch (_a.label) { | ||
} | ||
modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName; | ||
rawRequest = { | ||
@@ -802,3 +803,3 @@ model: modelRequirements.modelName || this.getDefaultChatModel().modelName, | ||
role: 'user', | ||
content: replaceParameters(content, parameters), | ||
content: replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName })), | ||
}, | ||
@@ -864,5 +865,5 @@ ], | ||
const model = modelRequirements.modelName || this.getDefaultChatModel().modelName; | ||
const modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName; | ||
const modelSettings = { | ||
model: rawResponse.model || model, | ||
model: modelName, | ||
max_tokens: modelRequirements.maxTokens || 2000, // <- Note: 2000 is for lagacy reasons | ||
@@ -875,3 +876,3 @@ // <- TODO: [๐พ] Make some global max cap for maxTokens | ||
...modelSettings, | ||
prompt: replaceParameters(content, parameters), | ||
prompt: replaceParameters(content, { ...parameters, modelName }), | ||
user: this.options.user, | ||
@@ -964,3 +965,3 @@ }; | ||
*/ | ||
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 | ||
@@ -967,0 +968,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
765825
832
14573