mirror of https://github.com/buster-so/buster.git
hotfix: use v2 on chats
This commit is contained in:
parent
00ff79c593
commit
0c3994da00
|
@ -2,7 +2,7 @@ import type { ChatCreateRequest, ChatWithMessages } from '@buster/server-shared/
|
|||
import mainApi, { mainApiV2 } from '../instances';
|
||||
|
||||
export const createNewChat = async (props: ChatCreateRequest) => {
|
||||
return mainApi.post<ChatWithMessages>('/chats', props).then((res) => res.data);
|
||||
return mainApiV2.post<ChatWithMessages>('/chats', props).then((res) => res.data);
|
||||
};
|
||||
|
||||
export const stopChat = async ({ chatId }: { chatId: string }) => {
|
||||
|
@ -12,5 +12,5 @@ export const stopChat = async ({ chatId }: { chatId: string }) => {
|
|||
export const startChatFromAsset = async (
|
||||
params: Pick<NonNullable<ChatCreateRequest>, 'asset_id' | 'asset_type' | 'prompt'>
|
||||
): Promise<ChatWithMessages> => {
|
||||
return mainApi.post<ChatWithMessages>('/chats', params).then((res) => res.data);
|
||||
return mainApiV2.post<ChatWithMessages>('/chats', params).then((res) => res.data);
|
||||
};
|
||||
|
|
|
@ -64,7 +64,7 @@ type BusterChatMessageResponse = z.infer<typeof BusterChatMessageResponseSchema>
|
|||
const outputSchema = ThinkAndPrepOutputSchema;
|
||||
|
||||
const DEFAULT_CACHE_OPTIONS = {
|
||||
anthropic: { cacheControl: { type: 'ephemeral' } },
|
||||
anthropic: { cacheControl: { type: 'ephemeral', ttl: '1hr' } },
|
||||
};
|
||||
|
||||
// Helper function to create the result object
|
||||
|
|
Loading…
Reference in New Issue