@promptbook/remote-client
Advanced tools
Comparing version 0.66.0-8 to 0.66.0-9
@@ -7,3 +7,3 @@ import { io } from 'socket.io-client'; | ||
*/ | ||
var PROMPTBOOK_VERSION = '0.66.0-7'; | ||
var PROMPTBOOK_VERSION = '0.66.0-8'; | ||
// TODO: !!!! List here all the versions and annotate + put into script | ||
@@ -129,4 +129,11 @@ | ||
return __awaiter(this, void 0, void 0, function () { | ||
var socket; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/]; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.makeConnection()]; | ||
case 1: | ||
socket = _a.sent(); | ||
socket.disconnect(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
@@ -140,7 +147,35 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var socket, promptResult; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (this.options.models || | ||
[ | ||
/* !!!!!! */ | ||
])]; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.makeConnection()]; | ||
case 1: | ||
socket = _a.sent(); | ||
if (this.options.isAnonymous) { | ||
socket.emit('listModels-request', { | ||
isAnonymous: true, | ||
llmToolsConfiguration: this.options.llmToolsConfiguration, | ||
}); | ||
} | ||
else { | ||
socket.emit('listModels-request', { | ||
isAnonymous: false, | ||
clientId: this.options.clientId, | ||
}); | ||
} | ||
return [4 /*yield*/, new Promise(function (resolve, reject) { | ||
socket.on('listModels-response', function (response) { | ||
resolve(response.models); | ||
socket.disconnect(); | ||
}); | ||
socket.on('error', function (error) { | ||
reject(new Error(error.errorMessage)); | ||
socket.disconnect(); | ||
}); | ||
})]; | ||
case 2: | ||
promptResult = _a.sent(); | ||
socket.disconnect(); | ||
return [2 /*return*/, promptResult]; | ||
} | ||
}); | ||
@@ -212,3 +247,4 @@ }); | ||
if (this.options.isAnonymous) { | ||
socket.emit('request', { | ||
socket.emit('prompt-request', { | ||
isAnonymous: true, | ||
llmToolsConfiguration: this.options.llmToolsConfiguration, | ||
@@ -220,3 +256,4 @@ prompt: prompt, | ||
else { | ||
socket.emit('request', { | ||
socket.emit('prompt-request', { | ||
isAnonymous: false, | ||
clientId: this.options.clientId, | ||
@@ -228,3 +265,3 @@ prompt: prompt, | ||
return [4 /*yield*/, new Promise(function (resolve, reject) { | ||
socket.on('response', function (response) { | ||
socket.on('prompt-response', function (response) { | ||
resolve(response.promptResult); | ||
@@ -249,2 +286,3 @@ socket.disconnect(); | ||
/** | ||
* TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [π] Allow to list compatible models with each variant | ||
@@ -251,0 +289,0 @@ * TODO: [π―] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable |
@@ -9,3 +9,2 @@ import { PROMPTBOOK_VERSION } from '../version'; | ||
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor'; | ||
import { _ } from '../llm-providers/anthropic-claude/register1'; | ||
export { PROMPTBOOK_VERSION }; | ||
@@ -19,2 +18,1 @@ export { ANTHROPIC_CLAUDE_MODELS }; | ||
export { _AnthropicClaudeRegistration }; | ||
export { _ }; |
import { PROMPTBOOK_VERSION } from '../version'; | ||
import { _CLI } from '../cli/main'; | ||
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration'; | ||
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor'; | ||
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration'; | ||
import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor'; | ||
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration'; | ||
import { _OpenAiRegistration } from '../llm-providers/openai/register-constructor'; | ||
export { PROMPTBOOK_VERSION }; | ||
export { _CLI }; | ||
export { _AnthropicClaudeMetadataRegistration }; | ||
export { _AnthropicClaudeRegistration }; | ||
export { _AzureOpenAiMetadataRegistration }; | ||
export { _AzureOpenAiRegistration }; | ||
export { _OpenAiMetadataRegistration }; | ||
export { _OpenAiRegistration }; |
@@ -47,8 +47,12 @@ import type { PipelineCollection } from '../collection/PipelineCollection'; | ||
import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions'; | ||
import type { Promptbook_Server_Error } from '../llm-providers/remote/interfaces/Promptbook_Server_Error'; | ||
import type { Promptbook_Server_Progress } from '../llm-providers/remote/interfaces/Promptbook_Server_Progress'; | ||
import type { Promptbook_Server_Request } from '../llm-providers/remote/interfaces/Promptbook_Server_Request'; | ||
import type { Promptbook_Server_CollectionRequest } from '../llm-providers/remote/interfaces/Promptbook_Server_Request'; | ||
import type { Promptbook_Server_AnonymousRequest } from '../llm-providers/remote/interfaces/Promptbook_Server_Request'; | ||
import type { Promptbook_Server_Response } from '../llm-providers/remote/interfaces/Promptbook_Server_Response'; | ||
import type { PromptbookServer_Error } from '../llm-providers/remote/interfaces/PromptbookServer_Error'; | ||
import type { PromptbookServer_ListModels_Request } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request'; | ||
import type { PromptbookServer_ListModels_CollectionRequest } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request'; | ||
import type { PromptbookServer_ListModels_AnonymousRequest } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request'; | ||
import type { PromptbookServer_ListModels_Response } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Response'; | ||
import type { PromptbookServer_Prompt_Progress } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Progress'; | ||
import type { PromptbookServer_Prompt_Request } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Request'; | ||
import type { PromptbookServer_Prompt_CollectionRequest } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Request'; | ||
import type { PromptbookServer_Prompt_AnonymousRequest } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Request'; | ||
import type { PromptbookServer_Prompt_Response } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Response'; | ||
import type { RemoteLlmExecutionToolsOptions } from '../llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions'; | ||
@@ -207,2 +211,3 @@ import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions'; | ||
import type { number_terabytes } from '../types/typeAliases'; | ||
import type { Registered } from '../utils/$Register'; | ||
import type { FromtoItems } from '../utils/FromtoItems'; | ||
@@ -220,3 +225,2 @@ import type { CodeBlock } from '../utils/markdown/extractAllBlocksFromMarkdown'; | ||
import type { TODO_any } from '../utils/organization/TODO_any'; | ||
import type { Registered } from '../utils/Register'; | ||
import type { string_promptbook_version } from '../version'; | ||
@@ -269,8 +273,12 @@ export type { PipelineCollection }; | ||
export type { OpenAiExecutionToolsOptions }; | ||
export type { Promptbook_Server_Error }; | ||
export type { Promptbook_Server_Progress }; | ||
export type { Promptbook_Server_Request }; | ||
export type { Promptbook_Server_CollectionRequest }; | ||
export type { Promptbook_Server_AnonymousRequest }; | ||
export type { Promptbook_Server_Response }; | ||
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 }; | ||
@@ -429,2 +437,3 @@ export type { RemoteServerOptions }; | ||
export type { number_terabytes }; | ||
export type { Registered }; | ||
export type { FromtoItems }; | ||
@@ -442,3 +451,2 @@ export type { CodeBlock }; | ||
export type { TODO_any }; | ||
export type { Registered }; | ||
export type { string_promptbook_version }; |
@@ -10,10 +10,10 @@ import { PROMPTBOOK_VERSION } from '../version'; | ||
import { extractBlock } from '../postprocessing/utils/extractBlock'; | ||
import { $currentDate } from '../utils/$currentDate'; | ||
import { clonePipeline } from '../utils/clonePipeline'; | ||
import { $currentDate } from '../utils/currentDate'; | ||
import { deepClone } from '../utils/deepClone'; | ||
import { $deepFreeze } from '../utils/deepFreeze'; | ||
import { $getGlobalScope } from '../utils/environment/getGlobalScope'; | ||
import { $isRunningInBrowser } from '../utils/environment/isRunningInBrowser'; | ||
import { $isRunningInNode } from '../utils/environment/isRunningInNode'; | ||
import { $isRunningInWebWorker } from '../utils/environment/isRunningInWebWorker'; | ||
import { $getGlobalScope } from '../utils/environment/$getGlobalScope'; | ||
import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser'; | ||
import { $isRunningInNode } from '../utils/environment/$isRunningInNode'; | ||
import { $isRunningInWebWorker } from '../utils/environment/$isRunningInWebWorker'; | ||
import { countCharacters } from '../utils/expectation-counters/countCharacters'; | ||
@@ -51,3 +51,3 @@ import { countLines } from '../utils/expectation-counters/countLines'; | ||
import { parseNumber } from '../utils/parseNumber'; | ||
import { $randomSeed } from '../utils/random/randomSeed'; | ||
import { $randomSeed } from '../utils/random/$randomSeed'; | ||
import { removeEmojis } from '../utils/removeEmojis'; | ||
@@ -81,4 +81,4 @@ import { removeQuotes } from '../utils/removeQuotes'; | ||
export { extractBlock }; | ||
export { $currentDate }; | ||
export { clonePipeline }; | ||
export { $currentDate }; | ||
export { deepClone }; | ||
@@ -85,0 +85,0 @@ export { $deepFreeze }; |
@@ -0,3 +1,3 @@ | ||
import type { Registered } from '../utils/$Register'; | ||
import type { TODO_any } from '../utils/organization/TODO_any'; | ||
import type { Registered } from '../utils/Register'; | ||
import type { LlmExecutionTools } from './LlmExecutionTools'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { Register } from '../../utils/Register'; | ||
import { $Register } from '../../utils/$Register'; | ||
import type { LlmToolsMetadata } from './LlmToolsMetadata'; | ||
@@ -10,2 +10,2 @@ /** | ||
*/ | ||
export declare const $llmToolsMetadataRegister: Register<LlmToolsMetadata>; | ||
export declare const $llmToolsMetadataRegister: $Register<LlmToolsMetadata>; |
import type { LlmExecutionToolsConstructor } from '../../execution/LlmExecutionToolsConstructor'; | ||
import { Register } from '../../utils/Register'; | ||
import { $Register } from '../../utils/$Register'; | ||
/** | ||
@@ -10,2 +10,2 @@ * @@@ | ||
*/ | ||
export declare const $llmToolsRegister: Register<LlmExecutionToolsConstructor>; | ||
export declare const $llmToolsRegister: $Register<LlmExecutionToolsConstructor>; |
@@ -16,2 +16,3 @@ import type { LlmToolsConfiguration } from './LlmToolsConfiguration'; | ||
/** | ||
* TODO: [π§ ][πͺ] Maybe do allow to do auto-install if package not registered and not found | ||
* TODO: Add Azure OpenAI | ||
@@ -18,0 +19,0 @@ * TODO: [π§ ][π] |
@@ -1,2 +0,2 @@ | ||
import '../../_packages/core.index'; | ||
import '../../_packages/cli.index'; | ||
import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFromConfiguration'; | ||
@@ -3,0 +3,0 @@ import type { LlmExecutionToolsWithTotalUsage } from './utils/count-total-usage/LlmExecutionToolsWithTotalUsage'; |
import type { string_title } from '../../types/typeAliases'; | ||
import type { Registered } from '../../utils/Register'; | ||
import type { Registered } from '../../utils/$Register'; | ||
import type { LlmToolsOptions } from './LlmToolsOptions'; | ||
@@ -4,0 +4,0 @@ /** |
import type { string_name } from '../../types/typeAliases'; | ||
import type { string_title } from '../../types/typeAliases'; | ||
import type { Registered } from '../../utils/Register'; | ||
import type { Registered } from '../../utils/$Register'; | ||
import type { LlmToolsConfiguration } from './LlmToolsConfiguration'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -7,2 +7,3 @@ /** | ||
* @public exported from `@promptbook/anthropic-claude` | ||
* @public exported from `@promptbook/cli` | ||
*/ | ||
@@ -9,0 +10,0 @@ export declare const _AnthropicClaudeRegistration: void; |
@@ -7,2 +7,3 @@ /** | ||
* @public exported from `@promptbook/azure-openai` | ||
* @public exported from `@promptbook/cli` | ||
*/ | ||
@@ -9,0 +10,0 @@ export declare const _AzureOpenAiRegistration: void; |
@@ -7,2 +7,3 @@ /** | ||
* @public exported from `@promptbook/openai` | ||
* @public exported from `@promptbook/cli` | ||
*/ | ||
@@ -9,0 +10,0 @@ export declare const _OpenAiRegistration: void; |
@@ -1,2 +0,1 @@ | ||
import type { AvailableModel } from '../../../execution/AvailableModel'; | ||
import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions'; | ||
@@ -26,8 +25,2 @@ import type { client_id } from '../../../types/typeAliases'; | ||
/** | ||
* If set, only these models will be listed as available | ||
* | ||
* TODO: [π§ ] !!!!!! Figure out better solution | ||
*/ | ||
readonly models?: Array<AvailableModel>; | ||
/** | ||
* Mode of the server to connect to | ||
@@ -56,3 +49,4 @@ */ | ||
/** | ||
* TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [π§ ][π§ββοΈ] Maybe join remoteUrl and path into single value | ||
*/ |
@@ -57,2 +57,3 @@ import type { AvailableModel } from '../../execution/AvailableModel'; | ||
/** | ||
* TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [π] Allow to list compatible models with each variant | ||
@@ -59,0 +60,0 @@ * TODO: [π―] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable |
@@ -14,2 +14,3 @@ import type { IDestroyable } from 'destroyable'; | ||
/** | ||
* TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [β] Expose the collection to be able to connect to same collection via createCollectionFromUrl | ||
@@ -16,0 +17,0 @@ * TODO: Handle progress - support streaming |
{ | ||
"name": "@promptbook/remote-client", | ||
"version": "0.66.0-8", | ||
"version": "0.66.0-9", | ||
"description": "Supercharge your use of large language models", | ||
@@ -50,3 +50,3 @@ "private": false, | ||
"peerDependencies": { | ||
"@promptbook/core": "0.66.0-8" | ||
"@promptbook/core": "0.66.0-9" | ||
}, | ||
@@ -53,0 +53,0 @@ "dependencies": { |
@@ -11,3 +11,3 @@ (function (global, factory) { | ||
*/ | ||
var PROMPTBOOK_VERSION = '0.66.0-7'; | ||
var PROMPTBOOK_VERSION = '0.66.0-8'; | ||
// TODO: !!!! List here all the versions and annotate + put into script | ||
@@ -133,4 +133,11 @@ | ||
return __awaiter(this, void 0, void 0, function () { | ||
var socket; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/]; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.makeConnection()]; | ||
case 1: | ||
socket = _a.sent(); | ||
socket.disconnect(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
@@ -144,7 +151,35 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var socket, promptResult; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (this.options.models || | ||
[ | ||
/* !!!!!! */ | ||
])]; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.makeConnection()]; | ||
case 1: | ||
socket = _a.sent(); | ||
if (this.options.isAnonymous) { | ||
socket.emit('listModels-request', { | ||
isAnonymous: true, | ||
llmToolsConfiguration: this.options.llmToolsConfiguration, | ||
}); | ||
} | ||
else { | ||
socket.emit('listModels-request', { | ||
isAnonymous: false, | ||
clientId: this.options.clientId, | ||
}); | ||
} | ||
return [4 /*yield*/, new Promise(function (resolve, reject) { | ||
socket.on('listModels-response', function (response) { | ||
resolve(response.models); | ||
socket.disconnect(); | ||
}); | ||
socket.on('error', function (error) { | ||
reject(new Error(error.errorMessage)); | ||
socket.disconnect(); | ||
}); | ||
})]; | ||
case 2: | ||
promptResult = _a.sent(); | ||
socket.disconnect(); | ||
return [2 /*return*/, promptResult]; | ||
} | ||
}); | ||
@@ -216,3 +251,4 @@ }); | ||
if (this.options.isAnonymous) { | ||
socket.emit('request', { | ||
socket.emit('prompt-request', { | ||
isAnonymous: true, | ||
llmToolsConfiguration: this.options.llmToolsConfiguration, | ||
@@ -224,3 +260,4 @@ prompt: prompt, | ||
else { | ||
socket.emit('request', { | ||
socket.emit('prompt-request', { | ||
isAnonymous: false, | ||
clientId: this.options.clientId, | ||
@@ -232,3 +269,3 @@ prompt: prompt, | ||
return [4 /*yield*/, new Promise(function (resolve, reject) { | ||
socket.on('response', function (response) { | ||
socket.on('prompt-response', function (response) { | ||
resolve(response.promptResult); | ||
@@ -253,2 +290,3 @@ socket.disconnect(); | ||
/** | ||
* TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [π] Allow to list compatible models with each variant | ||
@@ -255,0 +293,0 @@ * TODO: [π―] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable |
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
446921
464
8589