Skip to content

Commit cc322a9

Browse files
authored
Rename endpoint -> endpointId (to match Google docs) (#155)
1 parent cf91c29 commit cc322a9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/ax/ai/google-gemini/api.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export interface AxAIGoogleGeminiArgs {
8787
apiKey?: string
8888
projectId?: string
8989
region?: string
90-
endpoint?: string
90+
endpointId?: string
9191
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>
9292
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>
9393
models?: AxAIModelList<AxAIGoogleGeminiModel>
@@ -108,7 +108,7 @@ class AxAIGoogleGeminiImpl
108108
constructor(
109109
private config: AxAIGoogleGeminiConfig,
110110
private isVertex: boolean,
111-
private endpoint?: string,
111+
private endpointId?: string,
112112
private apiKey?: string,
113113
private options?: AxAIGoogleGeminiArgs['options']
114114
) {}
@@ -140,11 +140,11 @@ class AxAIGoogleGeminiImpl
140140
}
141141

142142
let apiConfig
143-
if (this.endpoint) {
143+
if (this.endpointId) {
144144
apiConfig = {
145145
name: stream
146-
? `/${this.endpoint}:streamGenerateContent?alt=sse`
147-
: `/${this.endpoint}:generateContent`,
146+
? `/${this.endpointId}:streamGenerateContent?alt=sse`
147+
: `/${this.endpointId}:generateContent`,
148148
}
149149
} else {
150150
apiConfig = {
@@ -366,9 +366,9 @@ class AxAIGoogleGeminiImpl
366366
| AxAIGoogleVertexBatchEmbedRequest
367367

368368
if (this.isVertex) {
369-
if (this.endpoint) {
369+
if (this.endpointId) {
370370
apiConfig = {
371-
name: `/${this.endpoint}:predict`,
371+
name: `/${this.endpointId}:predict`,
372372
}
373373
} else {
374374
apiConfig = {
@@ -503,7 +503,7 @@ export class AxAIGoogleGemini extends AxBaseAI<
503503
apiKey,
504504
projectId,
505505
region,
506-
endpoint,
506+
endpointId,
507507
config,
508508
options,
509509
models,
@@ -515,7 +515,7 @@ export class AxAIGoogleGemini extends AxBaseAI<
515515

516516
if (isVertex) {
517517
let path
518-
if (endpoint) {
518+
if (endpointId) {
519519
path = 'endpoints'
520520
} else {
521521
path = 'publishers/google'
@@ -546,7 +546,7 @@ export class AxAIGoogleGemini extends AxBaseAI<
546546
const aiImpl = new AxAIGoogleGeminiImpl(
547547
_config,
548548
isVertex,
549-
endpoint,
549+
endpointId,
550550
apiKey,
551551
options
552552
)

0 commit comments

Comments
 (0)