listpage-next-nest 0.0.185 → 0.0.193
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/cjs/index.d.ts +45 -4
- package/dist/cjs/index.js +10 -4
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -118,9 +118,43 @@ export declare class LoggingInterceptor implements NestInterceptor {
|
|
|
118
118
|
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
declare type MetaJsonData = {
|
|
122
|
+
id: string;
|
|
123
|
+
object: string;
|
|
124
|
+
created: number;
|
|
125
|
+
model: string;
|
|
126
|
+
choices: Array<{
|
|
127
|
+
index: number;
|
|
128
|
+
message: {
|
|
129
|
+
role: string;
|
|
130
|
+
content: string;
|
|
131
|
+
citations: Array<{
|
|
132
|
+
title: string;
|
|
133
|
+
link: string;
|
|
134
|
+
snippet: string;
|
|
135
|
+
date: string;
|
|
136
|
+
}>;
|
|
137
|
+
};
|
|
138
|
+
finish_reason: string;
|
|
139
|
+
}>;
|
|
140
|
+
usage: {
|
|
141
|
+
credits: number;
|
|
142
|
+
prompt_tokens: number;
|
|
143
|
+
completion_tokens: number;
|
|
144
|
+
total_tokens: number;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export declare class MetaProvider extends LLMProvider {
|
|
149
|
+
protected baseURL: string;
|
|
150
|
+
protected handleJson(json: MetaJsonData): ServerSendJsonData;
|
|
151
|
+
protected handleStream(subject: ReplaySubject<ServerSendEventData>, stream: ReadableStream<Uint8Array<ArrayBufferLike>>): Promise<void>;
|
|
152
|
+
protected request(options: MetaRequestionOption): Promise<Response>;
|
|
153
|
+
}
|
|
154
|
+
|
|
121
155
|
declare type MetaRequestionOption = {
|
|
122
|
-
api_key
|
|
123
|
-
model
|
|
156
|
+
api_key?: string;
|
|
157
|
+
model?: 'fast' | 'fast_thinking' | 'ds-r1';
|
|
124
158
|
messages: Array<{
|
|
125
159
|
role: string;
|
|
126
160
|
content: string;
|
|
@@ -280,9 +314,16 @@ export declare type SupportProvider = 'volcengine' | 'meta';
|
|
|
280
314
|
|
|
281
315
|
export declare const User: (...dataOrPipes: (string | PipeTransform<any, any> | Type<PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
282
316
|
|
|
317
|
+
export declare class VolcengineProvider extends LLMProvider<VolcengineRequestionOption> {
|
|
318
|
+
protected baseURL: string;
|
|
319
|
+
protected handleJson(json: any): ServerSendJsonData;
|
|
320
|
+
protected handleStream(subject: ReplaySubject<ServerSendEventData>, stream: ReadableStream<Uint8Array<ArrayBufferLike>>): Promise<void>;
|
|
321
|
+
protected request(options: VolcengineRequestionOption): Promise<Response>;
|
|
322
|
+
}
|
|
323
|
+
|
|
283
324
|
declare type VolcengineRequestionOption = {
|
|
284
|
-
api_key
|
|
285
|
-
model
|
|
325
|
+
api_key?: string;
|
|
326
|
+
model?: string;
|
|
286
327
|
messages: Array<{
|
|
287
328
|
role: string;
|
|
288
329
|
content: string;
|
package/dist/cjs/index.js
CHANGED
|
@@ -24,8 +24,10 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
VolcengineProvider: ()=>VolcengineProvider,
|
|
27
28
|
LLMProviderModule: ()=>LLMProviderModule,
|
|
28
29
|
RequestContextMiddleware: ()=>RequestContextMiddleware,
|
|
30
|
+
setup: ()=>setup,
|
|
29
31
|
AdminAuthGuard: ()=>AdminAuthGuard,
|
|
30
32
|
LLMProvider: ()=>LLMProvider,
|
|
31
33
|
PaginationData: ()=>PaginationData,
|
|
@@ -45,7 +47,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
45
47
|
RequestContextService: ()=>RequestContextService,
|
|
46
48
|
ServerSendEventName: ()=>types_ServerSendEventName,
|
|
47
49
|
LLMProviderService: ()=>LLMProviderService,
|
|
48
|
-
|
|
50
|
+
MetaProvider: ()=>MetaProvider
|
|
49
51
|
});
|
|
50
52
|
const common_namespaceObject = require("@nestjs/common");
|
|
51
53
|
const external_async_hooks_namespaceObject = require("async_hooks");
|
|
@@ -519,8 +521,8 @@ const external_rxjs_namespaceObject = require("rxjs");
|
|
|
519
521
|
class LLMProvider {
|
|
520
522
|
constructor(options){
|
|
521
523
|
this.baseURL = '';
|
|
522
|
-
this.apiKey = options
|
|
523
|
-
this.model = options
|
|
524
|
+
this.apiKey = options?.api_key;
|
|
525
|
+
this.model = options?.model;
|
|
524
526
|
}
|
|
525
527
|
async call(options) {
|
|
526
528
|
const response = await this.request({
|
|
@@ -661,7 +663,7 @@ class VolcengineProvider extends LLMProvider {
|
|
|
661
663
|
return response;
|
|
662
664
|
}
|
|
663
665
|
constructor(...args){
|
|
664
|
-
super(...args), this.baseURL = 'https://ark.cn-beijing.volces.com/api/v3/chat/completions
|
|
666
|
+
super(...args), this.baseURL = 'https://ark.cn-beijing.volces.com/api/v3/chat/completions';
|
|
665
667
|
}
|
|
666
668
|
}
|
|
667
669
|
class MetaProvider extends LLMProvider {
|
|
@@ -884,6 +886,7 @@ exports.LLMProvider = __webpack_exports__.LLMProvider;
|
|
|
884
886
|
exports.LLMProviderModule = __webpack_exports__.LLMProviderModule;
|
|
885
887
|
exports.LLMProviderService = __webpack_exports__.LLMProviderService;
|
|
886
888
|
exports.LoggingInterceptor = __webpack_exports__.LoggingInterceptor;
|
|
889
|
+
exports.MetaProvider = __webpack_exports__.MetaProvider;
|
|
887
890
|
exports.PaginatedResponse = __webpack_exports__.PaginatedResponse;
|
|
888
891
|
exports.PaginationData = __webpack_exports__.PaginationData;
|
|
889
892
|
exports.Public = __webpack_exports__.Public;
|
|
@@ -896,6 +899,7 @@ exports.StaticRouteMiddleware = __webpack_exports__.StaticRouteMiddleware;
|
|
|
896
899
|
exports.StaticRouteMiddlewareFactory = __webpack_exports__.StaticRouteMiddlewareFactory;
|
|
897
900
|
exports.StaticRouteModule = __webpack_exports__.StaticRouteModule;
|
|
898
901
|
exports.User = __webpack_exports__.User;
|
|
902
|
+
exports.VolcengineProvider = __webpack_exports__.VolcengineProvider;
|
|
899
903
|
exports.setup = __webpack_exports__.setup;
|
|
900
904
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
901
905
|
"AdminAuthGuard",
|
|
@@ -907,6 +911,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
907
911
|
"LLMProviderModule",
|
|
908
912
|
"LLMProviderService",
|
|
909
913
|
"LoggingInterceptor",
|
|
914
|
+
"MetaProvider",
|
|
910
915
|
"PaginatedResponse",
|
|
911
916
|
"PaginationData",
|
|
912
917
|
"Public",
|
|
@@ -919,6 +924,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
919
924
|
"StaticRouteMiddlewareFactory",
|
|
920
925
|
"StaticRouteModule",
|
|
921
926
|
"User",
|
|
927
|
+
"VolcengineProvider",
|
|
922
928
|
"setup"
|
|
923
929
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
924
930
|
Object.defineProperty(exports, '__esModule', {
|