Skip to content

Commit

Permalink
Revert "lint: fix EmbeddingProvider already defined error (via claude)"
Browse files Browse the repository at this point in the history
This reverts commit bbbf325.
  • Loading branch information
odilitime committed Dec 28, 2024
1 parent d15588d commit d9aa0cd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/core/src/embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ interface EmbeddingOptions {
provider?: string;
}

// Define the providers as a const object
export const EMBEDDING_PROVIDERS = {
export const EmbeddingProvider = {
OpenAI: "OpenAI",
Ollama: "Ollama",
GaiaNet: "GaiaNet",
BGE: "BGE",
} as const;

// Create type from the values
export type EmbeddingProvider = typeof EMBEDDING_PROVIDERS[keyof typeof EMBEDDING_PROVIDERS];
export type EmbeddingProvider =
(typeof EmbeddingProvider)[keyof typeof EmbeddingProvider];

// If you need individual types, use type aliases instead of namespace
export type OpenAIProvider = typeof EMBEDDING_PROVIDERS.OpenAI;
export type OllamaProvider = typeof EMBEDDING_PROVIDERS.Ollama;
export type GaiaNetProvider = typeof EMBEDDING_PROVIDERS.GaiaNet;
export type BGEProvider = typeof EMBEDDING_PROVIDERS.BGE;
export namespace EmbeddingProvider {
export type OpenAI = typeof EmbeddingProvider.OpenAI;
export type Ollama = typeof EmbeddingProvider.Ollama;
export type GaiaNet = typeof EmbeddingProvider.GaiaNet;
export type BGE = typeof EmbeddingProvider.BGE;
}

export type EmbeddingConfig = {
readonly dimensions: number;
Expand Down

0 comments on commit d9aa0cd

Please sign in to comment.