adminforth 2.27.0-next.45 → 2.27.0-next.47

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.
@@ -1,3 +1,9 @@
1
+ export type CompletionStreamEvent = {
2
+ type: "output" | "reasoning";
3
+ delta: string;
4
+ text: string;
5
+ source?: "summary" | "text";
6
+ };
1
7
  export interface CompletionAdapter {
2
8
 
3
9
  /**
@@ -7,17 +13,23 @@ export interface CompletionAdapter {
7
13
  validate(): void;
8
14
 
9
15
  /**
10
- * This method should return a text completion based on the provided content and stop sequence.
16
+ * This method should return a text completion based on the provided content.
11
17
  * @param content - The input text to complete
12
- * @param stop - An array of stop sequences to indicate where to stop the completion
13
18
  * @param maxTokens - The maximum number of tokens to generate
19
+ * @param outputSchema - Optional structured output schema for the response
20
+ * @param reasoningEffort - Optional parameter to indicate the level of reasoning effort for the completion
21
+ * @param onChunk - Optional callback invoked for each streamed chunk or reasoning event
14
22
  * @returns A promise that resolves to an object containing the completed text and other metadata
15
23
  */
16
24
  complete(
17
25
  content: string,
18
- stop: string[],
19
26
  maxTokens: number,
20
- outputSchema?: any
27
+ outputSchema?: any,
28
+ reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh',
29
+ onChunk?: (
30
+ chunk: string,
31
+ event?: CompletionStreamEvent,
32
+ ) => void | Promise<void>,
21
33
  ): Promise<{
22
34
  content?: string;
23
35
  finishReason?: string;
@@ -30,4 +42,4 @@ export interface CompletionAdapter {
30
42
  * @returns The number of tokens in the input content
31
43
  */
32
44
  measureTokensCount(content: string): Promise<number> | number;
33
- }
45
+ }
@@ -1,8 +1,8 @@
1
1
  export type { EmailAdapter } from './EmailAdapter.js';
2
- export type { CompletionAdapter } from './CompletionAdapter.js';
2
+ export type { CompletionAdapter, CompletionStreamEvent } from './CompletionAdapter.js';
3
3
  export type { ImageGenerationAdapter } from './ImageGenerationAdapter.js';
4
4
  export type { KeyValueAdapter } from './KeyValueAdapter.js';
5
5
  export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
6
6
  export type { OAuth2Adapter } from './OAuth2Adapter.js';
7
7
  export type { StorageAdapter } from './StorageAdapter.js';
8
- export type { CaptchaAdapter } from './CaptchaAdapter.js';
8
+ export type { CaptchaAdapter } from './CaptchaAdapter.js';
@@ -1,3 +1,9 @@
1
+ export type CompletionStreamEvent = {
2
+ type: "output" | "reasoning";
3
+ delta: string;
4
+ text: string;
5
+ source?: "summary" | "text";
6
+ };
1
7
  export interface CompletionAdapter {
2
8
  /**
3
9
  * This method is called to validate the configuration of the adapter
@@ -5,13 +11,15 @@ export interface CompletionAdapter {
5
11
  */
6
12
  validate(): void;
7
13
  /**
8
- * This method should return a text completion based on the provided content and stop sequence.
14
+ * This method should return a text completion based on the provided content.
9
15
  * @param content - The input text to complete
10
- * @param stop - An array of stop sequences to indicate where to stop the completion
11
16
  * @param maxTokens - The maximum number of tokens to generate
17
+ * @param outputSchema - Optional structured output schema for the response
18
+ * @param reasoningEffort - Optional parameter to indicate the level of reasoning effort for the completion
19
+ * @param onChunk - Optional callback invoked for each streamed chunk or reasoning event
12
20
  * @returns A promise that resolves to an object containing the completed text and other metadata
13
21
  */
14
- complete(content: string, stop: string[], maxTokens: number, outputSchema?: any): Promise<{
22
+ complete(content: string, maxTokens: number, outputSchema?: any, reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh', onChunk?: (chunk: string, event?: CompletionStreamEvent) => void | Promise<void>): Promise<{
15
23
  content?: string;
16
24
  finishReason?: string;
17
25
  error?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionAdapter.d.ts","sourceRoot":"","sources":["../../../types/adapters/CompletionAdapter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAEhC;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;IAEjB;;;;;;OAMG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EAC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/D"}
@@ -1,5 +1,5 @@
1
1
  export type { EmailAdapter } from './EmailAdapter.js';
2
- export type { CompletionAdapter } from './CompletionAdapter.js';
2
+ export type { CompletionAdapter, CompletionStreamEvent } from './CompletionAdapter.js';
3
3
  export type { ImageGenerationAdapter } from './ImageGenerationAdapter.js';
4
4
  export type { KeyValueAdapter } from './KeyValueAdapter.js';
5
5
  export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACvF,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.27.0-next.45",
3
+ "version": "2.27.0-next.47",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",