@promptbook/core 0.72.0-12 → 0.72.0-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/esm/index.es.js +3 -3
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +7 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -1
- package/package.json +1 -1
- package/umd/index.umd.js +3 -3
- package/umd/index.umd.js.map +1 -1
|
@@ -52,7 +52,7 @@ export type LlmExecutionTools = {
|
|
|
52
52
|
callEmbeddingModel?(prompt: Prompt): Promise<EmbeddingPromptResult>;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
* TODO: Implement destroyable pattern to free resources
|
|
55
|
+
* TODO: [🍚] Implement destroyable pattern to free resources
|
|
56
56
|
* TODO: [🏳] Add `callTranslationModel`
|
|
57
57
|
* TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
|
|
58
58
|
* TODO: [🍓][♐] Some heuristic to pick the best model in listed models
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { string_user_id } from '../../../types/typeAliases';
|
|
1
2
|
import { MultipleLlmExecutionTools } from '../../multiple/MultipleLlmExecutionTools';
|
|
2
3
|
import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
|
|
3
4
|
/**
|
|
@@ -12,6 +13,12 @@ export type CreateLlmToolsFromConfigurationOptions = {
|
|
|
12
13
|
* @default false
|
|
13
14
|
*/
|
|
14
15
|
isVerbose?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Identifier of the end user
|
|
18
|
+
*
|
|
19
|
+
* Note: This is passed to the LLM tools providers to identify misuse
|
|
20
|
+
*/
|
|
21
|
+
readonly userId?: string_user_id | null;
|
|
15
22
|
};
|
|
16
23
|
/**
|
|
17
24
|
* @@@
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
1
2
|
import type { PipelineCollection } from '../../../collection/PipelineCollection';
|
|
2
3
|
import type { CommonToolsOptions } from '../../../execution/CommonToolsOptions';
|
|
3
4
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
@@ -51,7 +52,7 @@ export type CollectionRemoteServerOptions<TCustomOptions> = {
|
|
|
51
52
|
/**
|
|
52
53
|
* Creates llm execution tools for each client
|
|
53
54
|
*/
|
|
54
|
-
createLlmExecutionTools(options: CollectionRemoteServerClientOptions<TCustomOptions>): LlmExecutionTools
|
|
55
|
+
createLlmExecutionTools(options: CollectionRemoteServerClientOptions<TCustomOptions>): Promisable<LlmExecutionTools>;
|
|
55
56
|
};
|
|
56
57
|
export type CollectionRemoteServerClientOptions<TCustomOptions> = {
|
|
57
58
|
/**
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* The version of the Promptbook library
|
|
18
18
|
*/
|
|
19
|
-
var PROMPTBOOK_VERSION = '0.72.0-
|
|
19
|
+
var PROMPTBOOK_VERSION = '0.72.0-13';
|
|
20
20
|
// TODO: [main] !!!! List here all the versions and annotate + put into script
|
|
21
21
|
|
|
22
22
|
/*! *****************************************************************************
|
|
@@ -8964,7 +8964,7 @@
|
|
|
8964
8964
|
*/
|
|
8965
8965
|
function createLlmToolsFromConfiguration(configuration, options) {
|
|
8966
8966
|
if (options === void 0) { options = {}; }
|
|
8967
|
-
var _a = options.isVerbose, isVerbose = _a === void 0 ? IS_VERBOSE : _a;
|
|
8967
|
+
var _a = options.isVerbose, isVerbose = _a === void 0 ? IS_VERBOSE : _a, userId = options.userId;
|
|
8968
8968
|
var llmTools = configuration.map(function (llmConfiguration) {
|
|
8969
8969
|
var registeredItem = $llmToolsRegister
|
|
8970
8970
|
.list()
|
|
@@ -8975,7 +8975,7 @@
|
|
|
8975
8975
|
if (registeredItem === undefined) {
|
|
8976
8976
|
throw new Error(spaceTrim__default["default"](function (block) { return "\n There is no constructor for LLM provider `".concat(llmConfiguration.className, "` from `").concat(llmConfiguration.packageName, "`\n\n You have probably forgotten install and import the provider package.\n To fix this issue, you can:\n\n Install:\n\n > npm install ").concat(llmConfiguration.packageName, "\n\n And import:\n\n > import '").concat(llmConfiguration.packageName, "';\n\n\n ").concat(block($registeredLlmToolsMessage()), "\n "); }));
|
|
8977
8977
|
}
|
|
8978
|
-
return registeredItem(__assign({ isVerbose: isVerbose }, llmConfiguration.options));
|
|
8978
|
+
return registeredItem(__assign({ isVerbose: isVerbose, userId: userId }, llmConfiguration.options));
|
|
8979
8979
|
});
|
|
8980
8980
|
return joinLlmExecutionTools.apply(void 0, __spreadArray([], __read(llmTools), false));
|
|
8981
8981
|
}
|