@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.
@@ -1,17 +1,43 @@
1
1
  import openai from "openai";
2
2
  import { EnrichedBinding } from "../../ui";
3
- export interface Message {
4
- role: "system" | "user";
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
- message?: string;
14
- tokensUsed?: number;
39
+ messages: Message[];
40
+ tokensUsed: number;
15
41
  }
16
42
  export interface GenerateJsRequest {
17
43
  prompt: string;
@@ -0,0 +1,4 @@
1
+ import { AgentChat } from "../../../documents";
2
+ export type ChatAgentRequest = AgentChat;
3
+ export type ChatAgentResponse = AgentChat;
4
+ export type FetchAgentHistoryResponse = AgentChat[];
@@ -9,3 +9,4 @@ export * from "./email";
9
9
  export * from "./role";
10
10
  export * from "./self";
11
11
  export * from "./template";
12
+ export * from "./agents";
@@ -13,6 +13,7 @@ export declare enum AutomationIOType {
13
13
  ARRAY = "array",
14
14
  JSON = "json",
15
15
  DATE = "date",
16
+ DATETIME = "datetime",
16
17
  ATTACHMENT = "attachment"
17
18
  }
18
19
  export declare enum AutomationCustomIOType {
@@ -1,10 +1,15 @@
1
1
  import { Document } from "../document";
2
2
  export interface Layout extends Document {
3
- componentLibraries: string[];
4
- title: string;
5
- favicon: string;
6
- stylesheets: string[];
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[];
@@ -0,0 +1,5 @@
1
+ import { Document, Message } from "../../";
2
+ export interface AgentChat extends Document {
3
+ title: string;
4
+ messages: Message[];
5
+ }
@@ -9,3 +9,4 @@ export * from "./environmentVariables";
9
9
  export * from "./auditLogs";
10
10
  export * from "./apikeys";
11
11
  export * from "./devInfo";
12
+ export * from "./agents";