(chatId: string, runId: string)
| 1194 | }); |
| 1195 | |
| 1196 | export const chatDebugRun = (chatId: string, runId: string) => |
| 1197 | queryOptions({ |
| 1198 | queryKey: chatDebugRunKey(chatId, runId), |
| 1199 | queryFn: () => API.experimental.getChatDebugRun(chatId, runId), |
| 1200 | refetchInterval: ({ state }) => { |
| 1201 | if (state.status === "error") { |
| 1202 | return DEBUG_RUN_ERROR_POLL_MS; |
| 1203 | } |
| 1204 | const status = state.data?.status; |
| 1205 | if (status && TERMINAL_RUN_STATUSES.has(status.toLowerCase())) { |
| 1206 | return false; |
| 1207 | } |
| 1208 | return DEBUG_RUN_POLL_MS; |
| 1209 | }, |
| 1210 | refetchIntervalInBackground: false, |
| 1211 | }); |
| 1212 | |
| 1213 | const invalidateChatDebugRuns = (queryClient: QueryClient, chatId: string) => { |
| 1214 | return queryClient.invalidateQueries({ |
no test coverage detected