@budibase/pro 3.30.6 → 3.31.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/ai/generators/tableGeneration.d.ts +11 -3
- package/dist/ai/models/base.d.ts +1 -3
- package/dist/ai/models/budibaseai.d.ts +1 -1
- package/dist/ai/prompts/index.d.ts +0 -2
- package/dist/errors.d.ts +7 -0
- package/dist/index.js +80 -41
- package/dist/sdk/features/features.d.ts +2 -0
- package/dist/sdk/quotas/helpers/ai.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LLMResponse } from "@budibase/types";
|
|
1
2
|
import { TableSchemaFromAI } from "../types";
|
|
2
3
|
interface Delegates {
|
|
3
4
|
generateTablesDelegate: (tables: TableSchemaFromAI[]) => Promise<{
|
|
@@ -6,17 +7,24 @@ interface Delegates {
|
|
|
6
7
|
}[]>;
|
|
7
8
|
generateDataDelegate: (data: Record<string, Record<string, any>[]>, userId: string, tables: Record<string, TableSchemaFromAI>) => Promise<void>;
|
|
8
9
|
}
|
|
10
|
+
type ProgressCallback = (message: string) => void;
|
|
9
11
|
export declare class TableGeneration {
|
|
10
|
-
private
|
|
12
|
+
private aiModel;
|
|
11
13
|
private delegates;
|
|
12
14
|
private constructor();
|
|
13
|
-
static init(delegates: Delegates): Promise<TableGeneration>;
|
|
14
|
-
generate(userPrompt: string, userId: string): Promise<{
|
|
15
|
+
static init(aiModel: LLMResponse, delegates: Delegates): Promise<TableGeneration>;
|
|
16
|
+
generate(userPrompt: string, userId: string, onProgress?: ProgressCallback): Promise<{
|
|
15
17
|
id: string;
|
|
16
18
|
name: string;
|
|
17
19
|
}[]>;
|
|
18
20
|
private llmFunctions;
|
|
19
21
|
private generateTables;
|
|
20
22
|
private generateAIColumns;
|
|
23
|
+
private promptForStructuredOutput;
|
|
24
|
+
private hasReasoningEffort;
|
|
25
|
+
private withoutReasoningEffort;
|
|
26
|
+
private shouldRetryWithoutReasoningEffort;
|
|
27
|
+
private getErrorMessage;
|
|
28
|
+
private toModelMessages;
|
|
21
29
|
}
|
|
22
30
|
export {};
|
package/dist/ai/models/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LLMConfigOptions } from "@budibase/types";
|
|
2
2
|
import { Readable } from "node:stream";
|
|
3
3
|
import { LLMFullResponse, LLMPromptResponse } from "../../types/ai";
|
|
4
4
|
import { LLMRequest } from "../llm";
|
|
@@ -16,6 +16,4 @@ export declare abstract class LLM {
|
|
|
16
16
|
abstract uploadFile(data: Readable | Buffer, filename: string, contentType?: string): Promise<string>;
|
|
17
17
|
chat(request: LLMRequest): Promise<LLMFullResponse>;
|
|
18
18
|
summarizeText(prompt: string): Promise<LLMPromptResponse>;
|
|
19
|
-
operation(schema: AIFieldMetadata, row: Row): Promise<LLMPromptResponse>;
|
|
20
|
-
private promptForOperation;
|
|
21
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Readable } from "node:stream";
|
|
2
|
-
import { LLMFullResponse, LLMPromptResponse } from "../../types
|
|
2
|
+
import { LLMFullResponse, LLMPromptResponse } from "../../types";
|
|
3
3
|
import { LLMRequest } from "../llm";
|
|
4
4
|
import { LLM } from "./base";
|
|
5
5
|
export declare class BudibaseAI extends LLM {
|
|
@@ -9,8 +9,6 @@ export declare function summarizeText(text: string, length?: SummariseLength): L
|
|
|
9
9
|
export declare function extractFileData(schema: Record<string, any>, fileIdOrDataUrl: string, supportsFile: boolean): LLMRequest;
|
|
10
10
|
export declare function classifyText(text: string, categories: string[]): LLMRequest;
|
|
11
11
|
export declare function cleanData(text: string): LLMRequest;
|
|
12
|
-
export declare function generateSQL(prompt: string, tableSchema: string): LLMRequest;
|
|
13
|
-
export declare function generateCode(prompt: string): LLMRequest;
|
|
14
12
|
export declare function generateCronExpression(text: string): LLMRequest;
|
|
15
13
|
export declare function translate(text: string, language: string): LLMRequest;
|
|
16
14
|
export declare function sentimentAnalysis(text: string): LLMRequest;
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { HTTPError } from "@budibase/backend-core";
|
|
2
|
+
import { MonthlyQuotaName } from "@budibase/types";
|
|
2
3
|
export declare class GroupNameUnavailableError extends HTTPError {
|
|
3
4
|
constructor(groupName: string);
|
|
4
5
|
}
|
|
6
|
+
export declare class AICreditsExhaustedError extends HTTPError {
|
|
7
|
+
constructor();
|
|
8
|
+
getPublicError(): {
|
|
9
|
+
quota: MonthlyQuotaName;
|
|
10
|
+
};
|
|
11
|
+
}
|