@smythos/sre 1.7.9 → 1.7.11
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/CHANGELOG +7 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/subsystems/IO/VectorDB.service/embed/BaseEmbedding.d.ts +2 -1
- package/dist/types/subsystems/ObservabilityManager/Log.service/LogConnector.d.ts +17 -0
- package/dist/types/subsystems/ObservabilityManager/Log.service/connectors/ConsoleLog.class.d.ts +12 -0
- package/dist/types/subsystems/ObservabilityManager/Log.service/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/subsystems/IO/VectorDB.service/embed/BaseEmbedding.ts +7 -3
- package/src/subsystems/IO/VectorDB.service/embed/index.ts +1 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IVectorDataSourceDto, Source } from '@sre/types/VectorDB.types';
|
|
2
2
|
import { SupportedProviders, SupportedModels } from './index';
|
|
3
3
|
import { AccessCandidate } from '@sre/Security/AccessControl/AccessCandidate.class';
|
|
4
|
+
import { TLLMCredentials } from '@sre/types/LLM.types';
|
|
4
5
|
export type TEmbeddings = {
|
|
5
6
|
provider?: SupportedProviders;
|
|
6
7
|
model?: SupportedModels[SupportedProviders];
|
|
7
|
-
credentials?: {
|
|
8
|
+
credentials?: TLLMCredentials | TLLMCredentials[] | {
|
|
8
9
|
apiKey: string;
|
|
9
10
|
};
|
|
10
11
|
dimensions?: number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SecureConnector } from '@sre/Security/SecureConnector.class';
|
|
2
|
+
import { IAccessCandidate } from '@sre/types/ACL.types';
|
|
3
|
+
import { ACL } from '@sre/Security/AccessControl/ACL.class';
|
|
4
|
+
import { AccessCandidate } from '@sre/Security/AccessControl/AccessCandidate.class';
|
|
5
|
+
import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
|
|
6
|
+
import { AgentCallLog } from '@sre/types/AgentLogger.types';
|
|
7
|
+
export interface ILogRequest {
|
|
8
|
+
log(logData: AgentCallLog, callId?: string): Promise<any>;
|
|
9
|
+
logTask(tasks: number, isUsingTestDomain: boolean): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class LogConnector extends SecureConnector {
|
|
12
|
+
abstract id: string;
|
|
13
|
+
abstract getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
|
|
14
|
+
requester(candidate: AccessCandidate): ILogRequest;
|
|
15
|
+
protected abstract log(acRequest: AccessRequest, logData: AgentCallLog, callId?: string): Promise<any>;
|
|
16
|
+
protected abstract logTask(acRequest: AccessRequest, tasks: number, isUsingTestDomain: boolean): Promise<void>;
|
|
17
|
+
}
|
package/dist/types/subsystems/ObservabilityManager/Log.service/connectors/ConsoleLog.class.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
|
|
2
|
+
import { ACL } from '@sre/Security/AccessControl/ACL.class';
|
|
3
|
+
import { IAccessCandidate } from '@sre/types/ACL.types';
|
|
4
|
+
import { LogConnector } from '../LogConnector';
|
|
5
|
+
import { AgentCallLog } from '@sre/types/AgentLogger.types';
|
|
6
|
+
export declare class ConsoleLog extends LogConnector {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
|
|
10
|
+
protected log(acRequest: AccessRequest, logData: AgentCallLog, callId?: string): Promise<any>;
|
|
11
|
+
protected logTask(acRequest: AccessRequest, tasks: number, isUsingTestDomain: boolean): Promise<void>;
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -2,14 +2,18 @@ import { IVectorDataSourceDto, Source } from '@sre/types/VectorDB.types';
|
|
|
2
2
|
import { isUrl } from '@sre/utils/index';
|
|
3
3
|
import { SupportedProviders, SupportedModels } from './index';
|
|
4
4
|
import { AccessCandidate } from '@sre/Security/AccessControl/AccessCandidate.class';
|
|
5
|
+
import { TLLMCredentials } from '@sre/types/LLM.types';
|
|
5
6
|
|
|
6
7
|
export type TEmbeddings = {
|
|
7
8
|
provider?: SupportedProviders;
|
|
8
9
|
model?: SupportedModels[SupportedProviders];
|
|
9
10
|
|
|
10
|
-
credentials?:
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
credentials?:
|
|
12
|
+
| TLLMCredentials
|
|
13
|
+
| TLLMCredentials[]
|
|
14
|
+
| {
|
|
15
|
+
apiKey: string;
|
|
16
|
+
};
|
|
13
17
|
|
|
14
18
|
dimensions?: number;
|
|
15
19
|
timeout?: number;
|
|
@@ -28,6 +28,7 @@ export class EmbeddingsFactory {
|
|
|
28
28
|
//if the model is a TLLMModel, we need to convert it to a SupportedModels[SupportedProviders]
|
|
29
29
|
if (config.model && typeof config.model === 'object') {
|
|
30
30
|
provider = (config.model as TLLMModel).provider as SupportedProviders;
|
|
31
|
+
config.credentials = (config.model as TLLMModel).credentials;
|
|
31
32
|
config.model = (config.model as TLLMModel).modelId;
|
|
32
33
|
}
|
|
33
34
|
|