@memberjunction/ai-vertex 4.0.0 → 4.2.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/README.md +83 -0
- package/package.json +4 -4
- package/readme.md +51 -393
- 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
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @memberjunction/ai-vertex
|
|
2
|
+
|
|
3
|
+
MemberJunction AI provider for Google Cloud Vertex AI. This package extends the Gemini provider to work with Google Cloud's enterprise Vertex AI platform, providing access to Gemini models through GCP authentication and project-based deployments.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
graph TD
|
|
9
|
+
A["VertexLLM<br/>(Provider)"] -->|extends| B["GeminiLLM<br/>(@memberjunction/ai-gemini)"]
|
|
10
|
+
B -->|extends| C["BaseLLM<br/>(@memberjunction/ai)"]
|
|
11
|
+
A -->|overrides client creation| D["GoogleGenAI<br/>(Vertex Config)"]
|
|
12
|
+
D -->|authenticates via| E["Google Cloud<br/>Service Account"]
|
|
13
|
+
D -->|targets| F["GCP Project +<br/>Region"]
|
|
14
|
+
C -->|registered via| G["@RegisterClass"]
|
|
15
|
+
|
|
16
|
+
style A fill:#7c5295,stroke:#563a6b,color:#fff
|
|
17
|
+
style B fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
18
|
+
style C fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
19
|
+
style D fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
20
|
+
style E fill:#b8762f,stroke:#8a5722,color:#fff
|
|
21
|
+
style F fill:#b8762f,stroke:#8a5722,color:#fff
|
|
22
|
+
style G fill:#b8762f,stroke:#8a5722,color:#fff
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Gemini on Vertex**: Access Gemini Pro, Flash, and other models through Google Cloud
|
|
28
|
+
- **Enterprise Authentication**: Google Cloud service account credentials
|
|
29
|
+
- **Project Isolation**: Scoped to GCP project and region
|
|
30
|
+
- **All Gemini Features**: Inherits chat, streaming, thinking/reasoning, and multimodal support from GeminiLLM
|
|
31
|
+
- **VPC Service Controls**: Compatible with GCP network security boundaries
|
|
32
|
+
- **Regional Deployment**: Deploy to specific GCP regions for data residency
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @memberjunction/ai-vertex
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { VertexLLM } from '@memberjunction/ai-vertex';
|
|
44
|
+
|
|
45
|
+
const llm = new VertexLLM('service-account-json');
|
|
46
|
+
|
|
47
|
+
const result = await llm.ChatCompletion({
|
|
48
|
+
model: 'gemini-2.5-pro',
|
|
49
|
+
messages: [
|
|
50
|
+
{ role: 'user', content: 'Explain cloud AI architecture.' }
|
|
51
|
+
],
|
|
52
|
+
temperature: 0.7
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (result.success) {
|
|
56
|
+
console.log(result.data.choices[0].message.content);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
The API key parameter accepts a JSON string containing GCP service account credentials. Additional settings for project and location are configured via `SetAdditionalSettings`:
|
|
63
|
+
|
|
64
|
+
| Setting | Description |
|
|
65
|
+
|---------|-------------|
|
|
66
|
+
| `project` | GCP project ID |
|
|
67
|
+
| `location` | GCP region (e.g., `us-central1`) |
|
|
68
|
+
|
|
69
|
+
## How It Works
|
|
70
|
+
|
|
71
|
+
`VertexLLM` extends `GeminiLLM` and overrides the `createClient()` method to configure the `GoogleGenAI` client for Vertex AI instead of the public Gemini API. This provides GCP project-scoped access with service account authentication while inheriting all of GeminiLLM's capabilities.
|
|
72
|
+
|
|
73
|
+
## Class Registration
|
|
74
|
+
|
|
75
|
+
Registered as `VertexLLM` via `@RegisterClass(BaseLLM, 'VertexLLM')`.
|
|
76
|
+
|
|
77
|
+
## Dependencies
|
|
78
|
+
|
|
79
|
+
- `@memberjunction/ai` - Core AI abstractions
|
|
80
|
+
- `@memberjunction/ai-gemini` - Gemini provider (parent class)
|
|
81
|
+
- `@memberjunction/global` - Class registration
|
|
82
|
+
- `@google/genai` - Google GenAI SDK
|
|
83
|
+
- `google-auth-library` - Google Cloud authentication
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-vertex",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"description": "MemberJunction Wrapper for Google Vertex AI Models",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@google/genai": "^1.40.0",
|
|
30
|
-
"@memberjunction/ai": "4.
|
|
31
|
-
"@memberjunction/ai-gemini": "4.
|
|
32
|
-
"@memberjunction/global": "4.
|
|
30
|
+
"@memberjunction/ai": "4.2.0",
|
|
31
|
+
"@memberjunction/ai-gemini": "4.2.0",
|
|
32
|
+
"@memberjunction/global": "4.2.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
package/readme.md
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
# @memberjunction/ai-vertex
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MemberJunction AI provider for Google Cloud Vertex AI. This package extends the Gemini provider to work with Google Cloud's enterprise Vertex AI platform, providing access to Gemini models through GCP authentication and project-based deployments.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- ✅ Chat completion (streaming and non-streaming)
|
|
7
|
-
- ✅ Thinking/reasoning support (Gemini 2.5+ models)
|
|
8
|
-
- ✅ Multimodal content (images, audio, video)
|
|
9
|
-
- ✅ Complete parameter mapping
|
|
10
|
-
- ✅ Message alternation and system instructions
|
|
11
|
-
- ✅ Comprehensive error handling
|
|
5
|
+
## Architecture
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
```mermaid
|
|
8
|
+
graph TD
|
|
9
|
+
A["VertexLLM<br/>(Provider)"] -->|extends| B["GeminiLLM<br/>(@memberjunction/ai-gemini)"]
|
|
10
|
+
B -->|extends| C["BaseLLM<br/>(@memberjunction/ai)"]
|
|
11
|
+
A -->|overrides client creation| D["GoogleGenAI<br/>(Vertex Config)"]
|
|
12
|
+
D -->|authenticates via| E["Google Cloud<br/>Service Account"]
|
|
13
|
+
D -->|targets| F["GCP Project +<br/>Region"]
|
|
14
|
+
C -->|registered via| G["@RegisterClass"]
|
|
15
|
+
|
|
16
|
+
style A fill:#7c5295,stroke:#563a6b,color:#fff
|
|
17
|
+
style B fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
18
|
+
style C fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
19
|
+
style D fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
20
|
+
style E fill:#b8762f,stroke:#8a5722,color:#fff
|
|
21
|
+
style F fill:#b8762f,stroke:#8a5722,color:#fff
|
|
22
|
+
style G fill:#b8762f,stroke:#8a5722,color:#fff
|
|
23
|
+
```
|
|
14
24
|
|
|
15
25
|
## Features
|
|
16
26
|
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **Chat Completion**: Full support for chat-based interactions with supported models
|
|
24
|
-
- **Embedding Generation**: Generate text embeddings for semantic search and other applications (currently simulated, pending full Vertex AI embedding API support)
|
|
25
|
-
- **Streaming Support**: Stream responses for real-time UI experiences
|
|
27
|
+
- **Gemini on Vertex**: Access Gemini Pro, Flash, and other models through Google Cloud
|
|
28
|
+
- **Enterprise Authentication**: Google Cloud service account credentials
|
|
29
|
+
- **Project Isolation**: Scoped to GCP project and region
|
|
30
|
+
- **All Gemini Features**: Inherits chat, streaming, thinking/reasoning, and multimodal support from GeminiLLM
|
|
31
|
+
- **VPC Service Controls**: Compatible with GCP network security boundaries
|
|
32
|
+
- **Regional Deployment**: Deploy to specific GCP regions for data residency
|
|
26
33
|
|
|
27
34
|
## Installation
|
|
28
35
|
|
|
@@ -30,396 +37,47 @@ A streamlined wrapper for Google Vertex AI services, providing enterprise-grade
|
|
|
30
37
|
npm install @memberjunction/ai-vertex
|
|
31
38
|
```
|
|
32
39
|
|
|
33
|
-
## Requirements
|
|
34
|
-
|
|
35
|
-
- Node.js 16+
|
|
36
|
-
- Google Cloud credentials with Vertex AI access
|
|
37
|
-
- MemberJunction Core libraries
|
|
38
|
-
|
|
39
|
-
## Migration from v2.128.x
|
|
40
|
-
|
|
41
|
-
**Breaking Change**: Constructor signature has changed to support flexible authentication.
|
|
42
|
-
|
|
43
|
-
### Old (v2.128.x and earlier):
|
|
44
|
-
```typescript
|
|
45
|
-
const llm = new VertexLLM('/path/to/key.json', 'project-id', 'us-central1');
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### New (v2.129.0+):
|
|
49
|
-
```typescript
|
|
50
|
-
const llm = new VertexLLM(JSON.stringify({
|
|
51
|
-
keyFilePath: '/path/to/key.json',
|
|
52
|
-
project: 'project-id',
|
|
53
|
-
location: 'us-central1'
|
|
54
|
-
}));
|
|
55
|
-
```
|
|
56
|
-
|
|
57
40
|
## Usage
|
|
58
41
|
|
|
59
|
-
### Basic Setup
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
import { VertexLLM, VertexAICredentials } from '@memberjunction/ai-vertex';
|
|
63
|
-
|
|
64
|
-
// Option 1: Application Default Credentials (Recommended for Production)
|
|
65
|
-
// Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json or use gcloud auth
|
|
66
|
-
const llm = new VertexLLM(JSON.stringify({
|
|
67
|
-
project: 'your-google-cloud-project-id',
|
|
68
|
-
location: 'us-central1' // Optional, defaults to 'us-central1'
|
|
69
|
-
}));
|
|
70
|
-
|
|
71
|
-
// Option 2: Service Account JSON String
|
|
72
|
-
const serviceAccountJson = process.env.GCP_SERVICE_ACCOUNT_JSON;
|
|
73
|
-
const llm2 = new VertexLLM(serviceAccountJson);
|
|
74
|
-
|
|
75
|
-
// Option 3: Key File Path
|
|
76
|
-
const llm3 = new VertexLLM(JSON.stringify({
|
|
77
|
-
keyFilePath: '/path/to/service-account-key.json',
|
|
78
|
-
project: 'your-project',
|
|
79
|
-
location: 'us-central1'
|
|
80
|
-
}));
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Chat Completion with PaLM Models
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
import { ChatParams } from '@memberjunction/ai';
|
|
87
|
-
|
|
88
|
-
// Create chat parameters for PaLM on Vertex AI
|
|
89
|
-
const chatParams: ChatParams = {
|
|
90
|
-
model: 'text-bison', // Use the Vertex AI model name
|
|
91
|
-
messages: [
|
|
92
|
-
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
93
|
-
{ role: 'user', content: 'What are the main features of Google Vertex AI?' }
|
|
94
|
-
],
|
|
95
|
-
temperature: 0.7,
|
|
96
|
-
maxOutputTokens: 1000
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// Get a response
|
|
100
|
-
try {
|
|
101
|
-
const response = await vertexLLM.ChatCompletion(chatParams);
|
|
102
|
-
if (response.success) {
|
|
103
|
-
console.log('Response:', response.data.choices[0].message.content);
|
|
104
|
-
console.log('Token Usage:', response.data.usage);
|
|
105
|
-
console.log('Time Elapsed (ms):', response.timeElapsed);
|
|
106
|
-
} else {
|
|
107
|
-
console.error('Error:', response.errorMessage);
|
|
108
|
-
}
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.error('Exception:', error);
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Chat Completion with Gemini Models
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
// Example with Google's Gemini model (access through Vertex)
|
|
118
|
-
const geminiParams: ChatParams = {
|
|
119
|
-
model: 'gemini-pro',
|
|
120
|
-
messages: [
|
|
121
|
-
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
122
|
-
{ role: 'user', content: 'Explain the concept of foundation models.' }
|
|
123
|
-
],
|
|
124
|
-
temperature: 0.5,
|
|
125
|
-
maxOutputTokens: 800
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const geminiResponse = await vertexLLM.ChatCompletion(geminiParams);
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Streaming Chat Completion
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
import { ChatParams, StreamingChatCallbacks } from '@memberjunction/ai';
|
|
135
|
-
|
|
136
|
-
// Define streaming callbacks
|
|
137
|
-
const callbacks: StreamingChatCallbacks = {
|
|
138
|
-
OnContent: (chunk: string, isComplete: boolean) => {
|
|
139
|
-
process.stdout.write(chunk);
|
|
140
|
-
},
|
|
141
|
-
OnComplete: (finalResponse) => {
|
|
142
|
-
console.log('\nTotal tokens:', finalResponse.data.usage.totalTokens);
|
|
143
|
-
},
|
|
144
|
-
OnError: (error) => {
|
|
145
|
-
console.error('Streaming error:', error);
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
// Create streaming chat parameters
|
|
150
|
-
const streamingParams: ChatParams = {
|
|
151
|
-
model: 'gemini-pro',
|
|
152
|
-
messages: [
|
|
153
|
-
{ role: 'system', content: 'You are a helpful assistant.' },
|
|
154
|
-
{ role: 'user', content: 'Write a short story about cloud computing.' }
|
|
155
|
-
],
|
|
156
|
-
streaming: true,
|
|
157
|
-
streamingCallbacks: callbacks
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
// Start streaming
|
|
161
|
-
await vertexLLM.ChatCompletion(streamingParams);
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Text Embedding
|
|
165
|
-
|
|
166
|
-
**Note**: The embedding functionality is currently simulated as the Google Vertex AI SDK for Node.js does not yet provide direct access to embedding endpoints. This will be updated once the SDK supports native embedding generation.
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
import { EmbedTextParams, EmbedTextsParams } from '@memberjunction/ai';
|
|
170
|
-
|
|
171
|
-
// Embed a single text
|
|
172
|
-
const embedParams: EmbedTextParams = {
|
|
173
|
-
model: 'textembedding-gecko',
|
|
174
|
-
text: 'This is a sample text to embed.'
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const embedResult = await vertexEmbedding.EmbedText(embedParams);
|
|
178
|
-
console.log('Embedding vector length:', embedResult.vector.length);
|
|
179
|
-
console.log('Tokens used:', embedResult.ModelUsage.promptTokens);
|
|
180
|
-
|
|
181
|
-
// Embed multiple texts
|
|
182
|
-
const multiEmbedParams: EmbedTextsParams = {
|
|
183
|
-
model: 'textembedding-gecko',
|
|
184
|
-
texts: [
|
|
185
|
-
'First text to embed.',
|
|
186
|
-
'Second text to embed.',
|
|
187
|
-
'Third text to embed.'
|
|
188
|
-
]
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const multiEmbedResult = await vertexEmbedding.EmbedTexts(multiEmbedParams);
|
|
192
|
-
console.log('Number of embeddings:', multiEmbedResult.vectors.length);
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Supported Models
|
|
196
|
-
|
|
197
|
-
Google Vertex AI offers a variety of foundation models. Here are some of the key models:
|
|
198
|
-
|
|
199
|
-
### Text/Chat Models
|
|
200
|
-
- **PaLM 2 Family**: text-bison, chat-bison, text-unicorn
|
|
201
|
-
- **Gemini Family**: gemini-pro, gemini-pro-vision, gemini-ultra
|
|
202
|
-
- **Code Generation**: code-bison, codechat-bison
|
|
203
|
-
- **Third-party Models**: Models from other providers may be available through Vertex AI
|
|
204
|
-
|
|
205
|
-
### Embedding Models (Simulated)
|
|
206
|
-
- **Text Embeddings**: textembedding-gecko, textembedding-gecko-multilingual
|
|
207
|
-
- *Note: Currently simulated pending SDK support*
|
|
208
|
-
|
|
209
|
-
### Multimodal Models
|
|
210
|
-
- **Gemini Vision**: gemini-pro-vision
|
|
211
|
-
- **Imagen**: imagegeneration@005
|
|
212
|
-
|
|
213
|
-
Check the [Google Vertex AI documentation](https://cloud.google.com/vertex-ai/docs/generative-ai/models/overview) for the latest list of supported models.
|
|
214
|
-
|
|
215
|
-
## API Reference
|
|
216
|
-
|
|
217
|
-
### VertexLLM Class
|
|
218
|
-
|
|
219
|
-
A class that extends BaseLLM to provide Google Vertex AI-specific functionality.
|
|
220
|
-
|
|
221
|
-
#### Constructor
|
|
222
|
-
|
|
223
|
-
```typescript
|
|
224
|
-
new VertexLLM(apiKey: string, projectId: string, location: string = 'us-central1')
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
- `apiKey`: Path to the Google Cloud service account key file
|
|
228
|
-
- `projectId`: Your Google Cloud project ID
|
|
229
|
-
- `location`: The Google Cloud region for Vertex AI (defaults to 'us-central1')
|
|
230
|
-
|
|
231
|
-
#### Properties
|
|
232
|
-
|
|
233
|
-
- `Client`: (read-only) Returns the underlying Vertex AI client instance
|
|
234
|
-
- `SupportsStreaming`: (read-only) Returns `true` - Google Vertex AI supports streaming
|
|
235
|
-
|
|
236
|
-
#### Methods
|
|
237
|
-
|
|
238
|
-
- `ChatCompletion(params: ChatParams): Promise<ChatResult>` - Perform a chat completion with optional streaming support
|
|
239
|
-
- `SummarizeText(params: SummarizeParams): Promise<SummarizeResult>` - Not implemented yet
|
|
240
|
-
- `ClassifyText(params: ClassifyParams): Promise<ClassifyResult>` - Not implemented yet
|
|
241
|
-
|
|
242
|
-
### VertexEmbedding Class
|
|
243
|
-
|
|
244
|
-
A class that extends BaseEmbeddings to provide Google Vertex AI embedding functionality.
|
|
245
|
-
|
|
246
|
-
#### Constructor
|
|
247
|
-
|
|
248
|
-
```typescript
|
|
249
|
-
new VertexEmbedding(apiKey: string, projectId: string, location: string = 'us-central1')
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
- `apiKey`: Path to the Google Cloud service account key file
|
|
253
|
-
- `projectId`: Your Google Cloud project ID
|
|
254
|
-
- `location`: The Google Cloud region for Vertex AI (defaults to 'us-central1')
|
|
255
|
-
|
|
256
|
-
#### Properties
|
|
257
|
-
|
|
258
|
-
- `Client`: (read-only) Returns the underlying Vertex AI client instance
|
|
259
|
-
|
|
260
|
-
#### Methods
|
|
261
|
-
|
|
262
|
-
- `EmbedText(params: EmbedTextParams): Promise<EmbedTextResult>` - Generate embeddings for a single text (currently simulated)
|
|
263
|
-
- `EmbedTexts(params: EmbedTextsParams): Promise<EmbedTextsResult>` - Generate embeddings for multiple texts (currently simulated)
|
|
264
|
-
- `GetEmbeddingModels(): Promise<any>` - Get available embedding models
|
|
265
|
-
|
|
266
|
-
### Loader Functions
|
|
267
|
-
|
|
268
|
-
The package exports loader functions to prevent tree-shaking of the registered classes:
|
|
269
|
-
|
|
270
42
|
```typescript
|
|
271
|
-
import {
|
|
272
|
-
|
|
273
|
-
// Call these functions if you need to ensure the classes are registered
|
|
274
|
-
LoadVertexLLM();
|
|
275
|
-
LoadVertexEmbedding();
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
These functions are typically not needed in normal usage as importing the classes will automatically register them.
|
|
279
|
-
|
|
280
|
-
## Error Handling
|
|
281
|
-
|
|
282
|
-
The wrapper provides detailed error information:
|
|
283
|
-
|
|
284
|
-
```typescript
|
|
285
|
-
try {
|
|
286
|
-
const response = await vertexLLM.ChatCompletion(params);
|
|
287
|
-
if (!response.success) {
|
|
288
|
-
console.error('Error:', response.errorMessage);
|
|
289
|
-
console.error('Status:', response.statusText);
|
|
290
|
-
console.error('Exception:', response.exception);
|
|
291
|
-
}
|
|
292
|
-
} catch (error) {
|
|
293
|
-
console.error('Exception occurred:', error);
|
|
294
|
-
}
|
|
295
|
-
```
|
|
43
|
+
import { VertexLLM } from '@memberjunction/ai-vertex';
|
|
296
44
|
|
|
297
|
-
|
|
45
|
+
const llm = new VertexLLM('service-account-json');
|
|
298
46
|
|
|
299
|
-
|
|
47
|
+
const result = await llm.ChatCompletion({
|
|
48
|
+
model: 'gemini-2.5-pro',
|
|
49
|
+
messages: [
|
|
50
|
+
{ role: 'user', content: 'Explain cloud AI architecture.' }
|
|
51
|
+
],
|
|
52
|
+
temperature: 0.7
|
|
53
|
+
});
|
|
300
54
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
if (response.success) {
|
|
304
|
-
console.log('Prompt Tokens:', response.data.usage.promptTokens);
|
|
305
|
-
console.log('Completion Tokens:', response.data.usage.completionTokens);
|
|
306
|
-
console.log('Total Tokens:', response.data.usage.totalTokens);
|
|
55
|
+
if (result.success) {
|
|
56
|
+
console.log(result.data.choices[0].message.content);
|
|
307
57
|
}
|
|
308
58
|
```
|
|
309
59
|
|
|
310
|
-
##
|
|
311
|
-
|
|
312
|
-
### Setup Test Environment
|
|
60
|
+
## Configuration
|
|
313
61
|
|
|
314
|
-
|
|
315
|
-
# Set environment variables
|
|
316
|
-
export VERTEX_PROJECT_ID="your-project-id"
|
|
317
|
-
export VERTEX_SERVICE_ACCOUNT_KEY_PATH="/path/to/key.json"
|
|
318
|
-
export VERTEX_LOCATION="us-central1" # Optional
|
|
319
|
-
|
|
320
|
-
# Install dependencies
|
|
321
|
-
npm install
|
|
322
|
-
|
|
323
|
-
# Run tests
|
|
324
|
-
npm test
|
|
325
|
-
|
|
326
|
-
# Run tests in watch mode
|
|
327
|
-
npm run test:watch
|
|
62
|
+
The API key parameter accepts a JSON string containing GCP service account credentials. Additional settings for project and location are configured via `SetAdditionalSettings`:
|
|
328
63
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
See [CODE_REVIEW.md](CODE_REVIEW.md) for detailed testing information.
|
|
64
|
+
| Setting | Description |
|
|
65
|
+
|---------|-------------|
|
|
66
|
+
| `project` | GCP project ID |
|
|
67
|
+
| `location` | GCP region (e.g., `us-central1`) |
|
|
334
68
|
|
|
335
|
-
##
|
|
69
|
+
## How It Works
|
|
336
70
|
|
|
337
|
-
|
|
71
|
+
`VertexLLM` extends `GeminiLLM` and overrides the `createClient()` method to configure the `GoogleGenAI` client for Vertex AI instead of the public Gemini API. This provides GCP project-scoped access with service account authentication while inheriting all of GeminiLLM's capabilities.
|
|
338
72
|
|
|
339
|
-
|
|
340
|
-
2. **Multimodal Content**: Text-only support (images, audio, video not yet implemented)
|
|
341
|
-
3. **Thinking Support**: Gemini 2.5+ thinking/reasoning features not yet implemented
|
|
342
|
-
4. **Incomplete Parameters**: Some ChatParams (responseFormat, stopSequences, seed) not yet wired up
|
|
343
|
-
5. **System Messages**: Not using systemInstruction parameter (bundled in conversation instead)
|
|
344
|
-
6. **No Message Alternation**: May fail with consecutive same-role messages
|
|
73
|
+
## Class Registration
|
|
345
74
|
|
|
346
|
-
|
|
347
|
-
- ✅ Basic chat completion functionality with token usage tracking
|
|
348
|
-
- ✅ Streaming response support
|
|
349
|
-
- ✅ Comprehensive test suite
|
|
350
|
-
- ⚠️ Simulated embedding functionality (pending native SDK support)
|
|
351
|
-
|
|
352
|
-
Future implementations may include:
|
|
353
|
-
- 🚧 Thinking/reasoning support for Gemini 2.5+ models
|
|
354
|
-
- 🚧 Multimodal content (images, audio, video)
|
|
355
|
-
- 🚧 Complete parameter mapping
|
|
356
|
-
- 🚧 ADC authentication support
|
|
357
|
-
- 🚧 Native embedding functionality
|
|
358
|
-
- 🚧 `SummarizeText` functionality
|
|
359
|
-
- 🚧 `ClassifyText` functionality
|
|
75
|
+
Registered as `VertexLLM` via `@RegisterClass(BaseLLM, 'VertexLLM')`.
|
|
360
76
|
|
|
361
77
|
## Dependencies
|
|
362
78
|
|
|
363
|
-
- `@
|
|
364
|
-
- `@memberjunction/ai
|
|
365
|
-
- `@memberjunction/global
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
This package integrates seamlessly with the MemberJunction AI framework:
|
|
370
|
-
|
|
371
|
-
1. **Standardized Interface**: Implements the same interface as other AI providers in the MemberJunction ecosystem
|
|
372
|
-
2. **Provider Registration**: Classes are automatically registered using the `@RegisterClass` decorator
|
|
373
|
-
3. **Model Management**: Compatible with MemberJunction's AI model management system
|
|
374
|
-
4. **Token Tracking**: Integrates with MemberJunction's usage tracking and billing systems
|
|
375
|
-
|
|
376
|
-
### Using with MemberJunction AI Core
|
|
377
|
-
|
|
378
|
-
```typescript
|
|
379
|
-
import { GetAIAPIKey } from '@memberjunction/ai';
|
|
380
|
-
import { VertexLLM } from '@memberjunction/ai-vertex';
|
|
381
|
-
|
|
382
|
-
// Get API key from MemberJunction configuration
|
|
383
|
-
const apiKey = GetAIAPIKey('vertex');
|
|
384
|
-
const projectId = 'your-project-id';
|
|
385
|
-
|
|
386
|
-
// Create provider instance
|
|
387
|
-
const vertex = new VertexLLM(apiKey, projectId);
|
|
388
|
-
|
|
389
|
-
// Use with MemberJunction AI services
|
|
390
|
-
// The provider will be automatically available through the AI factory system
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
## Implementation Notes
|
|
394
|
-
|
|
395
|
-
### Authentication
|
|
396
|
-
The package expects the `apiKey` parameter to be a path to a Google Cloud service account key file, not an API key string. This file should contain the credentials for accessing Vertex AI services.
|
|
397
|
-
|
|
398
|
-
### Model Name Mapping
|
|
399
|
-
The package automatically handles different model types based on their name prefix:
|
|
400
|
-
- Models starting with `gemini-` are handled as Gemini models
|
|
401
|
-
- Models starting with `text-` are handled as text generation models
|
|
402
|
-
- Models starting with `code-` are handled as code generation models
|
|
403
|
-
|
|
404
|
-
### Message Role Mapping
|
|
405
|
-
The package maps MemberJunction message roles to Vertex AI format:
|
|
406
|
-
- `system` → `system`
|
|
407
|
-
- `assistant` → `model`
|
|
408
|
-
- `user` → `user`
|
|
409
|
-
|
|
410
|
-
## Building and Development
|
|
411
|
-
|
|
412
|
-
```bash
|
|
413
|
-
# Build the package
|
|
414
|
-
npm run build
|
|
415
|
-
|
|
416
|
-
# Watch mode for development
|
|
417
|
-
npm run watch
|
|
418
|
-
|
|
419
|
-
# Run type checking
|
|
420
|
-
tsc --noEmit
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
## License
|
|
424
|
-
|
|
425
|
-
See the [repository root](../../../LICENSE) for license information.
|
|
79
|
+
- `@memberjunction/ai` - Core AI abstractions
|
|
80
|
+
- `@memberjunction/ai-gemini` - Gemini provider (parent class)
|
|
81
|
+
- `@memberjunction/global` - Class registration
|
|
82
|
+
- `@google/genai` - Google GenAI SDK
|
|
83
|
+
- `google-auth-library` - Google Cloud authentication
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { EmbedTextParams, EmbedTextsParams, BaseEmbeddings, EmbedTextResult, EmbedTextsResult } from "@memberjunction/ai";
|
|
2
|
-
import { VertexAI } from '@google-cloud/vertexai';
|
|
3
|
-
export declare class VertexEmbedding extends BaseEmbeddings {
|
|
4
|
-
private _client;
|
|
5
|
-
private _projectId;
|
|
6
|
-
private _location;
|
|
7
|
-
constructor(apiKey: string, projectId: string, location?: string);
|
|
8
|
-
get Client(): VertexAI;
|
|
9
|
-
/**
|
|
10
|
-
* Embeds a single text using Google Vertex AI embedding models
|
|
11
|
-
*/
|
|
12
|
-
EmbedText(params: EmbedTextParams): Promise<EmbedTextResult>;
|
|
13
|
-
/**
|
|
14
|
-
* Embeds multiple texts using Google Vertex AI embedding models
|
|
15
|
-
*/
|
|
16
|
-
EmbedTexts(params: EmbedTextsParams): Promise<EmbedTextsResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Get available embedding models from Vertex AI
|
|
19
|
-
*/
|
|
20
|
-
GetEmbeddingModels(): Promise<any>;
|
|
21
|
-
}
|
|
22
|
-
export declare function LoadVertexEmbedding(): void;
|
|
23
|
-
//# sourceMappingURL=vertexEmbedding.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertexEmbedding.d.ts","sourceRoot":"","sources":["../../src/models/vertexEmbedding.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,cAAc,EAEd,eAAe,EACf,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,qBACa,eAAgB,SAAQ,cAAc;IACjD,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAsB;IAgB/E,IAAW,MAAM,IAAI,QAAQ,CAE5B;IAED;;OAEG;IACU,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA0DzE;;OAEG;IACU,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA4E5E;;OAEG;IACU,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC;CAahD;AAED,wBAAgB,mBAAmB,SAElC"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.LoadVertexEmbedding = exports.VertexEmbedding = void 0;
|
|
10
|
-
const ai_1 = require("@memberjunction/ai");
|
|
11
|
-
const global_1 = require("@memberjunction/global");
|
|
12
|
-
const vertexai_1 = require("@google-cloud/vertexai");
|
|
13
|
-
let VertexEmbedding = class VertexEmbedding extends ai_1.BaseEmbeddings {
|
|
14
|
-
constructor(apiKey, projectId, location = 'us-central1') {
|
|
15
|
-
super(apiKey);
|
|
16
|
-
this._projectId = projectId;
|
|
17
|
-
this._location = location;
|
|
18
|
-
// Initialize Google Vertex AI client
|
|
19
|
-
this._client = new vertexai_1.VertexAI({
|
|
20
|
-
project: this._projectId,
|
|
21
|
-
location: this._location,
|
|
22
|
-
apiEndpoint: `${this._location}-aiplatform.googleapis.com`,
|
|
23
|
-
googleAuthOptions: {
|
|
24
|
-
keyFile: apiKey // assumes apiKey is a path to a service account key file
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
get Client() {
|
|
29
|
-
return this._client;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Embeds a single text using Google Vertex AI embedding models
|
|
33
|
-
*/
|
|
34
|
-
async EmbedText(params) {
|
|
35
|
-
try {
|
|
36
|
-
// The model should be specified like "textembedding-gecko", "textembedding-gecko-multilingual"
|
|
37
|
-
const modelName = params.model || 'textembedding-gecko';
|
|
38
|
-
// Get the embedding model - Vertex API doesn't have a dedicated embedding method yet
|
|
39
|
-
// For now, we'll simulate embeddings through the generative model
|
|
40
|
-
const generativeModel = this._client.getGenerativeModel({
|
|
41
|
-
model: modelName
|
|
42
|
-
});
|
|
43
|
-
// Prepare request parameters
|
|
44
|
-
const requestParams = {
|
|
45
|
-
taskType: 'RETRIEVAL_QUERY', // or 'RETRIEVAL_DOCUMENT' or 'SEMANTIC_SIMILARITY'
|
|
46
|
-
};
|
|
47
|
-
// For demonstration purposes only - in a real implementation, we would need
|
|
48
|
-
// to use the actual Vertex AI embedding endpoint when available
|
|
49
|
-
// For now, we'll simulate with a fake embedding vector
|
|
50
|
-
const embeddingSize = 768; // Common embedding size
|
|
51
|
-
const mockEmbedding = Array(embeddingSize).fill(0).map(() => Math.random() - 0.5);
|
|
52
|
-
// Simulated response
|
|
53
|
-
const response = {
|
|
54
|
-
embeddings: [{ values: mockEmbedding }],
|
|
55
|
-
totalTokenCount: params.text.length / 4 // Rough estimate
|
|
56
|
-
};
|
|
57
|
-
const embeddings = response.embeddings;
|
|
58
|
-
if (embeddings && embeddings.length > 0 && embeddings[0].values) {
|
|
59
|
-
// Extract token count if available
|
|
60
|
-
const tokensUsed = response.totalTokenCount || 0;
|
|
61
|
-
return {
|
|
62
|
-
object: "object",
|
|
63
|
-
model: modelName,
|
|
64
|
-
ModelUsage: new ai_1.ModelUsage(tokensUsed, 0),
|
|
65
|
-
vector: embeddings[0].values
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
throw new Error('No embeddings returned from Vertex AI');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
// Log error details for debugging
|
|
74
|
-
const errorInfo = ai_1.ErrorAnalyzer.analyzeError(error, 'Vertex');
|
|
75
|
-
console.error('Vertex embedding error:', errorInfo);
|
|
76
|
-
// Return error result
|
|
77
|
-
return {
|
|
78
|
-
object: "object",
|
|
79
|
-
model: params.model || 'textembedding-gecko',
|
|
80
|
-
ModelUsage: new ai_1.ModelUsage(0, 0),
|
|
81
|
-
vector: []
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Embeds multiple texts using Google Vertex AI embedding models
|
|
87
|
-
*/
|
|
88
|
-
async EmbedTexts(params) {
|
|
89
|
-
try {
|
|
90
|
-
// The model should be specified like "textembedding-gecko", "textembedding-gecko-multilingual"
|
|
91
|
-
const modelName = params.model || 'textembedding-gecko';
|
|
92
|
-
// Get the embedding model - Vertex API doesn't have a dedicated embedding method yet
|
|
93
|
-
// For now, we'll simulate embeddings through the generative model
|
|
94
|
-
const generativeModel = this._client.getGenerativeModel({
|
|
95
|
-
model: modelName
|
|
96
|
-
});
|
|
97
|
-
// Prepare request parameters
|
|
98
|
-
const requestParams = {
|
|
99
|
-
taskType: 'RETRIEVAL_DOCUMENT', // or 'RETRIEVAL_QUERY' or 'SEMANTIC_SIMILARITY'
|
|
100
|
-
};
|
|
101
|
-
// Process texts in batches (Vertex AI may have limits on batch size)
|
|
102
|
-
const batchSize = 5; // Adjust based on Vertex AI limitations
|
|
103
|
-
const vectors = [];
|
|
104
|
-
let totalTokens = 0;
|
|
105
|
-
for (let i = 0; i < params.texts.length; i += batchSize) {
|
|
106
|
-
const batch = params.texts.slice(i, i + batchSize);
|
|
107
|
-
// Create batch request
|
|
108
|
-
const batchRequests = batch.map(text => ({
|
|
109
|
-
content: { text }
|
|
110
|
-
}));
|
|
111
|
-
// For demonstration purposes only - in a real implementation, we would need
|
|
112
|
-
// to use the actual Vertex AI embedding endpoint when available
|
|
113
|
-
// For now, we'll simulate with fake embedding vectors
|
|
114
|
-
const embeddingSize = 768; // Common embedding size
|
|
115
|
-
// Simulated batch response
|
|
116
|
-
const batchResponse = {
|
|
117
|
-
embeddings: batch.map(() => ({
|
|
118
|
-
values: Array(embeddingSize).fill(0).map(() => Math.random() - 0.5)
|
|
119
|
-
})),
|
|
120
|
-
totalTokenCount: batch.reduce((sum, text) => sum + text.length / 4, 0) // Rough estimate
|
|
121
|
-
};
|
|
122
|
-
if (batchResponse && batchResponse.embeddings) {
|
|
123
|
-
// Extract embeddings
|
|
124
|
-
for (const embedding of batchResponse.embeddings) {
|
|
125
|
-
if (embedding.values) {
|
|
126
|
-
vectors.push(embedding.values);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// Add to token count
|
|
130
|
-
totalTokens += batchResponse.totalTokenCount || 0;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
object: "list",
|
|
135
|
-
model: modelName,
|
|
136
|
-
ModelUsage: new ai_1.ModelUsage(totalTokens, 0),
|
|
137
|
-
vectors: vectors
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
// Log error details for debugging
|
|
142
|
-
const errorInfo = ai_1.ErrorAnalyzer.analyzeError(error, 'Vertex');
|
|
143
|
-
console.error('Vertex embedding error:', errorInfo);
|
|
144
|
-
// Return error result
|
|
145
|
-
return {
|
|
146
|
-
object: "list",
|
|
147
|
-
model: params.model || 'textembedding-gecko',
|
|
148
|
-
ModelUsage: new ai_1.ModelUsage(0, 0),
|
|
149
|
-
vectors: []
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Get available embedding models from Vertex AI
|
|
155
|
-
*/
|
|
156
|
-
async GetEmbeddingModels() {
|
|
157
|
-
try {
|
|
158
|
-
// In practice, you would list models from Vertex AI and filter for embedding models
|
|
159
|
-
// This is a simplified implementation
|
|
160
|
-
return [
|
|
161
|
-
"textembedding-gecko",
|
|
162
|
-
"textembedding-gecko-multilingual"
|
|
163
|
-
];
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
console.error('Error listing Vertex embedding models:', ai_1.ErrorAnalyzer.analyzeError(error, 'Vertex'));
|
|
167
|
-
return [];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
exports.VertexEmbedding = VertexEmbedding;
|
|
172
|
-
exports.VertexEmbedding = VertexEmbedding = __decorate([
|
|
173
|
-
(0, global_1.RegisterClass)(ai_1.BaseEmbeddings, 'VertexEmbedding')
|
|
174
|
-
], VertexEmbedding);
|
|
175
|
-
function LoadVertexEmbedding() {
|
|
176
|
-
// this does nothing but prevents the class from being removed by the tree shaker
|
|
177
|
-
}
|
|
178
|
-
exports.LoadVertexEmbedding = LoadVertexEmbedding;
|
|
179
|
-
//# sourceMappingURL=vertexEmbedding.js.map
|
|
@@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