@budibase/types 3.10.5 → 3.10.6
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/api/web/ai.d.ts +30 -4
- package/dist/api/web/global/agents.d.ts +4 -0
- package/dist/api/web/global/index.d.ts +1 -0
- package/dist/documents/app/automation/automation.d.ts +1 -0
- package/dist/documents/app/layout.d.ts +9 -4
- package/dist/documents/document.d.ts +2 -1
- package/dist/documents/global/agents.d.ts +5 -0
- package/dist/documents/global/index.d.ts +1 -0
- package/dist/index.js +13 -13
- package/dist/index.js.map +4 -4
- package/dist/sdk/featureFlag.d.ts +1 -0
- package/package.json +2 -2
package/dist/api/web/ai.d.ts
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
import openai from "openai";
|
|
2
2
|
import { EnrichedBinding } from "../../ui";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
export interface SystemMessage {
|
|
5
|
+
role: "system";
|
|
5
6
|
content: string;
|
|
6
7
|
}
|
|
8
|
+
export interface UserMessage {
|
|
9
|
+
role: "user";
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AssistantMessage {
|
|
13
|
+
role: "assistant";
|
|
14
|
+
content: string | null;
|
|
15
|
+
tool_calls?: openai.ChatCompletionMessageToolCall[];
|
|
16
|
+
}
|
|
17
|
+
export interface ToolMessage {
|
|
18
|
+
role: "tool";
|
|
19
|
+
tool_call_id: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
export type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;
|
|
23
|
+
export type Tool<T extends z.ZodType = z.ZodType> = Required<ToolArgs<T>>;
|
|
24
|
+
export interface ToolArgs<T extends z.ZodType> {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
parameters?: T;
|
|
28
|
+
handler: (args: z.infer<T>) => Promise<string>;
|
|
29
|
+
strict?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function newTool<T extends z.ZodType>(tool: ToolArgs<T>): Tool<T>;
|
|
7
32
|
export type ResponseFormat = "text" | "json" | openai.ResponseFormatJSONSchema;
|
|
8
33
|
export interface ChatCompletionRequest {
|
|
9
34
|
messages: Message[];
|
|
10
35
|
format?: ResponseFormat;
|
|
36
|
+
useTools?: boolean;
|
|
11
37
|
}
|
|
12
38
|
export interface ChatCompletionResponse {
|
|
13
|
-
|
|
14
|
-
tokensUsed
|
|
39
|
+
messages: Message[];
|
|
40
|
+
tokensUsed: number;
|
|
15
41
|
}
|
|
16
42
|
export interface GenerateJsRequest {
|
|
17
43
|
prompt: string;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Document } from "../document";
|
|
2
2
|
export interface Layout extends Document {
|
|
3
|
-
componentLibraries
|
|
4
|
-
title
|
|
5
|
-
favicon
|
|
6
|
-
stylesheets
|
|
3
|
+
componentLibraries?: string[];
|
|
4
|
+
title?: string;
|
|
5
|
+
favicon?: string;
|
|
6
|
+
stylesheets?: string[];
|
|
7
7
|
props: any;
|
|
8
8
|
layoutId?: string;
|
|
9
9
|
name?: string;
|
|
10
|
+
navigation?: string;
|
|
11
|
+
pageWidth?: string;
|
|
12
|
+
embedded?: boolean;
|
|
13
|
+
logoUrl?: string;
|
|
14
|
+
hideTitle?: boolean;
|
|
10
15
|
}
|
|
@@ -39,7 +39,8 @@ export declare enum DocumentType {
|
|
|
39
39
|
SCIM_LOG = "scimlog",
|
|
40
40
|
ROW_ACTIONS = "ra",
|
|
41
41
|
OAUTH2_CONFIG = "oauth2",
|
|
42
|
-
OAUTH2_CONFIG_LOG = "oauth2log"
|
|
42
|
+
OAUTH2_CONFIG_LOG = "oauth2log",
|
|
43
|
+
AGENT_CHAT = "agentchat"
|
|
43
44
|
}
|
|
44
45
|
export declare function getDocumentType(id: string): DocumentType | undefined;
|
|
45
46
|
export declare const DocumentTypesToImport: DocumentType[];
|