@promptbook/node
Advanced tools
Comparing version 0.82.0-0 to 0.82.0-2
@@ -5,4 +5,7 @@ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version'; | ||
import { preparePipelineOnRemoteServer } from '../prepare/preparePipelineOnRemoteServer'; | ||
import type { RemoteLlmExecutionToolsOptions } from '../remote-server/interfaces/RemoteLlmExecutionToolsOptions'; | ||
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { PromptbookServer_Identification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { PromptbookServer_ApplicationIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { PromptbookServer_AnonymousIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOptions'; | ||
import type { RemoteServerOptions } from '../remote-server/types/RemoteServerOptions'; | ||
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION }; | ||
@@ -12,3 +15,6 @@ export { compilePipelineOnRemoteServer }; | ||
export { preparePipelineOnRemoteServer }; | ||
export type { RemoteLlmExecutionToolsOptions }; | ||
export type { PromptbookServer_Identification }; | ||
export type { PromptbookServer_ApplicationIdentification }; | ||
export type { PromptbookServer_AnonymousIdentification }; | ||
export type { RemoteClientOptions }; | ||
export type { RemoteServerOptions }; |
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version'; | ||
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { PromptbookServer_Identification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { PromptbookServer_ApplicationIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { PromptbookServer_AnonymousIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import { startRemoteServer } from '../remote-server/startRemoteServer'; | ||
import type { RemoteServerOptions } from '../remote-server/types/RemoteServerOptions'; | ||
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION }; | ||
export type { PromptbookServer_Identification }; | ||
export type { PromptbookServer_ApplicationIdentification }; | ||
export type { PromptbookServer_AnonymousIdentification }; | ||
export { startRemoteServer }; | ||
export type { RemoteServerOptions }; | ||
export { startRemoteServer }; |
@@ -90,17 +90,10 @@ import type { PipelineCollection } from '../collection/PipelineCollection'; | ||
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions'; | ||
import type { PromptbookServer_Error } from '../remote-server/interfaces/PromptbookServer_Error'; | ||
import type { PromptbookServer_ListModels_Request } from '../remote-server/interfaces/PromptbookServer_ListModels_Request'; | ||
import type { PromptbookServer_ListModels_CollectionRequest } from '../remote-server/interfaces/PromptbookServer_ListModels_Request'; | ||
import type { PromptbookServer_ListModels_AnonymousRequest } from '../remote-server/interfaces/PromptbookServer_ListModels_Request'; | ||
import type { PromptbookServer_ListModels_Response } from '../remote-server/interfaces/PromptbookServer_ListModels_Response'; | ||
import type { PromptbookServer_Prompt_Progress } from '../remote-server/interfaces/PromptbookServer_Prompt_Progress'; | ||
import type { PromptbookServer_Prompt_Request } from '../remote-server/interfaces/PromptbookServer_Prompt_Request'; | ||
import type { PromptbookServer_Prompt_CollectionRequest } from '../remote-server/interfaces/PromptbookServer_Prompt_Request'; | ||
import type { PromptbookServer_Prompt_AnonymousRequest } from '../remote-server/interfaces/PromptbookServer_Prompt_Request'; | ||
import type { PromptbookServer_Prompt_Response } from '../remote-server/interfaces/PromptbookServer_Prompt_Response'; | ||
import type { RemoteLlmExecutionToolsOptions } from '../remote-server/interfaces/RemoteLlmExecutionToolsOptions'; | ||
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { AnonymousRemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { ApplicationRemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { ApplicationRemoteServerClientOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { PromptbookServer_Identification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { PromptbookServer_ApplicationIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { PromptbookServer_AnonymousIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification'; | ||
import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOptions'; | ||
import type { RemoteServerOptions } from '../remote-server/types/RemoteServerOptions'; | ||
import type { AnonymousRemoteServerOptions } from '../remote-server/types/RemoteServerOptions'; | ||
import type { ApplicationRemoteServerOptions } from '../remote-server/types/RemoteServerOptions'; | ||
import type { ApplicationRemoteServerClientOptions } from '../remote-server/types/RemoteServerOptions'; | ||
import type { Converter } from '../scrapers/_common/Converter'; | ||
@@ -122,2 +115,4 @@ import type { ScraperAndConverterMetadata } from '../scrapers/_common/register/ScraperAndConverterMetadata'; | ||
import type { ModelVariant } from '../types/ModelVariant'; | ||
import type { NonEmptyArray } from '../types/NonEmptyArray'; | ||
import type { NonEmptyReadonlyArray } from '../types/NonEmptyArray'; | ||
import type { Prompt } from '../types/Prompt'; | ||
@@ -358,13 +353,6 @@ import type { CompletionPrompt } from '../types/Prompt'; | ||
export type { PrepareAndScrapeOptions }; | ||
export type { PromptbookServer_Error }; | ||
export type { PromptbookServer_ListModels_Request }; | ||
export type { PromptbookServer_ListModels_CollectionRequest }; | ||
export type { PromptbookServer_ListModels_AnonymousRequest }; | ||
export type { PromptbookServer_ListModels_Response }; | ||
export type { PromptbookServer_Prompt_Progress }; | ||
export type { PromptbookServer_Prompt_Request }; | ||
export type { PromptbookServer_Prompt_CollectionRequest }; | ||
export type { PromptbookServer_Prompt_AnonymousRequest }; | ||
export type { PromptbookServer_Prompt_Response }; | ||
export type { RemoteLlmExecutionToolsOptions }; | ||
export type { PromptbookServer_Identification }; | ||
export type { PromptbookServer_ApplicationIdentification }; | ||
export type { PromptbookServer_AnonymousIdentification }; | ||
export type { RemoteClientOptions }; | ||
export type { RemoteServerOptions }; | ||
@@ -390,2 +378,4 @@ export type { AnonymousRemoteServerOptions }; | ||
export type { ModelVariant }; | ||
export type { NonEmptyArray }; | ||
export type { NonEmptyReadonlyArray }; | ||
export type { Prompt }; | ||
@@ -392,0 +382,0 @@ export type { CompletionPrompt }; |
@@ -23,4 +23,6 @@ import type { Promisable } from 'type-fest'; | ||
* Checks whether given prompt was defined in any pipeline in the collection | ||
* | ||
* @deprecated Make better mechanism for skimming the remote server | ||
*/ | ||
isResponsibleForPrompt(prompt: Prompt): Promisable<boolean>; | ||
}; |
@@ -1,4 +0,4 @@ | ||
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson'; | ||
import type { PipelineString } from '../pipeline/PipelineString'; | ||
import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOptions'; | ||
/** | ||
@@ -13,3 +13,3 @@ * Compile pipeline from string (markdown) format to JSON format | ||
* @param pipelineString {Promptbook} in string markdown format (.book.md) | ||
* @param options - Options for remote server compilation | ||
* @param options - Configuration of the remote server | ||
* @returns {Promptbook} compiled in JSON format (.book.json) | ||
@@ -19,2 +19,5 @@ * @throws {ParseError} if the promptbook string is not valid | ||
*/ | ||
export declare function compilePipelineOnRemoteServer<TCustomOptions = undefined>(pipelineString: PipelineString, options: RemoteServerOptions<TCustomOptions>): Promise<PipelineJson>; | ||
export declare function compilePipelineOnRemoteServer<TCustomOptions = undefined>(pipelineString: PipelineString, options: RemoteClientOptions<TCustomOptions>): Promise<PipelineJson>; | ||
/** | ||
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask | ||
*/ |
import type { ClientOptions } from '@anthropic-ai/sdk'; | ||
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions'; | ||
import type { RemoteLlmExecutionToolsOptions } from '../../remote-server/interfaces/RemoteLlmExecutionToolsOptions'; | ||
import type { RemoteClientOptions } from '../../remote-server/types/RemoteClientOptions'; | ||
/** | ||
@@ -28,5 +28,5 @@ * Options for `AnthropicClaudeExecutionTools` | ||
isProxied: true; | ||
} & Pick<RemoteLlmExecutionToolsOptions<undefined>, 'remoteUrl' | 'path'>; | ||
} & Pick<RemoteClientOptions<undefined>, 'remoteUrl' | 'path'>; | ||
/** | ||
* TODO: [π§ ][π€Ί] Pass `userId` | ||
*/ |
@@ -6,2 +6,3 @@ import type { AvailableModel } from '../../execution/AvailableModel'; | ||
import type { EmbeddingPromptResult } from '../../execution/PromptResult'; | ||
import type { RemoteClientOptions } from '../../remote-server/types/RemoteClientOptions'; | ||
import type { ChatPrompt } from '../../types/Prompt'; | ||
@@ -13,3 +14,2 @@ import type { CompletionPrompt } from '../../types/Prompt'; | ||
import type { string_title } from '../../types/typeAliases'; | ||
import type { RemoteLlmExecutionToolsOptions } from '../../remote-server/interfaces/RemoteLlmExecutionToolsOptions'; | ||
/** | ||
@@ -25,4 +25,4 @@ * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally. | ||
export declare class RemoteLlmExecutionTools<TCustomOptions = undefined> implements LlmExecutionTools { | ||
protected readonly options: RemoteLlmExecutionToolsOptions<TCustomOptions>; | ||
constructor(options: RemoteLlmExecutionToolsOptions<TCustomOptions>); | ||
protected readonly options: RemoteClientOptions<TCustomOptions>; | ||
constructor(options: RemoteClientOptions<TCustomOptions>); | ||
get title(): string_title & string_markdown_text; | ||
@@ -39,6 +39,2 @@ get description(): string_markdown; | ||
/** | ||
* Creates a connection to the remote proxy server. | ||
*/ | ||
private makeConnection; | ||
/** | ||
* Calls remote proxy server to use a chat model | ||
@@ -45,0 +41,0 @@ */ |
@@ -0,3 +1,5 @@ | ||
import { SetRequired } from 'type-fest'; | ||
import type { string_formfactor_name } from '../../formfactors/_common/string_formfactor_name'; | ||
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson'; | ||
import type { NonEmptyReadonlyArray } from '../../types/NonEmptyArray'; | ||
/** | ||
@@ -9,3 +11,3 @@ * @@@ | ||
*/ | ||
export declare let pipelines: Array<PipelineJson> | null; | ||
export declare let pipelines: Array<SetRequired<PipelineJson, 'pipelineUrl'>> | null; | ||
/** | ||
@@ -18,7 +20,7 @@ * Get template for new book | ||
*/ | ||
export declare function getBookTemplates(formfactorName?: string_formfactor_name): ReadonlyArray<PipelineJson>; | ||
export declare function getBookTemplates(formfactorName?: string_formfactor_name): NonEmptyReadonlyArray<SetRequired<PipelineJson, 'pipelineUrl'>>; | ||
/** | ||
* TODO: Unit test | ||
* TODO: Unit test + test that what we guarantee - always return non-empty array is true for e | ||
* TODO: [π§ ] Which is the best place for this function | ||
* TODO: !!6 For GENERIC template ensure at least one pipeline is present for typescript in `getBookTemplates` | ||
*/ |
@@ -1,3 +0,3 @@ | ||
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions'; | ||
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson'; | ||
import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOptions'; | ||
/** | ||
@@ -14,2 +14,5 @@ * Prepare pipeline on remote server | ||
*/ | ||
export declare function preparePipelineOnRemoteServer<TCustomOptions = undefined>(pipeline: PipelineJson, options: RemoteServerOptions<TCustomOptions>): Promise<PipelineJson>; | ||
export declare function preparePipelineOnRemoteServer<TCustomOptions = undefined>(pipeline: PipelineJson, options: RemoteClientOptions<TCustomOptions>): Promise<PipelineJson>; | ||
/** | ||
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask | ||
*/ |
import type { IDestroyable } from 'destroyable'; | ||
import type { RemoteServerOptions } from './interfaces/RemoteServerOptions'; | ||
import type { RemoteServerOptions } from './types/RemoteServerOptions'; | ||
/** | ||
@@ -14,2 +14,3 @@ * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally. | ||
/** | ||
* TODO: Split this file into multiple functions - handler for each request | ||
* TODO: Maybe use `$exportJson` | ||
@@ -23,3 +24,3 @@ * TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here | ||
* TODO: Constrain anonymous mode for specific models / providers | ||
* TODO: Allow to constrain anonymous mode for specific models / providers | ||
*/ |
@@ -8,4 +8,5 @@ /** | ||
* | ||
* @deprecated Use `Arrayable` from `type-fest` instead | ||
* @private internal type | ||
*/ | ||
export type Arrayable<TItem> = TItem | ReadonlyArray<TItem> | undefined; |
{ | ||
"name": "@promptbook/node", | ||
"version": "0.82.0-0", | ||
"version": "0.82.0-2", | ||
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin", | ||
@@ -57,3 +57,3 @@ "--note-0": " <- [π]", | ||
"peerDependencies": { | ||
"@promptbook/core": "0.82.0-0" | ||
"@promptbook/core": "0.82.0-2" | ||
}, | ||
@@ -60,0 +60,0 @@ "dependencies": { |
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
2269421
658
35045