@coasys/ad4m 0.10.0 → 0.10.1-dev-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/lib/index.cjs +3785 -843
- package/lib/index.js +3777 -839
- package/lib/src/Ad4mClient.js +2 -1
- package/lib/src/Literal.js +4 -1
- package/lib/src/ai/AIClient.d.ts +8 -2
- package/lib/src/ai/AIClient.js +25 -14
- package/lib/src/ai/AIResolver.d.ts +25 -6
- package/lib/src/ai/AIResolver.js +102 -18
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.js +4 -3
- package/lib/src/model/Ad4mModel.d.ts +730 -0
- package/lib/src/model/Ad4mModel.js +1399 -0
- package/lib/src/{subject → model}/Subject.d.ts +2 -2
- package/lib/src/{subject → model}/Subject.js +18 -18
- package/lib/src/model/decorators.d.ts +502 -0
- package/lib/src/model/decorators.js +683 -0
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +2 -2
- package/lib/src/neighbourhood/NeighbourhoodClient.js +13 -10
- package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +2 -2
- package/lib/src/neighbourhood/NeighbourhoodProxy.js +4 -4
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.d.ts +1 -0
- package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +73 -0
- package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +2 -2
- package/lib/src/neighbourhood/NeighbourhoodResolver.js +6 -4
- package/lib/src/perspectives/PerspectiveClient.d.ts +23 -11
- package/lib/src/perspectives/PerspectiveClient.js +147 -51
- package/lib/src/perspectives/PerspectiveProxy.d.ts +494 -54
- package/lib/src/perspectives/PerspectiveProxy.js +684 -67
- package/lib/src/perspectives/PerspectiveResolver.d.ts +24 -9
- package/lib/src/perspectives/PerspectiveResolver.js +151 -46
- package/lib/src/runtime/RuntimeClient.d.ts +8 -2
- package/lib/src/runtime/RuntimeClient.js +64 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +27 -1
- package/lib/src/runtime/RuntimeResolver.js +138 -0
- package/lib/src/schema.gql +55 -16
- package/lib/src/typeDefs.js +55 -16
- package/package.json +4 -3
- package/src/Ad4mClient.test.ts +51 -19
- package/src/Ad4mClient.ts +3 -1
- package/src/Literal.ts +4 -1
- package/src/ai/AIClient.ts +35 -14
- package/src/ai/AIResolver.ts +78 -16
- package/src/index.ts +4 -3
- package/src/model/Ad4mModel.ts +1651 -0
- package/src/{subject → model}/Subject.ts +16 -16
- package/src/{subject/SDNADecorators.ts → model/decorators.ts} +384 -50
- package/src/neighbourhood/NeighbourhoodClient.ts +13 -10
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +100 -0
- package/src/neighbourhood/NeighbourhoodProxy.ts +4 -4
- package/src/neighbourhood/NeighbourhoodResolver.ts +2 -2
- package/src/perspectives/PerspectiveClient.ts +156 -51
- package/src/perspectives/PerspectiveProxy.ts +766 -82
- package/src/perspectives/PerspectiveResolver.ts +134 -23
- package/src/runtime/RuntimeClient.ts +71 -2
- package/src/runtime/RuntimeResolver.ts +91 -1
- package/lib/src/subject/SDNADecorators.d.ts +0 -188
- package/lib/src/subject/SDNADecorators.js +0 -360
- package/lib/src/subject/SubjectEntity.d.ts +0 -102
- package/lib/src/subject/SubjectEntity.js +0 -267
- package/src/subject/SubjectEntity.ts +0 -315
- package/yarn-error.log +0 -90
- /package/lib/src/{subject → model}/util.d.ts +0 -0
- /package/lib/src/{subject → model}/util.js +0 -0
- /package/src/{subject → model}/util.ts +0 -0
package/lib/src/Ad4mClient.js
CHANGED
|
@@ -41,11 +41,12 @@ export class Ad4mClient {
|
|
|
41
41
|
__classPrivateFieldSet(this, _Ad4mClient_expressionClient, new ExpressionClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f")), "f");
|
|
42
42
|
__classPrivateFieldSet(this, _Ad4mClient_languageClient, new LanguageClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f")), "f");
|
|
43
43
|
__classPrivateFieldSet(this, _Ad4mClient_neighbourhoodClient, new NeighbourhoodClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f")), "f");
|
|
44
|
+
__classPrivateFieldSet(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
|
|
44
45
|
__classPrivateFieldSet(this, _Ad4mClient_perspectiveClient, new PerspectiveClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
|
|
45
46
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setExpressionClient(__classPrivateFieldGet(this, _Ad4mClient_expressionClient, "f"));
|
|
46
47
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setNeighbourhoodClient(__classPrivateFieldGet(this, _Ad4mClient_neighbourhoodClient, "f"));
|
|
48
|
+
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setAIClient(__classPrivateFieldGet(this, _Ad4mClient_aiClient, "f"));
|
|
47
49
|
__classPrivateFieldSet(this, _Ad4mClient_runtimeClient, new RuntimeClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
|
|
48
|
-
__classPrivateFieldSet(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
|
|
49
50
|
}
|
|
50
51
|
get agent() {
|
|
51
52
|
return __classPrivateFieldGet(this, _Ad4mClient_agentClient, "f");
|
package/lib/src/Literal.js
CHANGED
|
@@ -34,7 +34,7 @@ export class Literal {
|
|
|
34
34
|
toUrl() {
|
|
35
35
|
if (__classPrivateFieldGet(this, _Literal_url, "f") && !__classPrivateFieldGet(this, _Literal_literal, "f"))
|
|
36
36
|
return __classPrivateFieldGet(this, _Literal_url, "f");
|
|
37
|
-
if (!__classPrivateFieldGet(this, _Literal_url, "f") &&
|
|
37
|
+
if (!__classPrivateFieldGet(this, _Literal_url, "f") && (__classPrivateFieldGet(this, _Literal_literal, "f") === undefined || __classPrivateFieldGet(this, _Literal_literal, "f") === "" || __classPrivateFieldGet(this, _Literal_literal, "f") === null))
|
|
38
38
|
throw new Error("Can't turn empty Literal into URL");
|
|
39
39
|
let encoded;
|
|
40
40
|
switch (typeof __classPrivateFieldGet(this, _Literal_literal, "f")) {
|
|
@@ -44,6 +44,9 @@ export class Literal {
|
|
|
44
44
|
case 'number':
|
|
45
45
|
encoded = `number:${encodeRFC3986URIComponent(__classPrivateFieldGet(this, _Literal_literal, "f"))}`;
|
|
46
46
|
break;
|
|
47
|
+
case 'boolean':
|
|
48
|
+
encoded = `boolean:${encodeRFC3986URIComponent(__classPrivateFieldGet(this, _Literal_literal, "f"))}`;
|
|
49
|
+
break;
|
|
47
50
|
case 'object':
|
|
48
51
|
encoded = `json:${encodeRFC3986URIComponent(JSON.stringify(__classPrivateFieldGet(this, _Literal_literal, "f")))}`;
|
|
49
52
|
break;
|
package/lib/src/ai/AIClient.d.ts
CHANGED
|
@@ -20,7 +20,13 @@ export declare class AIClient {
|
|
|
20
20
|
modelLoadingStatus(model: string): Promise<AIModelLoadingStatus>;
|
|
21
21
|
prompt(taskId: string, prompt: string): Promise<string>;
|
|
22
22
|
embed(modelId: string, text: string): Promise<Array<number>>;
|
|
23
|
-
openTranscriptionStream(modelId: string, streamCallback: (text: string) => void
|
|
23
|
+
openTranscriptionStream(modelId: string, streamCallback: (text: string) => void, params?: {
|
|
24
|
+
startThreshold?: number;
|
|
25
|
+
startWindow?: number;
|
|
26
|
+
endThreshold?: number;
|
|
27
|
+
endWindow?: number;
|
|
28
|
+
timeBeforeSpeech?: number;
|
|
29
|
+
}): Promise<string>;
|
|
24
30
|
closeTranscriptionStream(streamId: string): Promise<void>;
|
|
25
|
-
feedTranscriptionStream(
|
|
31
|
+
feedTranscriptionStream(streamIds: string | string[], audio: Float32Array): Promise<void>;
|
|
26
32
|
}
|
package/lib/src/ai/AIClient.js
CHANGED
|
@@ -36,8 +36,13 @@ export class AIClient {
|
|
|
36
36
|
}
|
|
37
37
|
local {
|
|
38
38
|
fileName
|
|
39
|
-
tokenizerSource
|
|
40
|
-
|
|
39
|
+
tokenizerSource {
|
|
40
|
+
repo
|
|
41
|
+
revision
|
|
42
|
+
fileName
|
|
43
|
+
}
|
|
44
|
+
huggingfaceRepo
|
|
45
|
+
revision
|
|
41
46
|
}
|
|
42
47
|
modelType
|
|
43
48
|
}
|
|
@@ -105,8 +110,13 @@ export class AIClient {
|
|
|
105
110
|
}
|
|
106
111
|
local {
|
|
107
112
|
fileName
|
|
108
|
-
tokenizerSource
|
|
109
|
-
|
|
113
|
+
tokenizerSource {
|
|
114
|
+
repo
|
|
115
|
+
revision
|
|
116
|
+
fileName
|
|
117
|
+
}
|
|
118
|
+
huggingfaceRepo
|
|
119
|
+
revision
|
|
110
120
|
}
|
|
111
121
|
modelType
|
|
112
122
|
}
|
|
@@ -269,15 +279,16 @@ export class AIClient {
|
|
|
269
279
|
const decompressed = JSON.parse(pako.inflate(compressed, { to: 'string' }));
|
|
270
280
|
return decompressed;
|
|
271
281
|
}
|
|
272
|
-
async openTranscriptionStream(modelId, streamCallback) {
|
|
282
|
+
async openTranscriptionStream(modelId, streamCallback, params) {
|
|
273
283
|
const { aiOpenTranscriptionStream } = unwrapApolloResult(await __classPrivateFieldGet(this, _AIClient_apolloClient, "f").mutate({
|
|
274
284
|
mutation: gql `
|
|
275
|
-
mutation AiOpenTranscriptionStream($modelId: String
|
|
276
|
-
aiOpenTranscriptionStream(modelId: $modelId)
|
|
285
|
+
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
286
|
+
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
277
287
|
}
|
|
278
288
|
`,
|
|
279
289
|
variables: {
|
|
280
|
-
modelId
|
|
290
|
+
modelId,
|
|
291
|
+
params
|
|
281
292
|
}
|
|
282
293
|
}));
|
|
283
294
|
const subscription = __classPrivateFieldGet(this, _AIClient_apolloClient, "f").subscribe({
|
|
@@ -313,19 +324,19 @@ export class AIClient {
|
|
|
313
324
|
}
|
|
314
325
|
return aiCloseTranscriptionStream;
|
|
315
326
|
}
|
|
316
|
-
async feedTranscriptionStream(
|
|
317
|
-
const {
|
|
327
|
+
async feedTranscriptionStream(streamIds, audio) {
|
|
328
|
+
const { aiFeedTranscriptionStream } = unwrapApolloResult(await __classPrivateFieldGet(this, _AIClient_apolloClient, "f").mutate({
|
|
318
329
|
mutation: gql `
|
|
319
|
-
mutation AiFeedTranscriptionStream($
|
|
320
|
-
aiFeedTranscriptionStream(
|
|
330
|
+
mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
|
|
331
|
+
aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
|
|
321
332
|
}
|
|
322
333
|
`,
|
|
323
334
|
variables: {
|
|
324
|
-
|
|
335
|
+
streamIds: Array.isArray(streamIds) ? streamIds : [streamIds],
|
|
325
336
|
audio: audio
|
|
326
337
|
}
|
|
327
338
|
}));
|
|
328
|
-
return
|
|
339
|
+
return aiFeedTranscriptionStream;
|
|
329
340
|
}
|
|
330
341
|
}
|
|
331
342
|
_AIClient_apolloClient = new WeakMap(), _AIClient_transcriptionSubscriptions = new WeakMap();
|
|
@@ -5,10 +5,16 @@ export declare class ModelApi {
|
|
|
5
5
|
model: string;
|
|
6
6
|
apiType: String;
|
|
7
7
|
}
|
|
8
|
+
export declare class TokenizerSource {
|
|
9
|
+
repo: string;
|
|
10
|
+
revision: string;
|
|
11
|
+
fileName: string;
|
|
12
|
+
}
|
|
8
13
|
export declare class LocalModel {
|
|
9
14
|
fileName: string;
|
|
10
|
-
tokenizerSource
|
|
11
|
-
|
|
15
|
+
tokenizerSource?: TokenizerSource;
|
|
16
|
+
huggingfaceRepo?: string;
|
|
17
|
+
revision?: string;
|
|
12
18
|
}
|
|
13
19
|
export type ModelType = "LLM" | "EMBEDDING" | "TRANSCRIPTION";
|
|
14
20
|
export declare class Model {
|
|
@@ -24,10 +30,16 @@ export declare class ModelApiInput {
|
|
|
24
30
|
model: string;
|
|
25
31
|
apiType: string;
|
|
26
32
|
}
|
|
33
|
+
export declare class TokenizerSourceInput {
|
|
34
|
+
repo: string;
|
|
35
|
+
revision: string;
|
|
36
|
+
fileName: string;
|
|
37
|
+
}
|
|
27
38
|
export declare class LocalModelInput {
|
|
28
39
|
fileName: string;
|
|
29
|
-
tokenizerSource
|
|
30
|
-
|
|
40
|
+
tokenizerSource?: TokenizerSourceInput;
|
|
41
|
+
huggingfaceRepo?: string;
|
|
42
|
+
revision?: string;
|
|
31
43
|
}
|
|
32
44
|
export declare class ModelInput {
|
|
33
45
|
name: string;
|
|
@@ -35,6 +47,13 @@ export declare class ModelInput {
|
|
|
35
47
|
local?: LocalModelInput;
|
|
36
48
|
modelType: ModelType;
|
|
37
49
|
}
|
|
50
|
+
export declare class VoiceActivityParamsInput {
|
|
51
|
+
startThreshold?: number;
|
|
52
|
+
startWindow?: number;
|
|
53
|
+
endThreshold?: number;
|
|
54
|
+
endWindow?: number;
|
|
55
|
+
timeBeforeSpeech?: number;
|
|
56
|
+
}
|
|
38
57
|
export default class AIResolver {
|
|
39
58
|
aiGetModels(): Model[];
|
|
40
59
|
aiAddModel(model: ModelInput): string;
|
|
@@ -49,8 +68,8 @@ export default class AIResolver {
|
|
|
49
68
|
aiModelLoadingStatus(model: string): AIModelLoadingStatus;
|
|
50
69
|
aiPrompt(taskId: string, input: string): string;
|
|
51
70
|
aiEmbed(modelId: string, text: string): string;
|
|
52
|
-
aiOpenTranscriptionStream(modelId: string): string;
|
|
71
|
+
aiOpenTranscriptionStream(modelId: string, params?: VoiceActivityParamsInput): string;
|
|
53
72
|
aiCloseTranscriptionStream(streamId: string): boolean;
|
|
54
|
-
aiFeedTranscriptionStream(
|
|
73
|
+
aiFeedTranscriptionStream(streamIds: string[], audio: number[], pubSub: any): boolean;
|
|
55
74
|
aiTranscriptionText(streamId: string): string;
|
|
56
75
|
}
|
package/lib/src/ai/AIResolver.js
CHANGED
|
@@ -39,20 +39,42 @@ ModelApi = __decorate([
|
|
|
39
39
|
ObjectType()
|
|
40
40
|
], ModelApi);
|
|
41
41
|
export { ModelApi };
|
|
42
|
-
let
|
|
42
|
+
let TokenizerSource = class TokenizerSource {
|
|
43
43
|
};
|
|
44
44
|
__decorate([
|
|
45
45
|
Field(),
|
|
46
46
|
__metadata("design:type", String)
|
|
47
|
-
],
|
|
47
|
+
], TokenizerSource.prototype, "repo", void 0);
|
|
48
48
|
__decorate([
|
|
49
49
|
Field(),
|
|
50
50
|
__metadata("design:type", String)
|
|
51
|
-
],
|
|
51
|
+
], TokenizerSource.prototype, "revision", void 0);
|
|
52
52
|
__decorate([
|
|
53
53
|
Field(),
|
|
54
54
|
__metadata("design:type", String)
|
|
55
|
-
],
|
|
55
|
+
], TokenizerSource.prototype, "fileName", void 0);
|
|
56
|
+
TokenizerSource = __decorate([
|
|
57
|
+
ObjectType()
|
|
58
|
+
], TokenizerSource);
|
|
59
|
+
export { TokenizerSource };
|
|
60
|
+
let LocalModel = class LocalModel {
|
|
61
|
+
};
|
|
62
|
+
__decorate([
|
|
63
|
+
Field(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], LocalModel.prototype, "fileName", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
Field({ nullable: true }),
|
|
68
|
+
__metadata("design:type", TokenizerSource)
|
|
69
|
+
], LocalModel.prototype, "tokenizerSource", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
Field({ nullable: true }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], LocalModel.prototype, "huggingfaceRepo", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
Field({ nullable: true }),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], LocalModel.prototype, "revision", void 0);
|
|
56
78
|
LocalModel = __decorate([
|
|
57
79
|
ObjectType()
|
|
58
80
|
], LocalModel);
|
|
@@ -105,20 +127,42 @@ ModelApiInput = __decorate([
|
|
|
105
127
|
InputType()
|
|
106
128
|
], ModelApiInput);
|
|
107
129
|
export { ModelApiInput };
|
|
108
|
-
let
|
|
130
|
+
let TokenizerSourceInput = class TokenizerSourceInput {
|
|
109
131
|
};
|
|
110
132
|
__decorate([
|
|
111
133
|
Field(),
|
|
112
134
|
__metadata("design:type", String)
|
|
113
|
-
],
|
|
135
|
+
], TokenizerSourceInput.prototype, "repo", void 0);
|
|
114
136
|
__decorate([
|
|
115
137
|
Field(),
|
|
116
138
|
__metadata("design:type", String)
|
|
117
|
-
],
|
|
139
|
+
], TokenizerSourceInput.prototype, "revision", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
Field(),
|
|
142
|
+
__metadata("design:type", String)
|
|
143
|
+
], TokenizerSourceInput.prototype, "fileName", void 0);
|
|
144
|
+
TokenizerSourceInput = __decorate([
|
|
145
|
+
InputType()
|
|
146
|
+
], TokenizerSourceInput);
|
|
147
|
+
export { TokenizerSourceInput };
|
|
148
|
+
let LocalModelInput = class LocalModelInput {
|
|
149
|
+
};
|
|
118
150
|
__decorate([
|
|
119
151
|
Field(),
|
|
120
152
|
__metadata("design:type", String)
|
|
121
|
-
], LocalModelInput.prototype, "
|
|
153
|
+
], LocalModelInput.prototype, "fileName", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
Field({ nullable: true }),
|
|
156
|
+
__metadata("design:type", TokenizerSourceInput)
|
|
157
|
+
], LocalModelInput.prototype, "tokenizerSource", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
Field({ nullable: true }),
|
|
160
|
+
__metadata("design:type", String)
|
|
161
|
+
], LocalModelInput.prototype, "huggingfaceRepo", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
Field({ nullable: true }),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], LocalModelInput.prototype, "revision", void 0);
|
|
122
166
|
LocalModelInput = __decorate([
|
|
123
167
|
InputType()
|
|
124
168
|
], LocalModelInput);
|
|
@@ -145,6 +189,32 @@ ModelInput = __decorate([
|
|
|
145
189
|
InputType()
|
|
146
190
|
], ModelInput);
|
|
147
191
|
export { ModelInput };
|
|
192
|
+
let VoiceActivityParamsInput = class VoiceActivityParamsInput {
|
|
193
|
+
};
|
|
194
|
+
__decorate([
|
|
195
|
+
Field(() => Float, { nullable: true }),
|
|
196
|
+
__metadata("design:type", Number)
|
|
197
|
+
], VoiceActivityParamsInput.prototype, "startThreshold", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
Field(() => Float, { nullable: true }),
|
|
200
|
+
__metadata("design:type", Number)
|
|
201
|
+
], VoiceActivityParamsInput.prototype, "startWindow", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
Field(() => Float, { nullable: true }),
|
|
204
|
+
__metadata("design:type", Number)
|
|
205
|
+
], VoiceActivityParamsInput.prototype, "endThreshold", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
Field(() => Float, { nullable: true }),
|
|
208
|
+
__metadata("design:type", Number)
|
|
209
|
+
], VoiceActivityParamsInput.prototype, "endWindow", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
Field(() => Float, { nullable: true }),
|
|
212
|
+
__metadata("design:type", Number)
|
|
213
|
+
], VoiceActivityParamsInput.prototype, "timeBeforeSpeech", void 0);
|
|
214
|
+
VoiceActivityParamsInput = __decorate([
|
|
215
|
+
InputType()
|
|
216
|
+
], VoiceActivityParamsInput);
|
|
217
|
+
export { VoiceActivityParamsInput };
|
|
148
218
|
let AIResolver = class AIResolver {
|
|
149
219
|
aiGetModels() {
|
|
150
220
|
return [
|
|
@@ -159,8 +229,13 @@ let AIResolver = class AIResolver {
|
|
|
159
229
|
},
|
|
160
230
|
local: {
|
|
161
231
|
fileName: "test-model.bin",
|
|
162
|
-
tokenizerSource:
|
|
163
|
-
|
|
232
|
+
tokenizerSource: {
|
|
233
|
+
repo: "test-repo",
|
|
234
|
+
revision: "main",
|
|
235
|
+
fileName: "tokenizer.json"
|
|
236
|
+
},
|
|
237
|
+
huggingfaceRepo: "test-repo",
|
|
238
|
+
revision: "main"
|
|
164
239
|
},
|
|
165
240
|
modelType: "LLM"
|
|
166
241
|
}
|
|
@@ -195,8 +270,13 @@ let AIResolver = class AIResolver {
|
|
|
195
270
|
},
|
|
196
271
|
local: {
|
|
197
272
|
fileName: "test-model.bin",
|
|
198
|
-
tokenizerSource:
|
|
199
|
-
|
|
273
|
+
tokenizerSource: {
|
|
274
|
+
repo: "test-repo",
|
|
275
|
+
revision: "main",
|
|
276
|
+
fileName: "tokenizer.json"
|
|
277
|
+
},
|
|
278
|
+
huggingfaceRepo: "test-repo",
|
|
279
|
+
revision: "main"
|
|
200
280
|
},
|
|
201
281
|
modelType: modelType
|
|
202
282
|
};
|
|
@@ -227,14 +307,17 @@ let AIResolver = class AIResolver {
|
|
|
227
307
|
const compressedString = base64js.fromByteArray(compressed);
|
|
228
308
|
return compressedString;
|
|
229
309
|
}
|
|
230
|
-
aiOpenTranscriptionStream(modelId) {
|
|
310
|
+
aiOpenTranscriptionStream(modelId, params) {
|
|
231
311
|
return "streamId";
|
|
232
312
|
}
|
|
233
313
|
aiCloseTranscriptionStream(streamId) {
|
|
234
314
|
return true;
|
|
235
315
|
}
|
|
236
|
-
aiFeedTranscriptionStream(
|
|
237
|
-
|
|
316
|
+
aiFeedTranscriptionStream(streamIds, audio, pubSub) {
|
|
317
|
+
// Publish for each stream ID
|
|
318
|
+
for (const streamId of streamIds) {
|
|
319
|
+
pubSub.publish(AI_TRANSCRIPTION_TEXT_TOPIC, { streamId });
|
|
320
|
+
}
|
|
238
321
|
return true;
|
|
239
322
|
}
|
|
240
323
|
aiTranscriptionText(streamId) {
|
|
@@ -338,8 +421,9 @@ __decorate([
|
|
|
338
421
|
__decorate([
|
|
339
422
|
Mutation(() => String),
|
|
340
423
|
__param(0, Arg("modelId")),
|
|
424
|
+
__param(1, Arg("params", () => VoiceActivityParamsInput, { nullable: true })),
|
|
341
425
|
__metadata("design:type", Function),
|
|
342
|
-
__metadata("design:paramtypes", [String]),
|
|
426
|
+
__metadata("design:paramtypes", [String, VoiceActivityParamsInput]),
|
|
343
427
|
__metadata("design:returntype", String)
|
|
344
428
|
], AIResolver.prototype, "aiOpenTranscriptionStream", null);
|
|
345
429
|
__decorate([
|
|
@@ -351,11 +435,11 @@ __decorate([
|
|
|
351
435
|
], AIResolver.prototype, "aiCloseTranscriptionStream", null);
|
|
352
436
|
__decorate([
|
|
353
437
|
Mutation(() => String),
|
|
354
|
-
__param(0, Arg("
|
|
438
|
+
__param(0, Arg("streamIds", type => [String])),
|
|
355
439
|
__param(1, Arg("audio", () => [Float])),
|
|
356
440
|
__param(2, PubSub()),
|
|
357
441
|
__metadata("design:type", Function),
|
|
358
|
-
__metadata("design:paramtypes", [
|
|
442
|
+
__metadata("design:paramtypes", [Array, Array, Object]),
|
|
359
443
|
__metadata("design:returntype", Boolean)
|
|
360
444
|
], AIResolver.prototype, "aiFeedTranscriptionStream", null);
|
|
361
445
|
__decorate([
|
package/lib/src/index.d.ts
CHANGED
|
@@ -19,14 +19,15 @@ export * from "./perspectives/PerspectiveProxy";
|
|
|
19
19
|
export * from "./perspectives/PerspectiveDiff";
|
|
20
20
|
export * from "./perspectives/LinkQuery";
|
|
21
21
|
export * from "./SmartLiteral";
|
|
22
|
-
export * from "./
|
|
23
|
-
export * from "./
|
|
22
|
+
export * from "./model/decorators";
|
|
23
|
+
export * from "./model/Subject";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
27
27
|
export * from "./DID";
|
|
28
28
|
export * from "./utils";
|
|
29
|
-
export * from './subject/SubjectEntity';
|
|
30
29
|
export * from "./agent/AgentClient";
|
|
31
30
|
export * from "./ai/AIClient";
|
|
32
31
|
export * from "./ai/Tasks";
|
|
32
|
+
export * from "./runtime/RuntimeResolver";
|
|
33
|
+
export * from './model/Ad4mModel';
|
package/lib/src/index.js
CHANGED
|
@@ -19,14 +19,15 @@ export * from "./perspectives/PerspectiveProxy";
|
|
|
19
19
|
export * from "./perspectives/PerspectiveDiff";
|
|
20
20
|
export * from "./perspectives/LinkQuery";
|
|
21
21
|
export * from "./SmartLiteral";
|
|
22
|
-
export * from "./
|
|
23
|
-
export * from "./
|
|
22
|
+
export * from "./model/decorators";
|
|
23
|
+
export * from "./model/Subject";
|
|
24
24
|
export * from "./neighbourhood/Neighbourhood";
|
|
25
25
|
export * from "./neighbourhood/NeighbourhoodProxy";
|
|
26
26
|
export * from "./typeDefs";
|
|
27
27
|
export * from "./DID";
|
|
28
28
|
export * from "./utils";
|
|
29
|
-
export * from './subject/SubjectEntity';
|
|
30
29
|
export * from "./agent/AgentClient";
|
|
31
30
|
export * from "./ai/AIClient";
|
|
32
31
|
export * from "./ai/Tasks";
|
|
32
|
+
export * from "./runtime/RuntimeResolver";
|
|
33
|
+
export * from './model/Ad4mModel';
|