Skip to content

Commit 160dbc3

Browse files
chore: clean up from PR cherry pick
1 parent 3fea8ae commit 160dbc3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

packages/ai/__tests__/count-tokens.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { countTokens } from '../lib/methods/count-tokens';
2121
import { CountTokensRequest, RequestOptions } from '../lib/types';
2222
import { ApiSettings } from '../lib/types/internal';
2323
import { Task } from '../lib/requests/request';
24-
import { GoogleAIBackend, VertexAIBackend } from '../lib/backend';
24+
import { GoogleAIBackend } from '../lib/backend';
2525
import { SpiedFunction } from 'jest-mock';
2626
import { mapCountTokensRequest } from '../lib/googleai-mappers';
2727

@@ -30,7 +30,7 @@ const fakeApiSettings: ApiSettings = {
3030
project: 'my-project',
3131
location: 'us-central1',
3232
appId: '',
33-
backend: new VertexAIBackend(),
33+
backend: new GoogleAIBackend(),
3434
};
3535

3636
const fakeGoogleAIApiSettings: ApiSettings = {

packages/ai/lib/requests/request.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export async function makeRequest(
210210
}
211211
if (
212212
response.status === 403 &&
213+
errorDetails &&
213214
errorDetails.some((detail: ErrorDetails) => detail.reason === 'SERVICE_DISABLED') &&
214215
errorDetails.some((detail: ErrorDetails) =>
215216
(detail.links as Array<Record<string, string>>)?.[0]?.description?.includes(

tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@react-native-community/cli": "15.1.3",
1313
"@react-native-community/cli-platform-android": "15.1.3",
1414
"@react-native-community/cli-platform-ios": "15.1.3",
15-
"@react-native-firebase/ai": "file:../packages/ai",
15+
"@react-native-firebase/ai": "23.2.1",
1616
"@react-native-firebase/analytics": "23.2.1",
1717
"@react-native-firebase/app": "23.2.1",
1818
"@react-native-firebase/app-check": "23.2.1",

0 commit comments

Comments
 (0)