@promptbook/google
Advanced tools
Comparing version 0.84.0 to 0.85.0-0
@@ -18,3 +18,3 @@ import colors from 'colors'; | ||
*/ | ||
var PROMPTBOOK_ENGINE_VERSION = '0.84.0-21'; | ||
var PROMPTBOOK_ENGINE_VERSION = '0.84.0'; | ||
/** | ||
@@ -153,3 +153,3 @@ * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine | ||
/** | ||
* TODO: [โ] | ||
* TODO: [๐บ] | ||
*/ | ||
@@ -156,0 +156,0 @@ |
@@ -62,3 +62,2 @@ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version'; | ||
import { UnexpectedError } from '../errors/UnexpectedError'; | ||
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful'; | ||
import { createPipelineExecutor } from '../execution/createPipelineExecutor/00-createPipelineExecutor'; | ||
@@ -194,3 +193,2 @@ import { embeddingVectorToString } from '../execution/embeddingVectorToString'; | ||
export { UnexpectedError }; | ||
export { assertsExecutionSuccessful }; | ||
export { createPipelineExecutor }; | ||
@@ -197,0 +195,0 @@ export { embeddingVectorToString }; |
@@ -31,2 +31,3 @@ import type { PipelineCollection } from '../collection/PipelineCollection'; | ||
import type { LocateAppOptions } from '../executables/locateApp'; | ||
import type { AbstractTaskResult } from '../execution/AbstractTaskResult'; | ||
import type { AvailableModel } from '../execution/AvailableModel'; | ||
@@ -41,2 +42,6 @@ import type { CommonToolsOptions } from '../execution/CommonToolsOptions'; | ||
import type { ExecutionReportStringOptions } from '../execution/execution-report/ExecutionReportStringOptions'; | ||
import type { ExecutionTask } from '../execution/ExecutionTask'; | ||
import type { PreparationTask } from '../execution/ExecutionTask'; | ||
import type { AbstractTask } from '../execution/ExecutionTask'; | ||
import type { Task } from '../execution/ExecutionTask'; | ||
import type { ExecutionTools } from '../execution/ExecutionTools'; | ||
@@ -138,3 +143,2 @@ import type { FilesystemTools } from '../execution/FilesystemTools'; | ||
import type { SectionType } from '../types/SectionType'; | ||
import type { TaskProgress } from '../types/TaskProgress'; | ||
import type { TaskType } from '../types/TaskType'; | ||
@@ -227,2 +231,3 @@ import type { string_char_emoji } from '../types/typeAliasEmoji'; | ||
import type { id } from '../types/typeAliases'; | ||
import type { task_id } from '../types/typeAliases'; | ||
import type { string_token } from '../types/typeAliases'; | ||
@@ -241,2 +246,3 @@ import type { string_license_token } from '../types/typeAliases'; | ||
import type { number_integer } from '../types/typeAliases'; | ||
import type { number_port } from '../types/typeAliases'; | ||
import type { number_percent } from '../types/typeAliases'; | ||
@@ -311,2 +317,3 @@ import type { number_model_temperature } from '../types/typeAliases'; | ||
export type { LocateAppOptions }; | ||
export type { AbstractTaskResult }; | ||
export type { AvailableModel }; | ||
@@ -321,2 +328,6 @@ export type { CommonToolsOptions }; | ||
export type { ExecutionReportStringOptions }; | ||
export type { ExecutionTask }; | ||
export type { PreparationTask }; | ||
export type { AbstractTask }; | ||
export type { Task }; | ||
export type { ExecutionTools }; | ||
@@ -418,3 +429,2 @@ export type { FilesystemTools }; | ||
export type { SectionType }; | ||
export type { TaskProgress }; | ||
export type { TaskType }; | ||
@@ -507,2 +517,3 @@ export type { string_char_emoji }; | ||
export type { id }; | ||
export type { task_id }; | ||
export type { string_token }; | ||
@@ -521,2 +532,3 @@ export type { string_license_token }; | ||
export type { number_integer }; | ||
export type { number_port }; | ||
export type { number_percent }; | ||
@@ -523,0 +535,0 @@ export type { number_model_temperature }; |
@@ -57,3 +57,2 @@ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version'; | ||
import { parseNumber } from '../utils/parseNumber'; | ||
import { $randomSeed } from '../utils/random/$randomSeed'; | ||
import { removeEmojis } from '../utils/removeEmojis'; | ||
@@ -140,3 +139,2 @@ import { removeQuotes } from '../utils/removeQuotes'; | ||
export { parseNumber }; | ||
export { $randomSeed }; | ||
export { removeEmojis }; | ||
@@ -143,0 +141,0 @@ export { removeQuotes }; |
@@ -20,3 +20,3 @@ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson'; | ||
/** | ||
* TODO: [๐] Do not return Promise<PipelineJson> But PreparePipelineTask | ||
* TODO: [๐] Do not return `Promise<PipelineJson>` But `PreparationTask` | ||
*/ |
@@ -11,4 +11,1 @@ import type { PipelineExecutor } from '../PipelineExecutor'; | ||
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor; | ||
/** | ||
* TODO: [๐] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited | ||
*/ |
@@ -1,4 +0,3 @@ | ||
import type { Promisable, ReadonlyDeep } from 'type-fest'; | ||
import type { PartialDeep, Promisable, ReadonlyDeep } from 'type-fest'; | ||
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson'; | ||
import type { TaskProgress } from '../../types/TaskProgress'; | ||
import type { InputParameters } from '../../types/typeAliases'; | ||
@@ -20,3 +19,3 @@ import type { PipelineExecutorResult } from '../PipelineExecutorResult'; | ||
*/ | ||
onProgress?(taskProgress: TaskProgress): Promisable<void>; | ||
onProgress?(newOngoingResult: PartialDeep<PipelineExecutorResult>): Promisable<void>; | ||
/** | ||
@@ -48,4 +47,1 @@ * @@@ | ||
export {}; | ||
/** | ||
* TODO: [๐] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited | ||
*/ |
@@ -1,7 +0,7 @@ | ||
import type { Promisable, ReadonlyDeep, WritableDeep } from 'type-fest'; | ||
import type { PartialDeep, Promisable, ReadonlyDeep, WritableDeep } from 'type-fest'; | ||
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson'; | ||
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson'; | ||
import type { TaskProgress } from '../../types/TaskProgress'; | ||
import type { Parameters } from '../../types/typeAliases'; | ||
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson'; | ||
import type { PipelineExecutorResult } from '../PipelineExecutorResult'; | ||
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions'; | ||
@@ -29,3 +29,3 @@ /** | ||
*/ | ||
readonly onProgress: (taskProgress: TaskProgress) => Promisable<void>; | ||
readonly onProgress: (newOngoingResult: PartialDeep<PipelineExecutorResult>) => Promisable<void>; | ||
/** | ||
@@ -50,4 +50,1 @@ * @@@ | ||
*/ | ||
/** | ||
* TODO: [๐] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited | ||
*/ |
@@ -1,5 +0,3 @@ | ||
import type { Promisable } from 'type-fest'; | ||
import type { TaskProgress } from '../types/TaskProgress'; | ||
import type { InputParameters } from '../types/typeAliases'; | ||
import type { PipelineExecutorResult } from './PipelineExecutorResult'; | ||
import type { ExecutionTask } from './ExecutionTask'; | ||
/** | ||
@@ -14,7 +12,6 @@ * Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_. | ||
export type PipelineExecutor = { | ||
(inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>; | ||
(inputParameters: InputParameters): ExecutionTask; | ||
}; | ||
/** | ||
* TODO: [๐] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited | ||
* TODO: [๐ง ] Should this file be in /execution or /types folder? | ||
*/ |
import { ReadonlyDeep } from 'type-fest'; | ||
import type { ErrorJson } from '../errors/utils/ErrorJson'; | ||
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson'; | ||
import type { Parameters } from '../types/typeAliases'; | ||
import type { AbstractTaskResult } from './AbstractTaskResult'; | ||
import type { ExecutionReportJson } from './execution-report/ExecutionReportJson'; | ||
@@ -12,3 +12,3 @@ import type { PromptResultUsage } from './PromptResultUsage'; | ||
*/ | ||
export type PipelineExecutorResult = { | ||
export type PipelineExecutorResult = AbstractTaskResult & { | ||
/** | ||
@@ -21,6 +21,2 @@ * Result parameters of the execution | ||
/** | ||
* Whether the execution was successful, details are aviable in `executionReport` | ||
*/ | ||
readonly isSuccessful: boolean; | ||
/** | ||
* Added usage of whole execution, detailed usage is aviable in `executionReport` | ||
@@ -30,10 +26,2 @@ */ | ||
/** | ||
* Errors that occured during the execution, details are aviable in `executionReport` | ||
*/ | ||
readonly errors: ReadonlyDeep<ReadonlyArray<ErrorJson>>; | ||
/** | ||
* Warnings that occured during the execution, details are aviable in `executionReport` | ||
*/ | ||
readonly warnings: ReadonlyDeep<ReadonlyArray<ErrorJson>>; | ||
/** | ||
* The report of the execution with all details | ||
@@ -52,3 +40,2 @@ */ | ||
* TODO: [๐ง ] Should this file be in /execution or /types folder? | ||
* TODO: [๐ง ] Maybe constrain `ErrorJson` -> `ErrorJson & { name: 'PipelineExecutionError' | 'Error' }` | ||
*/ |
import type { string_url } from '../types/typeAliases'; | ||
/** | ||
* Fetch function for fetching data from the internet used in scraping | ||
* Fetch function used in Promptbook engine | ||
* | ||
* In most cases it is just native `fetch` function with a lightweight error handling wrapper | ||
* But it can be replaced with any other fetch function, polyfill, custom implementation, security layer, etc. | ||
* | ||
* It is used in theese places: | ||
* - Fetching knowledge sources | ||
* - Callbacks from remote server ([๐ฉ๐พโ๐คโ๐ง๐พ] Not yet implemented) | ||
*/ | ||
export type PromptbookFetch = (url: string_url, init?: RequestInit) => Promise<Response>; |
@@ -16,3 +16,3 @@ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson'; | ||
/** | ||
* TODO: [๐] Do not return Promise<PipelineJson> But PreparePipelineTask | ||
* TODO: [๐] Do not return `Promise<PipelineJson>` But `PreparationTask` | ||
*/ |
@@ -14,2 +14,3 @@ import type { IDestroyable } from 'destroyable'; | ||
/** | ||
* TODO: [๐ฉ๐พโ๐คโ๐ง๐พ] Allow to pass custom fetch function here - PromptbookFetch | ||
* TODO: Split this file into multiple functions - handler for each request | ||
@@ -16,0 +17,0 @@ * TODO: Maybe use `$exportJson` |
@@ -559,2 +559,3 @@ import type { TupleToUnion } from 'type-fest'; | ||
export type id = string | number; | ||
export type task_id = string; | ||
export type string_token = string; | ||
@@ -592,2 +593,3 @@ export type string_license_token = string_token; | ||
export type number_integer = number; | ||
export type number_port = number_positive & number_integer; | ||
/** | ||
@@ -594,0 +596,0 @@ * Semantic helper; |
@@ -10,3 +10,3 @@ /** | ||
/** | ||
* TODO: [โ] | ||
*/ | ||
* TODO: [๐บ] | ||
*/ |
@@ -10,3 +10,3 @@ /** | ||
/** | ||
* TODO: [โ] | ||
*/ | ||
* TODO: [๐บ] | ||
*/ |
@@ -10,3 +10,3 @@ /** | ||
/** | ||
* TODO: [โ] | ||
*/ | ||
* TODO: [๐บ] | ||
*/ |
@@ -10,3 +10,3 @@ /** | ||
/** | ||
* TODO: [โ] | ||
* TODO: [๐บ] | ||
*/ |
@@ -7,4 +7,5 @@ import type { number_seed } from '../../types/typeAliases'; | ||
* Warning: This function is NOT cryptographically secure (it uses Math.random internally) | ||
* @public exported from `@promptbook/utils` | ||
* | ||
* @private internal helper function | ||
*/ | ||
export declare function $randomSeed(): number_seed; |
@@ -1,2 +0,1 @@ | ||
import { Promisable } from 'type-fest'; | ||
import type { ExecutionTools } from '../execution/ExecutionTools'; | ||
@@ -6,3 +5,2 @@ import type { PipelineExecutorResult } from '../execution/PipelineExecutorResult'; | ||
import type { PipelineString } from '../pipeline/PipelineString'; | ||
import type { TaskProgress } from '../types/TaskProgress'; | ||
import type { InputParameters } from '../types/typeAliases'; | ||
@@ -32,3 +30,3 @@ import type { string_filename } from '../types/typeAliases'; | ||
*/ | ||
execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<{ | ||
execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters): Promise<{ | ||
/** | ||
@@ -70,3 +68,4 @@ * Simple result of the execution | ||
/** | ||
* TODO: [๐ง ] Maybe some way how to handle the progress and streaming? | ||
* Note: [๐ข] Code in this file should never be never released in packages that could be imported into browser environment | ||
*/ |
{ | ||
"name": "@promptbook/google", | ||
"version": "0.84.0", | ||
"version": "0.85.0-0", | ||
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin", | ||
@@ -50,3 +50,3 @@ "private": false, | ||
"peerDependencies": { | ||
"@promptbook/core": "0.84.0" | ||
"@promptbook/core": "0.85.0-0" | ||
}, | ||
@@ -53,0 +53,0 @@ "dependencies": { |
@@ -27,2 +27,6 @@ <!-- โ ๏ธ WARNING: This code has been generated so that any manual changes will be overwritten --> | ||
<blockquote style="color: #ff8811"> | ||
<b>โ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>. | ||
</blockquote> | ||
## ๐ฆ Package `@promptbook/google` | ||
@@ -48,3 +52,3 @@ | ||
```typescript | ||
import { createPipelineExecutor, createCollectionFromDirectory, assertsExecutionSuccessful } from '@promptbook/core'; | ||
import { createPipelineExecutor, createCollectionFromDirectory } from '@promptbook/core'; | ||
import { | ||
@@ -88,7 +92,4 @@ createCollectionFromDirectory, | ||
// ๐โถ Execute the Pipeline | ||
const result = await pipelineExecutor(inputParameters); | ||
const result = await pipelineExecutor(inputParameters).asPromise({ isCrashedOnError: true }); | ||
// โถ Fail if the execution was not successful | ||
assertsExecutionSuccessful(result); | ||
// โถ Handle the result | ||
@@ -128,3 +129,3 @@ const { isSuccessful, errors, outputParameters, executionReport } = result; | ||
```typescript | ||
import { createPipelineExecutor, createCollectionFromDirectory, assertsExecutionSuccessful } from '@promptbook/core'; | ||
import { createPipelineExecutor, createCollectionFromDirectory } from '@promptbook/core'; | ||
import { JavascriptExecutionTools } from '@promptbook/execute-javascript'; | ||
@@ -150,7 +151,4 @@ import { $provideExecutionToolsForNode } from '@promptbook/node'; | ||
// ๐โถ Execute the Pipeline | ||
const result = await pipelineExecutor(inputParameters); | ||
const result = await pipelineExecutor(inputParameters).asPromise({ isCrashedOnError: true }); | ||
// โถ Fail if the execution was not successful | ||
assertsExecutionSuccessful(result); | ||
// โถ Handle the result | ||
@@ -168,3 +166,3 @@ const { isSuccessful, errors, outputParameters, executionReport } = result; | ||
```typescript | ||
import { createPipelineExecutor, createCollectionFromDirectory, assertsExecutionSuccessful } from '@promptbook/core'; | ||
import { createPipelineExecutor, createCollectionFromDirectory } from '@promptbook/core'; | ||
import { $provideExecutionToolsForNode } from '@promptbook/node'; | ||
@@ -223,7 +221,4 @@ import { $provideFilesystemForNode } from '@promptbook/node'; | ||
// ๐โถ Execute the Pipeline | ||
const result = await pipelineExecutor(inputParameters); | ||
const result = await pipelineExecutor(inputParameters).asPromise({ isCrashedOnError: true }); | ||
// โถ Fail if the execution was not successful | ||
assertsExecutionSuccessful(result); | ||
// โถ Handle the result | ||
@@ -249,2 +244,3 @@ const { isSuccessful, errors, outputParameters, executionReport } = result; | ||
--- | ||
@@ -251,0 +247,0 @@ |
@@ -26,3 +26,3 @@ (function (global, factory) { | ||
*/ | ||
var PROMPTBOOK_ENGINE_VERSION = '0.84.0-21'; | ||
var PROMPTBOOK_ENGINE_VERSION = '0.84.0'; | ||
/** | ||
@@ -161,3 +161,3 @@ * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine | ||
/** | ||
* TODO: [โ] | ||
* TODO: [๐บ] | ||
*/ | ||
@@ -164,0 +164,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
787222
688
15523
646