refactor(ai): initialize GoogleGenAI with process.env.GEMINI_API_KEY directly for embedding

This commit is contained in:
yiling
2026-05-28 15:21:44 +08:00
parent 6bce76cf0a
commit f1963e7bb9
3 changed files with 4 additions and 16 deletions
+1 -1
View File
@@ -33,6 +33,7 @@ vi.mock('@google/genai', () => {
describe('AI Activities', () => {
beforeEach(() => {
vi.clearAllMocks()
process.env.GEMINI_API_KEY = 'test-key'
})
it('should generate image embedding', async () => {
@@ -45,7 +46,6 @@ describe('AI Activities', () => {
const context = {
agent: { config: { provider: 'google', model: 'gemini' } },
asset: { id: 'a1', mediaType: 'image/png', storageKey: { key: 'test.png' } },
dbProvider: { config: { apiKey: 'key' } },
}
const res = await generateEmbeddingActivity({