mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: correct IEmbedder stub implementation for TypeScript compatibility
This commit is contained in:
parent
60bbf31428
commit
409d94d773
1 changed files with 11 additions and 10 deletions
|
|
@ -65,17 +65,18 @@ export class ConversationMemoryServiceFactory {
|
|||
|
||||
private createEmbedder(): IEmbedder {
|
||||
// TODO: Create actual embedder based on configuration
|
||||
// For now, return a stub
|
||||
// For now, return a stub that properly implements IEmbedder
|
||||
return {
|
||||
embed: async (text: string) => {
|
||||
// Return a dummy embedding vector
|
||||
return new Array(384).fill(0).map(() => Math.random())
|
||||
},
|
||||
embedBatch: async (texts: string[]) => {
|
||||
return texts.map(() => new Array(384).fill(0).map(() => Math.random()))
|
||||
},
|
||||
createEmbeddings: async (texts: string[]) => {
|
||||
return texts.map(() => new Array(384).fill(0).map(() => Math.random()))
|
||||
// Return proper EmbeddingResponse format
|
||||
return {
|
||||
embeddings: texts.map(() => new Array(384).fill(0).map(() => Math.random())),
|
||||
model: "stub",
|
||||
usage: {
|
||||
prompt_tokens: texts.join("").length,
|
||||
total_tokens: texts.join("").length,
|
||||
},
|
||||
}
|
||||
},
|
||||
validateConfiguration: async () => {
|
||||
return { valid: true }
|
||||
|
|
@ -85,7 +86,7 @@ export class ConversationMemoryServiceFactory {
|
|||
dimensions: 384,
|
||||
maxInputTokens: 8192,
|
||||
},
|
||||
} as IEmbedder
|
||||
} as unknown as IEmbedder
|
||||
}
|
||||
|
||||
private createVectorStore(): IMemoryVectorStore {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue