Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions firestore-vector-search/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ feat: enable Cloud Storage API

fix: bump utilities package

feat: update embedding model from text-embedding-001 to text-embedding-004 for Gemini provider

fix: backfill for embedding with Gemini provider

## Version 0.0.8

fix - replaced validation of prefilters with handling errors raised from firestore
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jest.resetModules();
// Mocking `@genkit-ai/googleai` and `@genkit-ai/vertexai`
jest.mock('@genkit-ai/googleai', () => ({
googleAI: jest.fn(),
textEmbeddingGecko001: 'gecko-001-model',
textEmbedding004: 'text-embedding-004-model',
}));

jest.mock('@genkit-ai/vertexai', () => ({
Expand Down Expand Up @@ -40,8 +40,8 @@ describe('GenkitEmbedClient', () => {

beforeEach(() => {
jest.clearAllMocks();
mockVertexAI = vertexAI as jest.Mock;
mockGoogleAI = googleAI as jest.Mock;
mockVertexAI = vertexAI as unknown as jest.Mock;
mockGoogleAI = googleAI as unknown as jest.Mock;
});

describe('constructor', () => {
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('GenkitEmbedClient', () => {
});

expect(embedClient.provider).toBe('googleai');
expect(embedClient.embedder).toBe('gecko-001-model');
expect(embedClient.embedder).toBe('text-embedding-004-model');
expect(mockGoogleAI).toHaveBeenCalledWith({
apiKey: 'test-api-key',
});
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('GenkitEmbedClient', () => {
});

test('should return a single embedding for an input', async () => {
mockEmbed.mockResolvedValueOnce([7, 8, 9]); // Changed to return array directly
mockEmbed.mockResolvedValueOnce([{embedding: [7, 8, 9]}]); // Changed to return array directly

const input = 'input1';
const embedding = await embedClient.getSingleEmbedding(input);
Expand Down
Loading
Loading