@salesforce/lds-adapters-service-einsteinllm 1.213.0 → 1.213.1
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/dist/es/es2018/service-einsteinllm.js +41 -62
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +3 -1
- package/dist/es/es2018/types/src/generated/adapters/createGenerations.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/createGenerationsForPromptTemplate.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -2
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -3
- package/package.json +1 -1
- package/sfdc/index.js +48 -69
- package/dist/es/es2018/types/src/generated/adapters/createGenerateMessages.d.ts +0 -15
- package/dist/es/es2018/types/src/generated/adapters/createGenerateMessagesForPromptTemplate.d.ts +0 -16
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -41,6 +41,24 @@ function untrustedIsObject(untrusted) {
|
|
|
41
41
|
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
42
|
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
43
|
}
|
|
44
|
+
function generateParamConfigMetadata(name, required, coerceFn) {
|
|
45
|
+
return {
|
|
46
|
+
name,
|
|
47
|
+
required,
|
|
48
|
+
coerceFn,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
52
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
53
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
54
|
+
return {
|
|
55
|
+
displayName,
|
|
56
|
+
parameters: {
|
|
57
|
+
required,
|
|
58
|
+
optional,
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
44
62
|
const keyPrefix = 'EinsteinLLM';
|
|
45
63
|
|
|
46
64
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
@@ -457,26 +475,8 @@ const ingest$1 = function EinsteinLlmGenerationsRepresentationIngest(input, path
|
|
|
457
475
|
}
|
|
458
476
|
}
|
|
459
477
|
const key = keyBuilderFromType$1(luvio, input);
|
|
460
|
-
const existingRecord = store.readEntry(key);
|
|
461
478
|
const ttlToUse = TTL$1;
|
|
462
|
-
|
|
463
|
-
fullPath: key,
|
|
464
|
-
parent: path.parent,
|
|
465
|
-
propertyName: path.propertyName,
|
|
466
|
-
ttl: ttlToUse
|
|
467
|
-
});
|
|
468
|
-
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
469
|
-
luvio.storePublish(key, incomingRecord);
|
|
470
|
-
}
|
|
471
|
-
{
|
|
472
|
-
const storeMetadataParams = {
|
|
473
|
-
ttl: ttlToUse,
|
|
474
|
-
namespace: "EinsteinLLM",
|
|
475
|
-
version: VERSION$1,
|
|
476
|
-
representationName: RepresentationType$1,
|
|
477
|
-
};
|
|
478
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
479
|
-
}
|
|
479
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$1, RepresentationType$1, equals$1);
|
|
480
480
|
return createLink(key);
|
|
481
481
|
};
|
|
482
482
|
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -526,13 +526,11 @@ function createResourceRequest$1(config) {
|
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
};
|
|
529
|
+
const adapterName$1 = 'createGenerations';
|
|
530
|
+
const createGenerations_ConfigPropertyMetadata = [
|
|
531
|
+
generateParamConfigMetadata('generationsInput', true),
|
|
532
|
+
];
|
|
533
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerations_ConfigPropertyMetadata);
|
|
536
534
|
function createResourceParams$1(config) {
|
|
537
535
|
const resourceParams = {
|
|
538
536
|
body: {
|
|
@@ -581,12 +579,12 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
581
579
|
throw response;
|
|
582
580
|
});
|
|
583
581
|
}
|
|
584
|
-
const
|
|
585
|
-
return function
|
|
586
|
-
const config = validateAdapterConfig$1(untrustedConfig,
|
|
582
|
+
const createGenerationsAdapterFactory = (luvio) => {
|
|
583
|
+
return function createGenerations(untrustedConfig) {
|
|
584
|
+
const config = validateAdapterConfig$1(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
587
585
|
// Invalid or incomplete config
|
|
588
586
|
if (config === null) {
|
|
589
|
-
throw new Error('Invalid config for "
|
|
587
|
+
throw new Error('Invalid config for "createGenerations"');
|
|
590
588
|
}
|
|
591
589
|
return buildNetworkSnapshot$1(luvio, config);
|
|
592
590
|
};
|
|
@@ -836,26 +834,8 @@ const ingest = function EinsteinPromptTemplateGenerationsRepresentationIngest(in
|
|
|
836
834
|
}
|
|
837
835
|
}
|
|
838
836
|
const key = keyBuilderFromType(luvio, input);
|
|
839
|
-
const existingRecord = store.readEntry(key);
|
|
840
837
|
const ttlToUse = TTL;
|
|
841
|
-
|
|
842
|
-
fullPath: key,
|
|
843
|
-
parent: path.parent,
|
|
844
|
-
propertyName: path.propertyName,
|
|
845
|
-
ttl: ttlToUse
|
|
846
|
-
});
|
|
847
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
848
|
-
luvio.storePublish(key, incomingRecord);
|
|
849
|
-
}
|
|
850
|
-
{
|
|
851
|
-
const storeMetadataParams = {
|
|
852
|
-
ttl: ttlToUse,
|
|
853
|
-
namespace: "EinsteinLLM",
|
|
854
|
-
version: VERSION,
|
|
855
|
-
representationName: RepresentationType,
|
|
856
|
-
};
|
|
857
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
858
|
-
}
|
|
838
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "EinsteinLLM", VERSION, RepresentationType, equals);
|
|
859
839
|
return createLink(key);
|
|
860
840
|
};
|
|
861
841
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -905,13 +885,12 @@ function createResourceRequest(config) {
|
|
|
905
885
|
};
|
|
906
886
|
}
|
|
907
887
|
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
};
|
|
888
|
+
const adapterName = 'createGenerationsForPromptTemplate';
|
|
889
|
+
const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
890
|
+
generateParamConfigMetadata('promptTemplateDevName', true),
|
|
891
|
+
generateParamConfigMetadata('promptTemplateGenerationsInput', true),
|
|
892
|
+
];
|
|
893
|
+
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
915
894
|
function createResourceParams(config) {
|
|
916
895
|
const resourceParams = {
|
|
917
896
|
urlParams: {
|
|
@@ -966,15 +945,15 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
966
945
|
throw response;
|
|
967
946
|
});
|
|
968
947
|
}
|
|
969
|
-
const
|
|
970
|
-
return function
|
|
971
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
948
|
+
const createGenerationsForPromptTemplateAdapterFactory = (luvio) => {
|
|
949
|
+
return function createGenerationsForPromptTemplate(untrustedConfig) {
|
|
950
|
+
const config = validateAdapterConfig(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
972
951
|
// Invalid or incomplete config
|
|
973
952
|
if (config === null) {
|
|
974
|
-
throw new Error('Invalid config for "
|
|
953
|
+
throw new Error('Invalid config for "createGenerationsForPromptTemplate"');
|
|
975
954
|
}
|
|
976
955
|
return buildNetworkSnapshot(luvio, config);
|
|
977
956
|
};
|
|
978
957
|
};
|
|
979
958
|
|
|
980
|
-
export {
|
|
959
|
+
export { createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot } from '@luvio/engine';
|
|
1
|
+
import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot, AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata } from '@luvio/engine';
|
|
2
2
|
export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
|
|
3
3
|
declare const ObjectKeys: {
|
|
4
4
|
(o: object): string[];
|
|
@@ -57,4 +57,6 @@ export declare const snapshotRefreshOptions: {
|
|
|
57
57
|
export declare function stableJSONStringify(node: any): string | undefined;
|
|
58
58
|
export declare function getFetchResponseStatusText(status: number): string;
|
|
59
59
|
export declare function isUnfulfilledSnapshot<T, U>(snapshot: $64$luvio_engine_Snapshot<T, U>): snapshot is $64$luvio_engine_UnfulfilledSnapshot<T, U>;
|
|
60
|
+
export declare function generateParamConfigMetadata(name: string, required: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
|
|
61
|
+
export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
|
|
60
62
|
export declare const keyPrefix = "EinsteinLLM";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
2
|
+
import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
|
|
3
|
+
import { EinsteinLlmGenerationsInputRepresentation as types_EinsteinLlmGenerationsInputRepresentation_EinsteinLlmGenerationsInputRepresentation } from '../types/EinsteinLlmGenerationsInputRepresentation';
|
|
4
|
+
import { ResourceRequestConfig as resources_postEinsteinLlmPromptGenerations_ResourceRequestConfig } from '../resources/postEinsteinLlmPromptGenerations';
|
|
5
|
+
import { EinsteinLlmGenerationsRepresentation as types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation } from '../types/EinsteinLlmGenerationsRepresentation';
|
|
6
|
+
export declare const adapterName = "createGenerations";
|
|
7
|
+
export declare const createGenerations_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
|
|
8
|
+
export declare const createGenerations_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
9
|
+
export interface CreateGenerationsConfig {
|
|
10
|
+
generationsInput: types_EinsteinLlmGenerationsInputRepresentation_EinsteinLlmGenerationsInputRepresentation;
|
|
11
|
+
}
|
|
12
|
+
export declare function createResourceParams(config: CreateGenerationsConfig): resources_postEinsteinLlmPromptGenerations_ResourceRequestConfig;
|
|
13
|
+
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<CreateGenerationsConfig>): adapter$45$utils_Untrusted<CreateGenerationsConfig>;
|
|
14
|
+
export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): CreateGenerationsConfig | null;
|
|
15
|
+
export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: CreateGenerationsConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation, any>>;
|
|
16
|
+
export declare const createGenerationsAdapterFactory: $64$luvio_engine_AdapterFactory<CreateGenerationsConfig, types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
2
|
+
import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
|
|
3
|
+
import { EinsteinPromptTemplateGenerationsInputRepresentation as types_EinsteinPromptTemplateGenerationsInputRepresentation_EinsteinPromptTemplateGenerationsInputRepresentation } from '../types/EinsteinPromptTemplateGenerationsInputRepresentation';
|
|
4
|
+
import { ResourceRequestConfig as resources_postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName_ResourceRequestConfig } from '../resources/postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName';
|
|
5
|
+
import { EinsteinPromptTemplateGenerationsRepresentation as types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation } from '../types/EinsteinPromptTemplateGenerationsRepresentation';
|
|
6
|
+
export declare const adapterName = "createGenerationsForPromptTemplate";
|
|
7
|
+
export declare const createGenerationsForPromptTemplate_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
|
|
8
|
+
export declare const createGenerationsForPromptTemplate_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
9
|
+
export interface CreateGenerationsForPromptTemplateConfig {
|
|
10
|
+
promptTemplateDevName: string;
|
|
11
|
+
promptTemplateGenerationsInput: types_EinsteinPromptTemplateGenerationsInputRepresentation_EinsteinPromptTemplateGenerationsInputRepresentation;
|
|
12
|
+
}
|
|
13
|
+
export declare function createResourceParams(config: CreateGenerationsForPromptTemplateConfig): resources_postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName_ResourceRequestConfig;
|
|
14
|
+
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<CreateGenerationsForPromptTemplateConfig>): adapter$45$utils_Untrusted<CreateGenerationsForPromptTemplateConfig>;
|
|
15
|
+
export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): CreateGenerationsForPromptTemplateConfig | null;
|
|
16
|
+
export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: CreateGenerationsForPromptTemplateConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation, any>>;
|
|
17
|
+
export declare const createGenerationsForPromptTemplateAdapterFactory: $64$luvio_engine_AdapterFactory<CreateGenerationsForPromptTemplateConfig, types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { createGenerationsAdapterFactory } from '../adapters/createGenerations';
|
|
2
|
+
export { createGenerationsForPromptTemplateAdapterFactory } from '../adapters/createGenerationsForPromptTemplate';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare let
|
|
2
|
-
declare let
|
|
3
|
-
export {
|
|
1
|
+
declare let createGenerations: any;
|
|
2
|
+
declare let createGenerationsForPromptTemplate: any;
|
|
3
|
+
export { createGenerations, createGenerationsForPromptTemplate, };
|
package/package.json
CHANGED
package/sfdc/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
16
|
-
import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
|
|
16
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
|
|
17
17
|
|
|
18
18
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
19
19
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -50,6 +50,24 @@ function untrustedIsObject(untrusted) {
|
|
|
50
50
|
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
51
51
|
return configPropertyNames.parameters.required.every(req => req in config);
|
|
52
52
|
}
|
|
53
|
+
function generateParamConfigMetadata(name, required, coerceFn) {
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
required,
|
|
57
|
+
coerceFn,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
61
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
62
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
63
|
+
return {
|
|
64
|
+
displayName,
|
|
65
|
+
parameters: {
|
|
66
|
+
required,
|
|
67
|
+
optional,
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
53
71
|
const keyPrefix = 'EinsteinLLM';
|
|
54
72
|
|
|
55
73
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
@@ -466,26 +484,8 @@ const ingest$1 = function EinsteinLlmGenerationsRepresentationIngest(input, path
|
|
|
466
484
|
}
|
|
467
485
|
}
|
|
468
486
|
const key = keyBuilderFromType$1(luvio, input);
|
|
469
|
-
const existingRecord = store.readEntry(key);
|
|
470
487
|
const ttlToUse = TTL$1;
|
|
471
|
-
|
|
472
|
-
fullPath: key,
|
|
473
|
-
parent: path.parent,
|
|
474
|
-
propertyName: path.propertyName,
|
|
475
|
-
ttl: ttlToUse
|
|
476
|
-
});
|
|
477
|
-
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
478
|
-
luvio.storePublish(key, incomingRecord);
|
|
479
|
-
}
|
|
480
|
-
{
|
|
481
|
-
const storeMetadataParams = {
|
|
482
|
-
ttl: ttlToUse,
|
|
483
|
-
namespace: "EinsteinLLM",
|
|
484
|
-
version: VERSION$1,
|
|
485
|
-
representationName: RepresentationType$1,
|
|
486
|
-
};
|
|
487
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
488
|
-
}
|
|
488
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$1, RepresentationType$1, equals$1);
|
|
489
489
|
return createLink(key);
|
|
490
490
|
};
|
|
491
491
|
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -535,13 +535,11 @@ function createResourceRequest$1(config) {
|
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
};
|
|
538
|
+
const adapterName$1 = 'createGenerations';
|
|
539
|
+
const createGenerations_ConfigPropertyMetadata = [
|
|
540
|
+
generateParamConfigMetadata('generationsInput', true),
|
|
541
|
+
];
|
|
542
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerations_ConfigPropertyMetadata);
|
|
545
543
|
function createResourceParams$1(config) {
|
|
546
544
|
const resourceParams = {
|
|
547
545
|
body: {
|
|
@@ -590,12 +588,12 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
590
588
|
throw response;
|
|
591
589
|
});
|
|
592
590
|
}
|
|
593
|
-
const
|
|
594
|
-
return function
|
|
595
|
-
const config = validateAdapterConfig$1(untrustedConfig,
|
|
591
|
+
const createGenerationsAdapterFactory = (luvio) => {
|
|
592
|
+
return function createGenerations(untrustedConfig) {
|
|
593
|
+
const config = validateAdapterConfig$1(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
596
594
|
// Invalid or incomplete config
|
|
597
595
|
if (config === null) {
|
|
598
|
-
throw new Error('Invalid config for "
|
|
596
|
+
throw new Error('Invalid config for "createGenerations"');
|
|
599
597
|
}
|
|
600
598
|
return buildNetworkSnapshot$1(luvio, config);
|
|
601
599
|
};
|
|
@@ -845,26 +843,8 @@ const ingest = function EinsteinPromptTemplateGenerationsRepresentationIngest(in
|
|
|
845
843
|
}
|
|
846
844
|
}
|
|
847
845
|
const key = keyBuilderFromType(luvio, input);
|
|
848
|
-
const existingRecord = store.readEntry(key);
|
|
849
846
|
const ttlToUse = TTL;
|
|
850
|
-
|
|
851
|
-
fullPath: key,
|
|
852
|
-
parent: path.parent,
|
|
853
|
-
propertyName: path.propertyName,
|
|
854
|
-
ttl: ttlToUse
|
|
855
|
-
});
|
|
856
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
857
|
-
luvio.storePublish(key, incomingRecord);
|
|
858
|
-
}
|
|
859
|
-
{
|
|
860
|
-
const storeMetadataParams = {
|
|
861
|
-
ttl: ttlToUse,
|
|
862
|
-
namespace: "EinsteinLLM",
|
|
863
|
-
version: VERSION,
|
|
864
|
-
representationName: RepresentationType,
|
|
865
|
-
};
|
|
866
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
867
|
-
}
|
|
847
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "EinsteinLLM", VERSION, RepresentationType, equals);
|
|
868
848
|
return createLink(key);
|
|
869
849
|
};
|
|
870
850
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -914,13 +894,12 @@ function createResourceRequest(config) {
|
|
|
914
894
|
};
|
|
915
895
|
}
|
|
916
896
|
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
};
|
|
897
|
+
const adapterName = 'createGenerationsForPromptTemplate';
|
|
898
|
+
const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
899
|
+
generateParamConfigMetadata('promptTemplateDevName', true),
|
|
900
|
+
generateParamConfigMetadata('promptTemplateGenerationsInput', true),
|
|
901
|
+
];
|
|
902
|
+
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
924
903
|
function createResourceParams(config) {
|
|
925
904
|
const resourceParams = {
|
|
926
905
|
urlParams: {
|
|
@@ -975,36 +954,36 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
975
954
|
throw response;
|
|
976
955
|
});
|
|
977
956
|
}
|
|
978
|
-
const
|
|
979
|
-
return function
|
|
980
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
957
|
+
const createGenerationsForPromptTemplateAdapterFactory = (luvio) => {
|
|
958
|
+
return function createGenerationsForPromptTemplate(untrustedConfig) {
|
|
959
|
+
const config = validateAdapterConfig(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
981
960
|
// Invalid or incomplete config
|
|
982
961
|
if (config === null) {
|
|
983
|
-
throw new Error('Invalid config for "
|
|
962
|
+
throw new Error('Invalid config for "createGenerationsForPromptTemplate"');
|
|
984
963
|
}
|
|
985
964
|
return buildNetworkSnapshot(luvio, config);
|
|
986
965
|
};
|
|
987
966
|
};
|
|
988
967
|
|
|
989
|
-
let
|
|
990
|
-
let
|
|
968
|
+
let createGenerations;
|
|
969
|
+
let createGenerationsForPromptTemplate;
|
|
991
970
|
function bindExportsTo(luvio) {
|
|
992
971
|
function unwrapSnapshotData(factory) {
|
|
993
972
|
const adapter = factory(luvio);
|
|
994
973
|
return (config) => adapter(config).then(snapshot => snapshot.data);
|
|
995
974
|
}
|
|
996
975
|
return {
|
|
997
|
-
|
|
998
|
-
|
|
976
|
+
createGenerations: unwrapSnapshotData(createGenerationsAdapterFactory),
|
|
977
|
+
createGenerationsForPromptTemplate: unwrapSnapshotData(createGenerationsForPromptTemplateAdapterFactory),
|
|
999
978
|
// Imperative GET Adapters
|
|
1000
979
|
};
|
|
1001
980
|
}
|
|
1002
981
|
withDefaultLuvio((luvio) => {
|
|
1003
982
|
({
|
|
1004
|
-
|
|
1005
|
-
|
|
983
|
+
createGenerations,
|
|
984
|
+
createGenerationsForPromptTemplate,
|
|
1006
985
|
} = bindExportsTo(luvio));
|
|
1007
986
|
});
|
|
1008
987
|
|
|
1009
|
-
export {
|
|
1010
|
-
// version: 1.213.
|
|
988
|
+
export { createGenerations, createGenerationsForPromptTemplate };
|
|
989
|
+
// version: 1.213.1-79de10fe1
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
|
|
2
|
-
import { EinsteinLlmGenerationsInputRepresentation as types_EinsteinLlmGenerationsInputRepresentation_EinsteinLlmGenerationsInputRepresentation } from '../types/EinsteinLlmGenerationsInputRepresentation';
|
|
3
|
-
import { ResourceRequestConfig as resources_postEinsteinLlmPromptGenerations_ResourceRequestConfig } from '../resources/postEinsteinLlmPromptGenerations';
|
|
4
|
-
import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
5
|
-
import { EinsteinLlmGenerationsRepresentation as types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation } from '../types/EinsteinLlmGenerationsRepresentation';
|
|
6
|
-
export declare const adapterName = "createGenerateMessages";
|
|
7
|
-
export declare const createGenerateMessages_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
8
|
-
export interface CreateGenerateMessagesConfig {
|
|
9
|
-
generationsInput: types_EinsteinLlmGenerationsInputRepresentation_EinsteinLlmGenerationsInputRepresentation;
|
|
10
|
-
}
|
|
11
|
-
export declare function createResourceParams(config: CreateGenerateMessagesConfig): resources_postEinsteinLlmPromptGenerations_ResourceRequestConfig;
|
|
12
|
-
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<CreateGenerateMessagesConfig>): adapter$45$utils_Untrusted<CreateGenerateMessagesConfig>;
|
|
13
|
-
export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): CreateGenerateMessagesConfig | null;
|
|
14
|
-
export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: CreateGenerateMessagesConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation, any>>;
|
|
15
|
-
export declare const createGenerateMessagesAdapterFactory: $64$luvio_engine_AdapterFactory<CreateGenerateMessagesConfig, types_EinsteinLlmGenerationsRepresentation_EinsteinLlmGenerationsRepresentation>;
|
package/dist/es/es2018/types/src/generated/adapters/createGenerateMessagesForPromptTemplate.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
|
|
2
|
-
import { EinsteinPromptTemplateGenerationsInputRepresentation as types_EinsteinPromptTemplateGenerationsInputRepresentation_EinsteinPromptTemplateGenerationsInputRepresentation } from '../types/EinsteinPromptTemplateGenerationsInputRepresentation';
|
|
3
|
-
import { ResourceRequestConfig as resources_postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName_ResourceRequestConfig } from '../resources/postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName';
|
|
4
|
-
import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
5
|
-
import { EinsteinPromptTemplateGenerationsRepresentation as types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation } from '../types/EinsteinPromptTemplateGenerationsRepresentation';
|
|
6
|
-
export declare const adapterName = "createGenerateMessagesForPromptTemplate";
|
|
7
|
-
export declare const createGenerateMessagesForPromptTemplate_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
8
|
-
export interface CreateGenerateMessagesForPromptTemplateConfig {
|
|
9
|
-
promptTemplateDevName: string;
|
|
10
|
-
promptTemplateGenerationsInput: types_EinsteinPromptTemplateGenerationsInputRepresentation_EinsteinPromptTemplateGenerationsInputRepresentation;
|
|
11
|
-
}
|
|
12
|
-
export declare function createResourceParams(config: CreateGenerateMessagesForPromptTemplateConfig): resources_postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName_ResourceRequestConfig;
|
|
13
|
-
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<CreateGenerateMessagesForPromptTemplateConfig>): adapter$45$utils_Untrusted<CreateGenerateMessagesForPromptTemplateConfig>;
|
|
14
|
-
export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): CreateGenerateMessagesForPromptTemplateConfig | null;
|
|
15
|
-
export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: CreateGenerateMessagesForPromptTemplateConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation, any>>;
|
|
16
|
-
export declare const createGenerateMessagesForPromptTemplateAdapterFactory: $64$luvio_engine_AdapterFactory<CreateGenerateMessagesForPromptTemplateConfig, types_EinsteinPromptTemplateGenerationsRepresentation_EinsteinPromptTemplateGenerationsRepresentation>;
|