config.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { ApiHandlerOptions } from "../../../shared/api" // Adjust path if needed
  2. import { EmbedderProvider } from "./manager"
  3. /**
  4. * Configuration state for the code indexing feature
  5. */
  6. export interface CodeIndexConfig {
  7. isEnabled: boolean
  8. isConfigured: boolean
  9. embedderProvider: EmbedderProvider
  10. modelId?: string
  11. openAiOptions?: ApiHandlerOptions
  12. ollamaOptions?: ApiHandlerOptions
  13. openAiCompatibleOptions?: { baseUrl: string; apiKey: string; modelDimension?: number }
  14. geminiOptions?: { apiKey: string }
  15. qdrantUrl?: string
  16. qdrantApiKey?: string
  17. searchMinScore?: number
  18. searchMaxResults?: number
  19. }
  20. /**
  21. * Snapshot of previous configuration used to determine if a restart is required
  22. */
  23. export type PreviousConfigSnapshot = {
  24. enabled: boolean
  25. configured: boolean
  26. embedderProvider: EmbedderProvider
  27. modelId?: string
  28. openAiKey?: string
  29. ollamaBaseUrl?: string
  30. openAiCompatibleBaseUrl?: string
  31. openAiCompatibleApiKey?: string
  32. openAiCompatibleModelDimension?: number
  33. geminiApiKey?: string
  34. qdrantUrl?: string
  35. qdrantApiKey?: string
  36. }