@budibase/frontend-core 3.24.6 → 3.24.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "3.24.6",
3
+ "version": "3.24.7",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
@@ -18,5 +18,5 @@
18
18
  "shortid": "2.2.15",
19
19
  "socket.io-client": "^4.7.5"
20
20
  },
21
- "gitHead": "e346f36cee24c74adbfeb31800d5b9f3ebe692c0"
21
+ "gitHead": "9c57745f7886ced1ce7f20d92a776144ff7eeec4"
22
22
  }
@@ -3,12 +3,14 @@ import {
3
3
  CustomAIProviderConfig,
4
4
  CreateAIConfigRequest,
5
5
  UpdateAIConfigRequest,
6
+ LLMProvidersResponse,
6
7
  } from "@budibase/types"
7
8
 
8
9
  import { BaseAPIClient } from "./types"
9
10
 
10
11
  export interface AIConfigEndpoints {
11
12
  fetch: () => Promise<AIConfigListResponse>
13
+ providers: () => Promise<LLMProvidersResponse>
12
14
  create: (config: CreateAIConfigRequest) => Promise<CustomAIProviderConfig>
13
15
  update: (config: UpdateAIConfigRequest) => Promise<CustomAIProviderConfig>
14
16
  delete: (id: string) => Promise<{ deleted: true }>
@@ -23,6 +25,12 @@ export const buildAIConfigEndpoints = (
23
25
  })
24
26
  },
25
27
 
28
+ providers: async () => {
29
+ return await API.get({
30
+ url: `/api/configs/providers`,
31
+ })
32
+ },
33
+
26
34
  create: async config => {
27
35
  return await API.post({
28
36
  url: `/api/configs`,
@@ -28,6 +28,7 @@
28
28
 
29
29
  export let chat: ChatConversationLike
30
30
  export let loading: boolean = false
31
+ export let persistConversation: boolean = true
31
32
 
32
33
  const dispatch = createEventDispatcher<{
33
34
  chatSaved: { chatId?: string; chat: ChatConversationLike }
@@ -107,7 +108,11 @@
107
108
  return
108
109
  }
109
110
 
110
- if (!chat._id && (!chat.messages || chat.messages.length === 0)) {
111
+ if (
112
+ persistConversation &&
113
+ !chat._id &&
114
+ (!chat.messages || chat.messages.length === 0)
115
+ ) {
111
116
  try {
112
117
  const newChat = await API.createChatConversation(
113
118
  {
@@ -141,6 +146,7 @@
141
146
  const updatedChat: ChatConversationLike = {
142
147
  ...chat,
143
148
  chatAppId: chat.chatAppId,
149
+ transient: !persistConversation,
144
150
  messages: [...chat.messages, userMessage],
145
151
  }
146
152
 
@@ -195,7 +201,7 @@
195
201
  // When a chat is created for the first time the server generates the ID.
196
202
  // If we don't have it locally yet, retrieve the saved conversation so
197
203
  // subsequent prompts append to the same document instead of creating a new one.
198
- if (!chat._id && chat.chatAppId) {
204
+ if (persistConversation && !chat._id && chat.chatAppId) {
199
205
  try {
200
206
  const history = await API.fetchChatHistory(chat.chatAppId)
201
207
  const lastMessageId = chat.messages[chat.messages.length - 1]?.id
@@ -419,8 +425,6 @@
419
425
  position: sticky;
420
426
  bottom: 0;
421
427
  width: 100%;
422
- background: var(--background-alt);
423
- padding-bottom: 32px;
424
428
  display: flex;
425
429
  flex-direction: column;
426
430
  }
@@ -438,7 +442,6 @@
438
442
  border: none;
439
443
  outline: none;
440
444
  min-height: 100px;
441
- margin-bottom: 8px;
442
445
  }
443
446
 
444
447
  .input::placeholder {