Memperbarui @firebase/ai dari 2.x ke 3.x
Perbandingan API publik @firebase/ai 2.16.0 dan 3.0.0, dihitung otomatis dari tipe TypeScript-nya. Tanda tangan yang berubah adalah kemungkinan perubahan tidak kompatibel, bukan kepastian.
Ringkasan
| Jalur impor yang dihapus | 0 |
|---|---|
| Ekspor yang dihapus | 2 |
| Tanda tangan yang berubah | 3 |
| Anggota kelas atau antarmuka yang dihapus | 53 |
| Anggota kelas atau antarmuka yang berubah | 8 |
| Baru ditandai usang | 11 |
| Perubahan persyaratan (engines, dependensi peer) | 1 |
| Ekspor baru | 1 |
Ekspor yang dihapus
| import | export | kind | Sebelum |
|---|---|---|---|
@firebase/ai | ChatSessionBase | class | class |
@firebase/ai | VertexAIBackend | class | class |
Tanda tangan yang berubah
| export | Sebelum | Sesudah |
|---|---|---|
@firebase/ai · Tool | FunctionDeclarationsTool | CodeExecutionTool | GoogleMapsTool | GoogleSearchTool | URLContextTool | CodeExecutionTool | FunctionDeclarationsTool | GoogleMapsTool | GoogleSearchTool | URLContextTool |
@firebase/ai · BackendType | "AGENT_PLATFORM" | "VERTEX_AI" | "GOOGLE_AI" | "AGENT_PLATFORM" | "GOOGLE_AI" |
@firebase/ai · ChatSession | class | interface |
Anggota kelas atau antarmuka yang dihapus
| member | import | Sebelum |
|---|---|---|
AI.location | @firebase/ai | string |
TextPart.inlineData | @firebase/ai | undefined |
TextPart.functionCall | @firebase/ai | undefined |
TextPart.executableCode | @firebase/ai | undefined |
TextPart.functionResponse | @firebase/ai | undefined |
TextPart.codeExecutionResult | @firebase/ai | undefined |
GoogleMaps.enableWidget | @firebase/ai | boolean | undefined |
ChatSession._history | @firebase/ai | Content[] |
ChatSession._apiSettings | @firebase/ai | ApiSettings |
ChatSession.chromeAdapter | @firebase/ai | any |
LiveSession.sendMediaChunks | @firebase/ai | (mediaChunks: GenerativeContentBlob[]): Promise<void> |
LiveSession.sendMediaStream | @firebase/ai | (mediaChunkStream: ReadableStream<GenerativeContentBlob>): Promise<void> |
FileDataPart.text | @firebase/ai | undefined |
FileDataPart.inlineData | @firebase/ai | undefined |
FileDataPart.functionCall | @firebase/ai | undefined |
FileDataPart.executableCode | @firebase/ai | undefined |
FileDataPart.functionResponse | @firebase/ai | undefined |
FileDataPart.codeExecutionResult | @firebase/ai | undefined |
InlineDataPart.text | @firebase/ai | undefined |
InlineDataPart.functionCall | @firebase/ai | undefined |
InlineDataPart.executableCode | @firebase/ai | undefined |
InlineDataPart.functionResponse | @firebase/ai | undefined |
InlineDataPart.codeExecutionResult | @firebase/ai | undefined |
FunctionCallPart.text | @firebase/ai | undefined |
FunctionCallPart.inlineData | @firebase/ai | undefined |
FunctionCallPart.executableCode | @firebase/ai | undefined |
FunctionCallPart.functionResponse | @firebase/ai | undefined |
FunctionCallPart.codeExecutionResult | @firebase/ai | undefined |
GroundingMetadata.retrievalQueries | @firebase/ai | string[] | undefined |
ExecutableCodePart.text | @firebase/ai | undefined |
ExecutableCodePart.thought | @firebase/ai | undefined |
ExecutableCodePart.fileData | @firebase/ai | never |
ExecutableCodePart.inlineData | @firebase/ai | undefined |
ExecutableCodePart.functionCall | @firebase/ai | undefined |
ExecutableCodePart.functionResponse | @firebase/ai | undefined |
ExecutableCodePart.codeExecutionResult | @firebase/ai | undefined |
CountTokensResponse.totalBillableCharacters | @firebase/ai | number | undefined |
FunctionResponsePart.text | @firebase/ai | undefined |
FunctionResponsePart.inlineData | @firebase/ai | undefined |
FunctionResponsePart.functionCall | @firebase/ai | undefined |
FunctionResponsePart.executableCode | @firebase/ai | undefined |
FunctionResponsePart.codeExecutionResult | @firebase/ai | undefined |
CodeExecutionResultPart.text | @firebase/ai | undefined |
CodeExecutionResultPart.thought | @firebase/ai | undefined |
CodeExecutionResultPart.fileData | @firebase/ai | never |
CodeExecutionResultPart.inlineData | @firebase/ai | undefined |
CodeExecutionResultPart.functionCall | @firebase/ai | undefined |
CodeExecutionResultPart.executableCode | @firebase/ai | undefined |
CodeExecutionResultPart.functionResponse | @firebase/ai | undefined |
LanguageModelCreateOptions.topK | @firebase/ai | number | undefined |
LanguageModelCreateOptions.temperature | @firebase/ai | number | undefined |
LanguageModelCreateCoreOptions.topK | @firebase/ai | number | undefined |
LanguageModelCreateCoreOptions.temperature | @firebase/ai | number | undefined |
Anggota kelas atau antarmuka yang berubah
| member | Sebelum | Sesudah |
|---|---|---|
ChatSession.constructor | (apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined): ChatSession | |
GenerativeModel.generateContent | (request: string | GenerateContentRequest | (string | Part)[], singleRequestOptions?: SingleRequestOptions | undefined): Promise<GenerateContentResult> | (request: string | (string | Part)[] | GenerateContentRequest, singleRequestOptions?: SingleRequestOptions | undefined): Promise<GenerateContentResult> |
GenerativeModel.generateContentStream | (request: string | GenerateContentRequest | (string | Part)[], singleRequestOptions?: SingleRequestOptions | undefined): Promise<GenerateContentStreamResult> | (request: string | (string | Part)[] | GenerateContentRequest, singleRequestOptions?: SingleRequestOptions | undefined): Promise<GenerateContentStreamResult> |
ExecutableCodePart.executableCode | ExecutableCode | undefined | ExecutableCode |
CodeExecutionResultPart.codeExecutionResult | CodeExecutionResult | undefined | CodeExecutionResult |
StartTemplateChatParams.templateVariables | Record<string, unknown> | undefined | Record<string, unknown> |
TemplateGenerativeModel.generateContent | (templateId: string, templateVariables: Record<string, unknown>, singleRequestOptions?: SingleRequestOptions | undefined, templateToolConfig?: TemplateToolConfig | undefined): Promise<GenerateContentResult> | (request: TemplateRequest, singleRequestOptions?: SingleRequestOptions | undefined): Promise<GenerateContentResult> |
TemplateGenerativeModel.generateContentStream | (templateId: string, templateVariables: Record<string, unknown>, singleRequestOptions?: SingleRequestOptions | undefined, templateToolConfig?: TemplateToolConfig | undefined): Promise<GenerateContentStreamResult> | (request: TemplateRequest, singleRequestOptions?: SingleRequestOptions | undefined): Promise<GenerateContentStreamResult> |
Baru ditandai usang
| export | @deprecated |
|---|---|
@firebase/ai · GenerationConfig.topK | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically. |
@firebase/ai · GenerationConfig.topP | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically. |
@firebase/ai · GenerationConfig.temperature | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically. |
@firebase/ai · GenerationConfig.candidateCount | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Make parallel requests instead. |
@firebase/ai · GenerationConfig.presencePenalty | Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter. |
@firebase/ai · GenerationConfig.frequencyPenalty | Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter. |
@firebase/ai · LiveGenerationConfig.topK | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically. |
@firebase/ai · LiveGenerationConfig.topP | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically. |
@firebase/ai · LiveGenerationConfig.temperature | Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically. |
@firebase/ai · LiveGenerationConfig.presencePenalty | Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter. |
@firebase/ai · LiveGenerationConfig.frequencyPenalty | Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter. |
Perubahan persyaratan (engines, dependensi peer)
| Sebelum | Sesudah | |
|---|---|---|
engines.node | >=20.0.0 | >=24.12.0 |
Ekspor baru (1)
| import | export | kind |
|---|---|---|
@firebase/ai | TemplateRequest | interface |
Berikan fakta ini ke agen AI Anda
Vigia adalah server MCP gratis: agen coding Anda memeriksa versi, perubahan yang merusak kompatibilitas, dan kerentanan sebelum menulis kode. Tanpa pendaftaran, tanpa kunci API.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Tambahkan ke CursorTambahkan ke VS Code★ Bintang di GitHub
Klien MCP lainnya
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }Skill agen (SKILL.md): memberi tahu agen kapan memakai Vigia · GitHub Action untuk pull request
Pertanyaan umum
Apa saja perubahan tidak kompatibel saat memperbarui @firebase/ai dari 2 ke 3?
Antara @firebase/ai 2.16.0 dan 3.0.0, Vigia menemukan 2 ekspor yang dihapus, 3 tanda tangan yang berubah, dan 61 anggota kelas atau antarmuka yang dihapus atau berubah.
Apa yang ditandai usang di @firebase/ai 3?
11 ekspor atau anggota baru ditandai usang di @firebase/ai 3.0.0.
Untuk agen
GET https://vigia.coredls.cloud/v1/packages/npm/@firebase/ai/upgrade?from=2.16.0&to=3.0.0