open-notebook/frontend/src/lib/api/query-client.ts
Luis Novo b7e656a319
Version 1 (#160)
New front-end
Launch Chat API
Manage Sources
Enable re-embedding of all contents
Sources can be added without a notebook now
Improved settings
Enable model selector on all chats
Background processing for better experience
Dark mode
Improved Notes

Improved Docs: 
- Remove all Streamlit references from documentation
- Update deployment guides with React frontend setup
- Fix Docker environment variables format (SURREAL_URL, SURREAL_PASSWORD)
- Update docker image tag from :latest to :v1-latest
- Change navigation references (Settings → Models to just Models)
- Update development setup to include frontend npm commands
- Add MIGRATION.md guide for users upgrading from Streamlit
- Update quick-start guide with correct environment variables
- Add port 5055 documentation for API access
- Update project structure to reflect frontend/ directory
- Remove outdated source-chat documentation files
2025-10-18 12:46:22 -03:00

33 lines
1.4 KiB
TypeScript

import { QueryClient } from '@tanstack/react-query'
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 5 * 60 * 1000, // 5 minutes
gcTime: 10 * 60 * 1000, // 10 minutes
retry: 2,
refetchOnWindowFocus: false,
},
mutations: {
retry: 1,
},
},
})
export const QUERY_KEYS = {
notebooks: ['notebooks'] as const,
notebook: (id: string) => ['notebooks', id] as const,
notes: (notebookId?: string) => ['notes', notebookId] as const,
note: (id: string) => ['notes', id] as const,
sources: (notebookId?: string) => ['sources', notebookId] as const,
source: (id: string) => ['sources', id] as const,
settings: ['settings'] as const,
sourceChatSessions: (sourceId: string) => ['source-chat', sourceId, 'sessions'] as const,
sourceChatSession: (sourceId: string, sessionId: string) => ['source-chat', sourceId, 'sessions', sessionId] as const,
notebookChatSessions: (notebookId: string) => ['notebook-chat', notebookId, 'sessions'] as const,
notebookChatSession: (sessionId: string) => ['notebook-chat', 'sessions', sessionId] as const,
podcastEpisodes: ['podcasts', 'episodes'] as const,
podcastEpisode: (episodeId: string) => ['podcasts', 'episodes', episodeId] as const,
episodeProfiles: ['podcasts', 'episode-profiles'] as const,
speakerProfiles: ['podcasts', 'speaker-profiles'] as const,
}