mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
refactor(ai): initialize GoogleGenAI with process.env.GEMINI_API_KEY directly for embedding
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user