|
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | 17 |
|
18 | | -import { FirebaseApp } from '@firebase/app'; |
19 | | -import { Backend } from './backend'; |
20 | | - |
21 | | -export * from './types'; |
22 | | - |
23 | | -/** |
24 | | - * An instance of the Firebase AI SDK. |
25 | | - * |
26 | | - * For more information, refer to the documentation for the new {@link AI} interface. |
27 | | - * |
28 | | - * @public |
29 | | - */ |
30 | | -export type VertexAI = AI; |
31 | | - |
32 | | -/** |
33 | | - * Options when initializing the Firebase AI SDK. |
34 | | - * |
35 | | - * @public |
36 | | - */ |
37 | | -export interface VertexAIOptions { |
38 | | - location?: string; |
39 | | -} |
40 | | - |
41 | | -/** |
42 | | - * An instance of the Firebase AI SDK. |
43 | | - * |
44 | | - * Do not create this instance directly. Instead, use {@link getAI | getAI()}. |
45 | | - * |
46 | | - * @public |
47 | | - */ |
48 | | -export interface AI { |
49 | | - /** |
50 | | - * The {@link @firebase/app#FirebaseApp} this {@link AI} instance is associated with. |
51 | | - */ |
52 | | - app: FirebaseApp; |
53 | | - /** |
54 | | - * A {@link Backend} instance that specifies the configuration for the target backend, |
55 | | - * either the Gemini Developer API (using {@link GoogleAIBackend}) or the |
56 | | - * Vertex AI Gemini API (using {@link VertexAIBackend}). |
57 | | - */ |
58 | | - backend: Backend; |
59 | | - /** |
60 | | - * The location configured for this AI service instance, relevant for Vertex AI backends. |
61 | | - * |
62 | | - * @deprecated use `AI.backend.location` instead. |
63 | | - */ |
64 | | - location: string; |
65 | | -} |
66 | | - |
67 | | -/** |
68 | | - * An enum-like object containing constants that represent the supported backends |
69 | | - * for the Firebase AI SDK. |
70 | | - * This determines which backend service (Vertex AI Gemini API or Gemini Developer API) |
71 | | - * the SDK will communicate with. |
72 | | - * |
73 | | - * These values are assigned to the `backendType` property within the specific backend |
74 | | - * configuration objects ({@link GoogleAIBackend} or {@link VertexAIBackend}) to identify |
75 | | - * which service to target. |
76 | | - * |
77 | | - * @public |
78 | | - */ |
79 | | -export const BackendType = { |
80 | | - /** |
81 | | - * Identifies the backend service for the Vertex AI Gemini API provided through Google Cloud. |
82 | | - * Use this constant when creating a {@link VertexAIBackend} configuration. |
83 | | - */ |
84 | | - VERTEX_AI: 'VERTEX_AI', |
85 | | - |
86 | | - /** |
87 | | - * Identifies the backend service for the Gemini Developer API (via Google AI). |
88 | | - * Use this constant when creating a {@link GoogleAIBackend} configuration. |
89 | | - */ |
90 | | - GOOGLE_AI: 'GOOGLE_AI' |
91 | | -} as const; // Using 'as const' makes the string values literal types |
92 | | - |
93 | | -/** |
94 | | - * Type alias representing valid backend types. |
95 | | - * It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`. |
96 | | - * |
97 | | - * @public |
98 | | - */ |
99 | | -export type BackendType = (typeof BackendType)[keyof typeof BackendType]; |
100 | | - |
101 | | -/** |
102 | | - * Options for initializing the AI service using {@link getAI | getAI()}. |
103 | | - * This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) |
104 | | - * and configuring its specific options (like location for Vertex AI). |
105 | | - * |
106 | | - * @public |
107 | | - */ |
108 | | -export interface AIOptions { |
109 | | - /** |
110 | | - * The backend configuration to use for the AI service instance. |
111 | | - */ |
112 | | - backend: Backend; |
113 | | -} |
| 18 | +export * from '@firebase/ai'; |
0 commit comments