hotfix: use v2 on chats

This commit is contained in:
dal 2025-07-24 09:22:30 -06:00
parent 00ff79c593
commit 0c3994da00
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import type { ChatCreateRequest, ChatWithMessages } from '@buster/server-shared/
import mainApi, { mainApiV2 } from '../instances'; import mainApi, { mainApiV2 } from '../instances';
export const createNewChat = async (props: ChatCreateRequest) => { 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 }) => { export const stopChat = async ({ chatId }: { chatId: string }) => {
@ -12,5 +12,5 @@ export const stopChat = async ({ chatId }: { chatId: string }) => {
export const startChatFromAsset = async ( export const startChatFromAsset = async (
params: Pick<NonNullable<ChatCreateRequest>, 'asset_id' | 'asset_type' | 'prompt'> params: Pick<NonNullable<ChatCreateRequest>, 'asset_id' | 'asset_type' | 'prompt'>
): Promise<ChatWithMessages> => { ): Promise<ChatWithMessages> => {
return mainApi.post<ChatWithMessages>('/chats', params).then((res) => res.data); return mainApiV2.post<ChatWithMessages>('/chats', params).then((res) => res.data);
}; };

View File

@ -64,7 +64,7 @@ type BusterChatMessageResponse = z.infer<typeof BusterChatMessageResponseSchema>
const outputSchema = ThinkAndPrepOutputSchema; const outputSchema = ThinkAndPrepOutputSchema;
const DEFAULT_CACHE_OPTIONS = { const DEFAULT_CACHE_OPTIONS = {
anthropic: { cacheControl: { type: 'ephemeral' } }, anthropic: { cacheControl: { type: 'ephemeral', ttl: '1hr' } },
}; };
// Helper function to create the result object // Helper function to create the result object