@budibase/pro 3.12.8 → 3.12.10
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/index.d.ts +1 -0
- package/dist/ai/models/anthropic.d.ts +3 -1
- package/dist/ai/models/azureOpenai.d.ts +6 -0
- package/dist/ai/models/base.d.ts +5 -1
- package/dist/ai/models/budibaseai.d.ts +8 -1
- package/dist/ai/models/openai.d.ts +7 -2
- package/dist/ai/prompts/index.d.ts +1 -0
- package/dist/ai/utils.d.ts +1 -0
- package/dist/constants/quotas.d.ts +7 -0
- package/dist/index.js +47 -46
- package/dist/sdk/quotas/helpers/actions.d.ts +1 -0
- package/dist/sdk/quotas/helpers/index.d.ts +1 -0
- package/dist/types/ai.d.ts +16 -0
- package/package.json +3 -3
package/dist/ai/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./utils";
|
|
|
2
2
|
export * from "./prompts";
|
|
3
3
|
export { parseResponseFormat } from "./models/openai";
|
|
4
4
|
export { getLLM, getLLMConfig, getLLMOrThrow, LLMRequest } from "./llm";
|
|
5
|
+
export { LLM } from "./models/base";
|
|
5
6
|
export * from "./prompts";
|
|
6
7
|
export * from "./generators";
|
|
7
8
|
export * from "./structuredOutputs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AnthropicClient from "@anthropic-ai/sdk";
|
|
2
|
-
import { LLMFullResponse } from "../../types/ai";
|
|
2
|
+
import { LLMFullResponse, LLMStreamChunk } from "../../types/ai";
|
|
3
3
|
import { LLM } from "./base";
|
|
4
4
|
import { LLMRequest } from "../llm";
|
|
5
5
|
import { LLMConfigOptions } from "@budibase/types";
|
|
@@ -8,5 +8,7 @@ export declare class Anthropic extends LLM {
|
|
|
8
8
|
private client;
|
|
9
9
|
constructor(opts: LLMConfigOptions);
|
|
10
10
|
firstTextBlock(message: AnthropicClient.Messages.Message): string | undefined;
|
|
11
|
+
uploadFile(_data?: any, _filename?: string, _contentType?: string): Promise<string>;
|
|
11
12
|
protected chatCompletion(request: LLMRequest): Promise<LLMFullResponse>;
|
|
13
|
+
protected chatCompletionStream(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
12
14
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LLMConfigOptions } from "@budibase/types";
|
|
2
|
+
import { OpenAI } from "./openai";
|
|
3
|
+
import { AzureOpenAI as AzureOpenAIClient } from "openai";
|
|
4
|
+
export declare class AzureOpenAI extends OpenAI {
|
|
5
|
+
protected getClient(opts: LLMConfigOptions): AzureOpenAIClient;
|
|
6
|
+
}
|
package/dist/ai/models/base.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AIFieldMetadata, EnrichedBinding, LLMConfigOptions, Row, Snippet } from "@budibase/types";
|
|
2
|
-
import { LLMFullResponse, LLMPromptResponse } from "../../types/ai";
|
|
2
|
+
import { LLMFullResponse, LLMPromptResponse, LLMStreamChunk } from "../../types/ai";
|
|
3
3
|
import { LLMRequest } from "../llm";
|
|
4
|
+
import { Readable } from "node:stream";
|
|
4
5
|
export declare abstract class LLM {
|
|
5
6
|
protected _model: string;
|
|
6
7
|
protected _apiKey?: string;
|
|
@@ -10,8 +11,11 @@ export declare abstract class LLM {
|
|
|
10
11
|
get apiKey(): string | undefined;
|
|
11
12
|
get maxTokens(): number;
|
|
12
13
|
protected abstract chatCompletion(request: LLMRequest): Promise<LLMFullResponse>;
|
|
14
|
+
protected abstract chatCompletionStream(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
13
15
|
prompt(requestOrString: string | LLMRequest): Promise<LLMPromptResponse>;
|
|
16
|
+
abstract uploadFile(data: Readable | Buffer, filename: string, contentType?: string): Promise<string>;
|
|
14
17
|
chat(request: LLMRequest): Promise<LLMFullResponse>;
|
|
18
|
+
chatStream(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
15
19
|
summarizeText(prompt: string): Promise<LLMPromptResponse>;
|
|
16
20
|
generateCronExpression(prompt: string): Promise<LLMPromptResponse>;
|
|
17
21
|
operation(schema: AIFieldMetadata, row: Row): Promise<LLMPromptResponse>;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { LLMFullResponse, LLMPromptResponse } from "../../types/ai";
|
|
1
|
+
import { LLMFullResponse, LLMPromptResponse, LLMStreamChunk } from "../../types/ai";
|
|
2
2
|
import { LLM } from "./base";
|
|
3
3
|
import { LLMRequest } from "../llm";
|
|
4
|
+
import { Readable } from "node:stream";
|
|
4
5
|
export declare class BudibaseAI extends LLM {
|
|
5
6
|
prompt(prompt: string | LLMRequest): Promise<LLMPromptResponse>;
|
|
6
7
|
chat(prompt: LLMRequest): Promise<LLMFullResponse>;
|
|
8
|
+
uploadFile(data: Readable | Buffer, filename: string, contentType: string): Promise<string>;
|
|
9
|
+
protected uploadFileCloud(data: Readable | Buffer, filename: string, contentType: string): Promise<string>;
|
|
10
|
+
protected uploadFileSelfHost(data: Readable | Buffer, filename: string, contentType: string): Promise<string>;
|
|
7
11
|
protected chatCompletion(prompt: LLMRequest): Promise<LLMFullResponse>;
|
|
8
12
|
protected chatCompletionCloud(prompt: LLMRequest): Promise<LLMFullResponse>;
|
|
9
13
|
protected chatCompletionSelfHost(prompt: LLMRequest): Promise<LLMFullResponse>;
|
|
14
|
+
protected chatCompletionStream(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
15
|
+
protected chatCompletionStreamCloud(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
16
|
+
protected chatCompletionStreamSelfHost(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
10
17
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import OpenAIClient from "openai";
|
|
2
|
+
import { LLMFullResponse, LLMStreamChunk } from "../../types/ai";
|
|
2
3
|
import { LLM } from "./base";
|
|
3
4
|
import { LLMRequest } from "../llm";
|
|
4
5
|
import { LLMConfigOptions, ResponseFormat } from "@budibase/types";
|
|
5
6
|
import openai from "openai";
|
|
7
|
+
import { Readable } from "node:stream";
|
|
6
8
|
export type OpenAIModel = "gpt-4o-mini" | "gpt-4o" | "gpt-4" | "gpt-4-turbo" | "gpt-3.5-turbo";
|
|
7
9
|
export declare function parseResponseFormat(responseFormat?: ResponseFormat): openai.ResponseFormatText | openai.ResponseFormatJSONObject | openai.ResponseFormatJSONSchema | undefined;
|
|
8
10
|
export declare class OpenAI extends LLM {
|
|
9
|
-
|
|
11
|
+
protected client: OpenAIClient;
|
|
10
12
|
constructor(opts: LLMConfigOptions);
|
|
13
|
+
protected getClient(opts: LLMConfigOptions): OpenAIClient;
|
|
14
|
+
uploadFile(data: Readable | Buffer, filename: string, contentType?: string): Promise<string>;
|
|
11
15
|
protected chatCompletion(request: LLMRequest): Promise<LLMFullResponse>;
|
|
16
|
+
protected chatCompletionStream(request: LLMRequest): AsyncGenerator<LLMStreamChunk, void, unknown>;
|
|
12
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EnrichedBinding, Snippet, ContextUser, SummariseLength } from "@budibase/types";
|
|
2
2
|
import { LLMRequest } from "../llm";
|
|
3
3
|
export declare function summarizeText(text: string, length?: SummariseLength): LLMRequest;
|
|
4
|
+
export declare function extractFileData(schema: Record<string, any>, fileIdOrDataUrl: string): LLMRequest;
|
|
4
5
|
export declare function classifyText(text: string, categories: string[]): LLMRequest;
|
|
5
6
|
export declare function cleanData(text: string): LLMRequest;
|
|
6
7
|
export declare function generateSQL(prompt: string, tableSchema: string): LLMRequest;
|
package/dist/ai/utils.d.ts
CHANGED
|
@@ -62,6 +62,13 @@ export declare const budibaseAICredits: (value: number) => {
|
|
|
62
62
|
triggers: number[];
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
+
export declare const actions: (value: number) => {
|
|
66
|
+
actions: {
|
|
67
|
+
name: string;
|
|
68
|
+
value: number;
|
|
69
|
+
triggers: number[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
65
72
|
export declare const automationLogRetentionDays: (value: number) => {
|
|
66
73
|
automationLogRetentionDays: {
|
|
67
74
|
name: string;
|