@memberjunction/ai-vertex 2.128.0 → 2.129.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/vertexLLM.test.d.ts +2 -0
- package/dist/__tests__/vertexLLM.test.d.ts.map +1 -0
- package/dist/__tests__/vertexLLM.test.js +439 -0
- package/dist/__tests__/vertexLLM.test.js.map +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/models/vertexLLM.d.ts +109 -54
- package/dist/models/vertexLLM.d.ts.map +1 -1
- package/dist/models/vertexLLM.js +151 -271
- package/dist/models/vertexLLM.js.map +1 -1
- package/package.json +12 -5
- package/readme.md +94 -20
- package/dist/models/vertexEmbedding.d.ts +0 -23
- package/dist/models/vertexEmbedding.d.ts.map +0 -1
- package/dist/models/vertexEmbedding.js +0 -179
- package/dist/models/vertexEmbedding.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertexLLM.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/vertexLLM.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vertexLLM_1 = require("../models/vertexLLM");
|
|
4
|
+
const ai_1 = require("@memberjunction/ai");
|
|
5
|
+
/**
|
|
6
|
+
* Test suite for VertexLLM
|
|
7
|
+
*
|
|
8
|
+
* VertexLLM extends GeminiLLM and inherits all its functionality (chat, streaming,
|
|
9
|
+
* thinking, multimodal, etc.). These tests focus on:
|
|
10
|
+
* 1. Constructor and authentication configuration
|
|
11
|
+
* 2. Basic integration tests (if credentials are available)
|
|
12
|
+
*
|
|
13
|
+
* Setup Requirements:
|
|
14
|
+
* 1. Set VERTEX_PROJECT_ID environment variable
|
|
15
|
+
* 2. Set VERTEX_SERVICE_ACCOUNT_KEY_PATH to path of JSON key file (optional)
|
|
16
|
+
* 3. Set VERTEX_LOCATION (optional, defaults to 'us-central1')
|
|
17
|
+
*
|
|
18
|
+
* To run tests:
|
|
19
|
+
* ```bash
|
|
20
|
+
* export VERTEX_PROJECT_ID="your-project-id"
|
|
21
|
+
* export VERTEX_SERVICE_ACCOUNT_KEY_PATH="/path/to/service-account-key.json"
|
|
22
|
+
* npm test
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
describe('VertexLLM', () => {
|
|
26
|
+
const projectId = process.env.VERTEX_PROJECT_ID || 'test-project';
|
|
27
|
+
const keyPath = process.env.VERTEX_SERVICE_ACCOUNT_KEY_PATH;
|
|
28
|
+
const location = process.env.VERTEX_LOCATION || 'us-central1';
|
|
29
|
+
// Build credentials JSON based on what's available
|
|
30
|
+
const buildCredentialsJson = () => JSON.stringify({
|
|
31
|
+
project: projectId,
|
|
32
|
+
location: location,
|
|
33
|
+
...(keyPath ? { keyFilePath: keyPath } : {})
|
|
34
|
+
});
|
|
35
|
+
describe('Constructor - Credential Formats', () => {
|
|
36
|
+
it('should accept ADC credentials format', () => {
|
|
37
|
+
const creds = JSON.stringify({
|
|
38
|
+
project: 'test-project',
|
|
39
|
+
location: 'us-central1'
|
|
40
|
+
});
|
|
41
|
+
const llm = new vertexLLM_1.VertexLLM(creds);
|
|
42
|
+
expect(llm.Credentials.project).toBe('test-project');
|
|
43
|
+
expect(llm.Credentials.location).toBe('us-central1');
|
|
44
|
+
});
|
|
45
|
+
it('should accept service account JSON format', () => {
|
|
46
|
+
const creds = JSON.stringify({
|
|
47
|
+
type: 'service_account',
|
|
48
|
+
project_id: 'test-project',
|
|
49
|
+
private_key: '-----BEGIN PRIVATE KEY-----\ntest\n-----END PRIVATE KEY-----\n',
|
|
50
|
+
client_email: 'test@test.iam.gserviceaccount.com',
|
|
51
|
+
location: 'us-central1'
|
|
52
|
+
});
|
|
53
|
+
const llm = new vertexLLM_1.VertexLLM(creds);
|
|
54
|
+
expect(llm.Credentials.project).toBe('test-project');
|
|
55
|
+
});
|
|
56
|
+
it('should accept keyFilePath format', () => {
|
|
57
|
+
const creds = JSON.stringify({
|
|
58
|
+
keyFilePath: '/path/to/key.json',
|
|
59
|
+
project: 'test-project',
|
|
60
|
+
location: 'us-central1'
|
|
61
|
+
});
|
|
62
|
+
const llm = new vertexLLM_1.VertexLLM(creds);
|
|
63
|
+
expect(llm.Credentials.keyFilePath).toBe('/path/to/key.json');
|
|
64
|
+
});
|
|
65
|
+
it('should throw error for invalid JSON', () => {
|
|
66
|
+
expect(() => new vertexLLM_1.VertexLLM('not json')).toThrow('Invalid Vertex AI credentials JSON');
|
|
67
|
+
});
|
|
68
|
+
it('should throw error for missing project', () => {
|
|
69
|
+
expect(() => new vertexLLM_1.VertexLLM(JSON.stringify({ location: 'us-central1' })))
|
|
70
|
+
.toThrow('must include "project"');
|
|
71
|
+
});
|
|
72
|
+
it('should default location to us-central1', () => {
|
|
73
|
+
const creds = JSON.stringify({ project: 'test-project' });
|
|
74
|
+
const llm = new vertexLLM_1.VertexLLM(creds);
|
|
75
|
+
expect(llm.Credentials.location).toBe('us-central1');
|
|
76
|
+
});
|
|
77
|
+
it('should use project_id over project if both provided', () => {
|
|
78
|
+
const creds = JSON.stringify({
|
|
79
|
+
project: 'wrong-project',
|
|
80
|
+
project_id: 'correct-project',
|
|
81
|
+
location: 'us-central1'
|
|
82
|
+
});
|
|
83
|
+
const llm = new vertexLLM_1.VertexLLM(creds);
|
|
84
|
+
expect(llm.Credentials.project).toBe('correct-project');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
describe('Instance Properties', () => {
|
|
88
|
+
let vertexLLM;
|
|
89
|
+
beforeEach(() => {
|
|
90
|
+
vertexLLM = new vertexLLM_1.VertexLLM(buildCredentialsJson());
|
|
91
|
+
});
|
|
92
|
+
it('should create instance successfully', () => {
|
|
93
|
+
expect(vertexLLM).toBeInstanceOf(vertexLLM_1.VertexLLM);
|
|
94
|
+
});
|
|
95
|
+
it('should expose GeminiClient getter (inherited)', async () => {
|
|
96
|
+
// GeminiClient requires async initialization - make a chat call to trigger it
|
|
97
|
+
const params = {
|
|
98
|
+
messages: [{ role: 'user', content: 'test' }],
|
|
99
|
+
model: 'gemini-2.0-flash-exp',
|
|
100
|
+
temperature: 0.7
|
|
101
|
+
};
|
|
102
|
+
// This will initialize the client (or fail gracefully if no credentials)
|
|
103
|
+
try {
|
|
104
|
+
await vertexLLM.ChatCompletion(params);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
// Expected to fail without real credentials
|
|
108
|
+
}
|
|
109
|
+
// Now the client should be initialized
|
|
110
|
+
expect(vertexLLM.GeminiClient).toBeDefined();
|
|
111
|
+
});
|
|
112
|
+
it('should expose Credentials getter', () => {
|
|
113
|
+
const creds = vertexLLM.Credentials;
|
|
114
|
+
expect(creds.project).toBe(projectId);
|
|
115
|
+
expect(creds.location).toBe(location);
|
|
116
|
+
});
|
|
117
|
+
it('should report streaming support (inherited from GeminiLLM)', () => {
|
|
118
|
+
expect(vertexLLM.SupportsStreaming).toBe(true);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe('Chat Completion - Integration Tests', () => {
|
|
122
|
+
// Skip actual API calls in CI/CD - only run when credentials are available
|
|
123
|
+
const shouldRunIntegrationTests = process.env.VERTEX_PROJECT_ID &&
|
|
124
|
+
process.env.VERTEX_SERVICE_ACCOUNT_KEY_PATH;
|
|
125
|
+
let vertexLLM;
|
|
126
|
+
beforeEach(() => {
|
|
127
|
+
if (shouldRunIntegrationTests) {
|
|
128
|
+
vertexLLM = new vertexLLM_1.VertexLLM(buildCredentialsJson());
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
it('should handle simple text completion', async () => {
|
|
132
|
+
if (!shouldRunIntegrationTests) {
|
|
133
|
+
console.log('Skipping integration test - credentials not configured');
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const params = {
|
|
137
|
+
messages: [
|
|
138
|
+
{
|
|
139
|
+
role: ai_1.ChatMessageRole.user,
|
|
140
|
+
content: 'What is 2+2? Reply with just the number.'
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
model: 'gemini-2.5-flash',
|
|
144
|
+
temperature: 0.1,
|
|
145
|
+
maxOutputTokens: 10
|
|
146
|
+
};
|
|
147
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
148
|
+
if (!result.success) {
|
|
149
|
+
console.error('Chat completion failed:', result.errorMessage);
|
|
150
|
+
console.error('Exception details:', JSON.stringify(result.exception, null, 2));
|
|
151
|
+
if (result.errorInfo) {
|
|
152
|
+
console.error('Error info:', JSON.stringify(result.errorInfo, null, 2));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
expect(result.success).toBe(true);
|
|
156
|
+
expect(result.data.choices).toHaveLength(1);
|
|
157
|
+
expect(result.data.choices[0].message.content).toBeTruthy();
|
|
158
|
+
expect(result.data.choices[0].message.role).toBe(ai_1.ChatMessageRole.assistant);
|
|
159
|
+
expect(result.data.usage).toBeInstanceOf(ai_1.ModelUsage);
|
|
160
|
+
expect(result.data.usage.promptTokens).toBeGreaterThan(0);
|
|
161
|
+
expect(result.data.usage.completionTokens).toBeGreaterThan(0);
|
|
162
|
+
}, 30000);
|
|
163
|
+
it('should handle system messages (inherited from GeminiLLM)', async () => {
|
|
164
|
+
if (!shouldRunIntegrationTests) {
|
|
165
|
+
console.log('Skipping integration test - credentials not configured');
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const params = {
|
|
169
|
+
messages: [
|
|
170
|
+
{
|
|
171
|
+
role: ai_1.ChatMessageRole.system,
|
|
172
|
+
content: 'You are a helpful math tutor. Always explain your answers.'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
role: ai_1.ChatMessageRole.user,
|
|
176
|
+
content: 'What is 5+3?'
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
model: 'gemini-2.5-flash',
|
|
180
|
+
temperature: 0.5
|
|
181
|
+
};
|
|
182
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
183
|
+
if (!result.success) {
|
|
184
|
+
console.error('Chat completion failed:', result.errorMessage);
|
|
185
|
+
console.error('Exception details:', JSON.stringify(result.exception, null, 2));
|
|
186
|
+
if (result.errorInfo) {
|
|
187
|
+
console.error('Error info:', JSON.stringify(result.errorInfo, null, 2));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
expect(result.success).toBe(true);
|
|
191
|
+
expect(result.data.choices[0].message.content).toContain('8');
|
|
192
|
+
}, 30000);
|
|
193
|
+
it('should handle conversation history (inherited from GeminiLLM)', async () => {
|
|
194
|
+
if (!shouldRunIntegrationTests) {
|
|
195
|
+
console.log('Skipping integration test - credentials not configured');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const params = {
|
|
199
|
+
messages: [
|
|
200
|
+
{
|
|
201
|
+
role: ai_1.ChatMessageRole.user,
|
|
202
|
+
content: 'My name is Alice.'
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
role: ai_1.ChatMessageRole.assistant,
|
|
206
|
+
content: 'Hello Alice! Nice to meet you.'
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
role: ai_1.ChatMessageRole.user,
|
|
210
|
+
content: 'What is my name?'
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
model: 'gemini-2.5-flash',
|
|
214
|
+
temperature: 0.1
|
|
215
|
+
};
|
|
216
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
217
|
+
if (!result.success) {
|
|
218
|
+
console.error('Chat completion failed:', result.errorMessage);
|
|
219
|
+
console.error('Exception details:', JSON.stringify(result.exception, null, 2));
|
|
220
|
+
if (result.errorInfo) {
|
|
221
|
+
console.error('Error info:', JSON.stringify(result.errorInfo, null, 2));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
expect(result.success).toBe(true);
|
|
225
|
+
expect(result.data.choices[0].message.content.toLowerCase()).toContain('alice');
|
|
226
|
+
}, 30000);
|
|
227
|
+
it.skip('should support streaming with callbacks (inherited from GeminiLLM)', async () => {
|
|
228
|
+
if (!shouldRunIntegrationTests) {
|
|
229
|
+
console.log('Skipping integration test - credentials not configured');
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const chunks = [];
|
|
233
|
+
let completeCalled = false;
|
|
234
|
+
const params = {
|
|
235
|
+
messages: [
|
|
236
|
+
{
|
|
237
|
+
role: ai_1.ChatMessageRole.user,
|
|
238
|
+
content: 'Count from 1 to 3.'
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
model: 'gemini-2.5-flash',
|
|
242
|
+
temperature: 0.1,
|
|
243
|
+
streaming: true,
|
|
244
|
+
streamingCallbacks: {
|
|
245
|
+
OnContent: (content) => {
|
|
246
|
+
chunks.push(content);
|
|
247
|
+
},
|
|
248
|
+
OnComplete: (result) => {
|
|
249
|
+
completeCalled = true;
|
|
250
|
+
expect(result.success).toBe(true);
|
|
251
|
+
},
|
|
252
|
+
OnError: (error) => {
|
|
253
|
+
throw new Error(`Streaming error: ${error}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
258
|
+
if (!result.success) {
|
|
259
|
+
console.error('Chat completion failed:', result.errorMessage);
|
|
260
|
+
console.error('Exception details:', JSON.stringify(result.exception, null, 2));
|
|
261
|
+
if (result.errorInfo) {
|
|
262
|
+
console.error('Error info:', JSON.stringify(result.errorInfo, null, 2));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
expect(result.success).toBe(true);
|
|
266
|
+
expect(completeCalled).toBe(true);
|
|
267
|
+
// Streaming should return final result in data
|
|
268
|
+
expect(result.data.choices).toHaveLength(1);
|
|
269
|
+
expect(result.data.choices[0].message.content).toBeTruthy();
|
|
270
|
+
expect(result.data.choices[0].message.content.length).toBeGreaterThan(0);
|
|
271
|
+
// Note: OnContent callbacks may or may not fire depending on provider implementation
|
|
272
|
+
// What matters is that streaming mode completes successfully
|
|
273
|
+
}, 30000);
|
|
274
|
+
it('should handle thinking/reasoning for Gemini 2.5+ models', async () => {
|
|
275
|
+
if (!shouldRunIntegrationTests) {
|
|
276
|
+
console.log('Skipping integration test - credentials not configured');
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const params = {
|
|
280
|
+
messages: [
|
|
281
|
+
{
|
|
282
|
+
role: ai_1.ChatMessageRole.user,
|
|
283
|
+
content: 'Solve: If x + 5 = 12, what is x?'
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
model: 'gemini-2.5-flash',
|
|
287
|
+
temperature: 0.3,
|
|
288
|
+
effortLevel: '50' // Medium thinking effort (string for compatibility)
|
|
289
|
+
};
|
|
290
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
291
|
+
if (!result.success) {
|
|
292
|
+
console.error('Chat completion failed:', result.errorMessage);
|
|
293
|
+
console.error('Exception details:', JSON.stringify(result.exception, null, 2));
|
|
294
|
+
if (result.errorInfo) {
|
|
295
|
+
console.error('Error info:', JSON.stringify(result.errorInfo, null, 2));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
expect(result.success).toBe(true);
|
|
299
|
+
expect(result.data.choices[0].message.content).toBeTruthy();
|
|
300
|
+
// Note: thinking content may or may not be present depending on model version
|
|
301
|
+
}, 30000);
|
|
302
|
+
});
|
|
303
|
+
describe('Gemini 3 Models - Integration Tests', () => {
|
|
304
|
+
// Skip actual API calls in CI/CD - only run when credentials are available
|
|
305
|
+
const shouldRunIntegrationTests = process.env.VERTEX_PROJECT_ID &&
|
|
306
|
+
process.env.VERTEX_SERVICE_ACCOUNT_KEY_PATH;
|
|
307
|
+
let vertexLLM;
|
|
308
|
+
beforeEach(() => {
|
|
309
|
+
if (shouldRunIntegrationTests) {
|
|
310
|
+
// Gemini 3 preview models require 'global' location, not regional endpoints
|
|
311
|
+
// See: https://github.com/block/goose/issues/6186
|
|
312
|
+
const gemini3CredentialsJson = JSON.stringify({
|
|
313
|
+
project: projectId,
|
|
314
|
+
location: 'global', // Must use global for Gemini 3 preview models
|
|
315
|
+
...(keyPath ? { keyFilePath: keyPath } : {})
|
|
316
|
+
});
|
|
317
|
+
vertexLLM = new vertexLLM_1.VertexLLM(gemini3CredentialsJson);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
it('should work with Gemini 3 Flash', async () => {
|
|
321
|
+
if (!shouldRunIntegrationTests) {
|
|
322
|
+
console.log('Skipping integration test - credentials not configured');
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const params = {
|
|
326
|
+
messages: [
|
|
327
|
+
{
|
|
328
|
+
role: ai_1.ChatMessageRole.user,
|
|
329
|
+
content: 'What is the capital of France? Reply with just the city name.'
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
model: 'gemini-3-flash-preview',
|
|
333
|
+
temperature: 0.1,
|
|
334
|
+
maxOutputTokens: 20
|
|
335
|
+
};
|
|
336
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
337
|
+
// Gemini 3 models may not be available in all projects (preview status)
|
|
338
|
+
if (!result.success) {
|
|
339
|
+
console.log('Gemini 3 Flash not available (preview), skipping:', result.errorMessage);
|
|
340
|
+
return; // Skip test if model not available
|
|
341
|
+
}
|
|
342
|
+
expect(result.success).toBe(true);
|
|
343
|
+
expect(result.data.choices).toHaveLength(1);
|
|
344
|
+
expect(result.data.choices[0].message.content).toBeTruthy();
|
|
345
|
+
expect(result.data.choices[0].message.content.toLowerCase()).toContain('paris');
|
|
346
|
+
}, 30000);
|
|
347
|
+
it('should work with Gemini 3 Pro for complex reasoning', async () => {
|
|
348
|
+
if (!shouldRunIntegrationTests) {
|
|
349
|
+
console.log('Skipping integration test - credentials not configured');
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const params = {
|
|
353
|
+
messages: [
|
|
354
|
+
{
|
|
355
|
+
role: ai_1.ChatMessageRole.user,
|
|
356
|
+
content: 'Write a function in Python that calculates fibonacci numbers. Keep it concise.'
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
model: 'gemini-3-pro-preview',
|
|
360
|
+
temperature: 0.3,
|
|
361
|
+
maxOutputTokens: 200,
|
|
362
|
+
effortLevel: '75' // High reasoning effort
|
|
363
|
+
};
|
|
364
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
365
|
+
// Gemini 3 models may not be available in all projects (preview status)
|
|
366
|
+
if (!result.success) {
|
|
367
|
+
console.log('Gemini 3 Pro not available (preview), skipping:', result.errorMessage);
|
|
368
|
+
return; // Skip test if model not available
|
|
369
|
+
}
|
|
370
|
+
expect(result.success).toBe(true);
|
|
371
|
+
expect(result.data.choices).toHaveLength(1);
|
|
372
|
+
const content = result.data.choices[0].message.content;
|
|
373
|
+
expect(content).toBeTruthy();
|
|
374
|
+
expect(content.toLowerCase()).toContain('def');
|
|
375
|
+
// Model may use "fib" or "fibonacci" as function name
|
|
376
|
+
expect(content.toLowerCase()).toMatch(/fib(onacci)?/);
|
|
377
|
+
}, 30000);
|
|
378
|
+
it('should handle Gemini 3 Pro Image for image generation', async () => {
|
|
379
|
+
if (!shouldRunIntegrationTests) {
|
|
380
|
+
console.log('Skipping integration test - credentials not configured');
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const params = {
|
|
384
|
+
messages: [
|
|
385
|
+
{
|
|
386
|
+
role: ai_1.ChatMessageRole.user,
|
|
387
|
+
content: 'Describe what a blue sky looks like. Keep it brief.'
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
model: 'gemini-3-pro-image-preview',
|
|
391
|
+
temperature: 0.5,
|
|
392
|
+
maxOutputTokens: 100
|
|
393
|
+
};
|
|
394
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
395
|
+
// Gemini 3 Pro Image may not be available in all projects (preview status)
|
|
396
|
+
if (!result.success) {
|
|
397
|
+
console.log('Gemini 3 Pro Image not available (preview), skipping:', result.errorMessage);
|
|
398
|
+
return; // Skip test if model not available
|
|
399
|
+
}
|
|
400
|
+
expect(result.success).toBe(true);
|
|
401
|
+
expect(result.data.choices).toHaveLength(1);
|
|
402
|
+
expect(result.data.choices[0].message.content).toBeTruthy();
|
|
403
|
+
}, 60000); // Increased timeout for slower image model
|
|
404
|
+
});
|
|
405
|
+
describe('Error Handling (inherited from GeminiLLM)', () => {
|
|
406
|
+
let vertexLLM;
|
|
407
|
+
beforeEach(() => {
|
|
408
|
+
vertexLLM = new vertexLLM_1.VertexLLM(buildCredentialsJson());
|
|
409
|
+
});
|
|
410
|
+
it('should handle invalid model name gracefully', async () => {
|
|
411
|
+
const params = {
|
|
412
|
+
messages: [
|
|
413
|
+
{
|
|
414
|
+
role: ai_1.ChatMessageRole.user,
|
|
415
|
+
content: 'Test message'
|
|
416
|
+
}
|
|
417
|
+
],
|
|
418
|
+
model: 'nonexistent-model-xyz-123',
|
|
419
|
+
temperature: 0.5
|
|
420
|
+
};
|
|
421
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
422
|
+
expect(result.success).toBe(false);
|
|
423
|
+
expect(result.errorMessage).toBeTruthy();
|
|
424
|
+
expect(result.exception).toBeDefined();
|
|
425
|
+
expect(result.errorInfo).toBeDefined();
|
|
426
|
+
}, 30000);
|
|
427
|
+
it('should handle empty messages array', async () => {
|
|
428
|
+
const params = {
|
|
429
|
+
messages: [],
|
|
430
|
+
model: 'gemini-2.5-flash',
|
|
431
|
+
temperature: 0.5
|
|
432
|
+
};
|
|
433
|
+
const result = await vertexLLM.ChatCompletion(params);
|
|
434
|
+
expect(result).toBeDefined();
|
|
435
|
+
expect(result.success).toBeDefined();
|
|
436
|
+
}, 30000);
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
//# sourceMappingURL=vertexLLM.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertexLLM.test.js","sourceRoot":"","sources":["../../src/__tests__/vertexLLM.test.ts"],"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AAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAMnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,12 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.LoadVertexLLM = void 0;
|
|
18
18
|
__exportStar(require("./models/vertexLLM"), exports);
|
|
19
|
-
|
|
19
|
+
// Note: vertexEmbedding.ts removed - it used deprecated @google-cloud/vertexai SDK
|
|
20
|
+
// and only returned mock embeddings. The new @google/genai SDK doesn't yet support
|
|
21
|
+
// embeddings. Will be re-implemented when embedding support is added to @google/genai.
|
|
20
22
|
// Re-export Load functions for bundle
|
|
21
23
|
var vertexLLM_1 = require("./models/vertexLLM");
|
|
22
24
|
Object.defineProperty(exports, "LoadVertexLLM", { enumerable: true, get: function () { return vertexLLM_1.LoadVertexLLM; } });
|
|
23
|
-
var vertexEmbedding_1 = require("./models/vertexEmbedding");
|
|
24
|
-
Object.defineProperty(exports, "LoadVertexEmbedding", { enumerable: true, get: function () { return vertexEmbedding_1.LoadVertexEmbedding; } });
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,mFAAmF;AACnF,mFAAmF;AACnF,uFAAuF;AAEvF,sCAAsC;AACtC,gDAAmD;AAA1C,0GAAA,aAAa,OAAA"}
|