File tree 5 files changed +8
-8
lines changed
5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export async function countTokens(
36
36
location : string ,
37
37
project : string ,
38
38
publisherModelEndpoint : string ,
39
- token : Promise < any > ,
39
+ token : Promise < string | null | undefined > ,
40
40
request : CountTokensRequest ,
41
41
apiEndpoint ?: string ,
42
42
requestOptions ?: RequestOptions
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export async function generateContent(
49
49
location : string ,
50
50
project : string ,
51
51
publisherModelEndpoint : string ,
52
- token : Promise < any > ,
52
+ token : Promise < string | null | undefined > ,
53
53
request : GenerateContentRequest | string ,
54
54
apiEndpoint ?: string ,
55
55
generationConfig ?: GenerationConfig ,
@@ -102,7 +102,7 @@ export async function generateContentStream(
102
102
location : string ,
103
103
project : string ,
104
104
publisherModelEndpoint : string ,
105
- token : Promise < any > ,
105
+ token : Promise < string | null | undefined > ,
106
106
request : GenerateContentRequest | string ,
107
107
apiEndpoint ?: string ,
108
108
generationConfig ?: GenerationConfig ,
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export async function postRequest({
43
43
project : string ;
44
44
resourcePath : string ;
45
45
resourceMethod : string ;
46
- token : string ;
46
+ token : string | null | undefined ;
47
47
data : GenerateContentRequest | CountTokensRequest ;
48
48
apiEndpoint ?: string ;
49
49
requestOptions ?: RequestOptions ;
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ export class ChatSession {
90
90
* fails.
91
91
* @returns Promise of token.
92
92
*/
93
- get token ( ) : Promise < any > {
93
+ get token ( ) : Promise < string | null | undefined > {
94
94
const tokenPromise = this . googleAuth . getAccessToken ( ) . catch ( e => {
95
95
throw new GoogleAuthError ( constants . CREDENTIAL_ERROR_MESSAGE , e ) ;
96
96
} ) ;
@@ -309,7 +309,7 @@ export class ChatSessionPreview {
309
309
* Gets access token from GoogleAuth. Throws GoogleAuthError when fails.
310
310
* @returns Promise of token.
311
311
*/
312
- get token ( ) : Promise < any > {
312
+ get token ( ) : Promise < string | null | undefined > {
313
313
const tokenPromise = this . googleAuth . getAccessToken ( ) . catch ( e => {
314
314
throw new GoogleAuthError ( constants . CREDENTIAL_ERROR_MESSAGE , e ) ;
315
315
} ) ;
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ export class GenerativeModel {
85
85
* fails.
86
86
* @returns Promise of token
87
87
*/
88
- get token ( ) : Promise < any > {
88
+ get token ( ) : Promise < string | null | undefined > {
89
89
const tokenPromise = this . googleAuth . getAccessToken ( ) . catch ( e => {
90
90
throw new GoogleAuthError ( constants . CREDENTIAL_ERROR_MESSAGE , e ) ;
91
91
} ) ;
@@ -285,7 +285,7 @@ export class GenerativeModelPreview {
285
285
* Gets access token from GoogleAuth. Throws GoogleAuthError when fails.
286
286
* @returns Promise of token.
287
287
*/
288
- get token ( ) : Promise < any > {
288
+ get token ( ) : Promise < string | null | undefined > {
289
289
const tokenPromise = this . googleAuth . getAccessToken ( ) . catch ( e => {
290
290
throw new GoogleAuthError ( constants . CREDENTIAL_ERROR_MESSAGE , e ) ;
291
291
} ) ;
You can’t perform that action at this time.
0 commit comments