@promptbook/cli
Advanced tools
Comparing version 0.44.0-10 to 0.44.0-11
import type { Expectations } from '../../../../types/PromptbookJson/PromptTemplateJson'; | ||
import { PostprocessingFunction } from '../../script-execution-tools/javascript/JavascriptExecutionToolsOptions'; | ||
/** | ||
* Gets the expectations and creates a fake text that meets the expectations | ||
* | ||
* Note: You can provide postprocessing functions to modify the text before checking the expectations | ||
* The result will be the text BEFORE the postprocessing | ||
* | ||
* @private internal util for MockedFackedNaturalExecutionTools | ||
*/ | ||
export declare function $fakeTextToExpectations(expectations: Expectations): string; | ||
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>; | ||
/** | ||
* TODO: Implement better | ||
* TODO: Implement better - create FakeLLM from this | ||
* TODO: [π] Unite object for expecting amount and format - use here also a format | ||
*/ |
@@ -18,6 +18,10 @@ import type { Promisable } from 'type-fest'; | ||
*/ | ||
functions?: Record<string_javascript_name, ((value: string) => Promisable<string>) | Function>; | ||
functions?: Record<string_javascript_name, PostprocessingFunction>; | ||
}; | ||
/** | ||
* Function that can be used to postprocess the output of the LLM | ||
*/ | ||
export type PostprocessingFunction = ((value: string) => Promisable<string>) | Function; | ||
/** | ||
* TODO: [π§ ][π] Distinct between options passed into ExecutionTools and to ExecutionTools.execute | ||
*/ |
import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases'; | ||
import { PostprocessingFunction } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions'; | ||
import type { ModelRequirements } from './ModelRequirements'; | ||
@@ -28,2 +29,6 @@ import type { Expectations } from './PromptbookJson/PromptTemplateJson'; | ||
/** | ||
* List of postprocessing steps that are executed after the prompt | ||
*/ | ||
readonly postprocessing?: Array<PostprocessingFunction>; | ||
/** | ||
* Expectations for the answer | ||
@@ -30,0 +35,0 @@ * |
@@ -124,2 +124,3 @@ import { ExpectFormatCommand } from '../Command'; | ||
* Note: Expectations are performed after all postprocessing steps | ||
* @deprecated [π] | ||
*/ | ||
@@ -126,0 +127,0 @@ readonly expectFormat?: ExpectFormatCommand['format']; |
{ | ||
"name": "@promptbook/cli", | ||
"version": "0.44.0-10", | ||
"version": "0.44.0-11", | ||
"description": "Library to supercharge your use of large language models", | ||
@@ -45,3 +45,3 @@ "private": false, | ||
"peerDependencies": { | ||
"@promptbook/core": "0.44.0-10" | ||
"@promptbook/core": "0.44.0-11" | ||
}, | ||
@@ -48,0 +48,0 @@ "main": "./umd/index.umd.js", |
import type { Expectations } from '../../../../types/PromptbookJson/PromptTemplateJson'; | ||
import { PostprocessingFunction } from '../../script-execution-tools/javascript/JavascriptExecutionToolsOptions'; | ||
/** | ||
* Gets the expectations and creates a fake text that meets the expectations | ||
* | ||
* Note: You can provide postprocessing functions to modify the text before checking the expectations | ||
* The result will be the text BEFORE the postprocessing | ||
* | ||
* @private internal util for MockedFackedNaturalExecutionTools | ||
*/ | ||
export declare function $fakeTextToExpectations(expectations: Expectations): string; | ||
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>; | ||
/** | ||
* TODO: Implement better | ||
* TODO: Implement better - create FakeLLM from this | ||
* TODO: [π] Unite object for expecting amount and format - use here also a format | ||
*/ |
@@ -18,6 +18,10 @@ import type { Promisable } from 'type-fest'; | ||
*/ | ||
functions?: Record<string_javascript_name, ((value: string) => Promisable<string>) | Function>; | ||
functions?: Record<string_javascript_name, PostprocessingFunction>; | ||
}; | ||
/** | ||
* Function that can be used to postprocess the output of the LLM | ||
*/ | ||
export type PostprocessingFunction = ((value: string) => Promisable<string>) | Function; | ||
/** | ||
* TODO: [π§ ][π] Distinct between options passed into ExecutionTools and to ExecutionTools.execute | ||
*/ |
import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases'; | ||
import { PostprocessingFunction } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions'; | ||
import type { ModelRequirements } from './ModelRequirements'; | ||
@@ -28,2 +29,6 @@ import type { Expectations } from './PromptbookJson/PromptTemplateJson'; | ||
/** | ||
* List of postprocessing steps that are executed after the prompt | ||
*/ | ||
readonly postprocessing?: Array<PostprocessingFunction>; | ||
/** | ||
* Expectations for the answer | ||
@@ -30,0 +35,0 @@ * |
@@ -124,2 +124,3 @@ import { ExpectFormatCommand } from '../Command'; | ||
* Note: Expectations are performed after all postprocessing steps | ||
* @deprecated [π] | ||
*/ | ||
@@ -126,0 +127,0 @@ readonly expectFormat?: ExpectFormatCommand['format']; |
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
604959
9633