diff --git a/.changeset/olive-points-fold.md b/.changeset/olive-points-fold.md new file mode 100644 index 00000000000..eb58ac3f922 --- /dev/null +++ b/.changeset/olive-points-fold.md @@ -0,0 +1,7 @@ +--- +'firebase': minor +'@firebase/vertexai-preview': patch +'@firebase/app': patch +--- + +Add the preview version of the VertexAI SDK. diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index c60302c1eac..a1dfc08d847 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -77,6 +77,7 @@ jobs: NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index ed524abd4ad..6dcedb0b04a 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -87,6 +87,7 @@ jobs: NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 699113effa6..32eca1f036d 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -113,6 +113,7 @@ jobs: NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} + NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/common/api-review/vertexai-preview.api.md b/common/api-review/vertexai-preview.api.md new file mode 100644 index 00000000000..0e1029bd715 --- /dev/null +++ b/common/api-review/vertexai-preview.api.md @@ -0,0 +1,584 @@ +## API Report File for "@firebase/vertexai-preview" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { FirebaseApp } from '@firebase/app'; + +// @public +export interface BaseParams { + // (undocumented) + generationConfig?: GenerationConfig; + // (undocumented) + safetySettings?: SafetySetting[]; +} + +// @public +export enum BlockReason { + // (undocumented) + BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED", + // (undocumented) + OTHER = "OTHER", + // (undocumented) + SAFETY = "SAFETY" +} + +// @public +export class ChatSession { + // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts + constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); + getHistory(): Promise; + // (undocumented) + model: string; + // (undocumented) + params?: StartChatParams | undefined; + // (undocumented) + requestOptions?: RequestOptions | undefined; + sendMessage(request: string | Array): Promise; + sendMessageStream(request: string | Array): Promise; + } + +// @public +export interface Citation { + // (undocumented) + endIndex?: number; + // (undocumented) + license?: string; + // (undocumented) + publicationDate?: Date_2; + // (undocumented) + startIndex?: number; + // (undocumented) + title?: string; + // (undocumented) + uri?: string; +} + +// @public +export interface CitationMetadata { + // (undocumented) + citations: Citation[]; +} + +// @public +export interface Content { + // (undocumented) + parts: Part[]; + // (undocumented) + role: Role; +} + +// @public +export interface CountTokensRequest { + // (undocumented) + contents: Content[]; +} + +// @public +export interface CountTokensResponse { + totalBillableCharacters?: number; + totalTokens: number; +} + +// @public +interface Date_2 { + // (undocumented) + day: number; + // (undocumented) + month: number; + // (undocumented) + year: number; +} + +export { Date_2 as Date } + +// @public +export interface EnhancedGenerateContentResponse extends GenerateContentResponse { + // (undocumented) + functionCalls: () => FunctionCall[] | undefined; + text: () => string; +} + +// @public +export enum FinishReason { + // (undocumented) + FINISH_REASON_UNSPECIFIED = "FINISH_REASON_UNSPECIFIED", + // (undocumented) + MAX_TOKENS = "MAX_TOKENS", + // (undocumented) + OTHER = "OTHER", + // (undocumented) + RECITATION = "RECITATION", + // (undocumented) + SAFETY = "SAFETY", + // (undocumented) + STOP = "STOP" +} + +// @public +export interface FunctionCall { + // (undocumented) + args: object; + // (undocumented) + name: string; +} + +// @public (undocumented) +export interface FunctionCallingConfig { + // (undocumented) + allowedFunctionNames?: string[]; + // (undocumented) + mode?: FunctionCallingMode; +} + +// @public (undocumented) +export enum FunctionCallingMode { + // (undocumented) + ANY = "ANY", + // (undocumented) + AUTO = "AUTO", + // (undocumented) + MODE_UNSPECIFIED = "MODE_UNSPECIFIED", + // (undocumented) + NONE = "NONE" +} + +// @public +export interface FunctionCallPart { + // (undocumented) + functionCall: FunctionCall; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; +} + +// @public +export interface FunctionDeclaration { + description?: string; + name: string; + parameters?: FunctionDeclarationSchema; +} + +// @public +export interface FunctionDeclarationSchema { + description?: string; + properties: { + [k: string]: FunctionDeclarationSchemaProperty; + }; + required?: string[]; + type: FunctionDeclarationSchemaType; +} + +// @public +export interface FunctionDeclarationSchemaProperty { + description?: string; + enum?: string[]; + example?: unknown; + format?: string; + items?: FunctionDeclarationSchema; + nullable?: boolean; + properties?: { + [k: string]: FunctionDeclarationSchema; + }; + required?: string[]; + type?: FunctionDeclarationSchemaType; +} + +// @public +export enum FunctionDeclarationSchemaType { + ARRAY = "ARRAY", + BOOLEAN = "BOOLEAN", + INTEGER = "INTEGER", + NUMBER = "NUMBER", + OBJECT = "OBJECT", + STRING = "STRING" +} + +// @public +export interface FunctionDeclarationsTool { + functionDeclarations?: FunctionDeclaration[]; +} + +// @public +export interface FunctionResponse { + // (undocumented) + name: string; + // (undocumented) + response: object; +} + +// @public +export interface FunctionResponsePart { + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse: FunctionResponse; + // (undocumented) + inlineData?: never; + // (undocumented) + text?: never; +} + +// @public +export interface GenerateContentCandidate { + // (undocumented) + citationMetadata?: CitationMetadata; + // (undocumented) + content: Content; + // (undocumented) + finishMessage?: string; + // (undocumented) + finishReason?: FinishReason; + // (undocumented) + groundingMetadata?: GroundingMetadata; + // (undocumented) + index: number; + // (undocumented) + safetyRatings?: SafetyRating[]; +} + +// @public +export interface GenerateContentRequest extends BaseParams { + // (undocumented) + contents: Content[]; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export interface GenerateContentResponse { + // (undocumented) + candidates?: GenerateContentCandidate[]; + // (undocumented) + promptFeedback?: PromptFeedback; + // (undocumented) + usageMetadata?: UsageMetadata; +} + +// @public +export interface GenerateContentResult { + // (undocumented) + response: EnhancedGenerateContentResponse; +} + +// @public +export interface GenerateContentStreamResult { + // (undocumented) + response: Promise; + // (undocumented) + stream: AsyncGenerator; +} + +// @public +export interface GenerationConfig { + // (undocumented) + candidateCount?: number; + // (undocumented) + frequencyPenalty?: number; + // (undocumented) + maxOutputTokens?: number; + // (undocumented) + presencePenalty?: number; + // (undocumented) + stopSequences?: string[]; + // (undocumented) + temperature?: number; + // (undocumented) + topK?: number; + // (undocumented) + topP?: number; +} + +// @public +export interface GenerativeContentBlob { + data: string; + // (undocumented) + mimeType: string; +} + +// @public +export class GenerativeModel { + constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); + countTokens(request: CountTokensRequest | string | Array): Promise; + generateContent(request: GenerateContentRequest | string | Array): Promise; + generateContentStream(request: GenerateContentRequest | string | Array): Promise; + // (undocumented) + generationConfig: GenerationConfig; + // (undocumented) + model: string; + // (undocumented) + requestOptions?: RequestOptions; + // (undocumented) + safetySettings: SafetySetting[]; + startChat(startChatParams?: StartChatParams): ChatSession; + // (undocumented) + systemInstruction?: Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; + +// @public +export function getVertexAI(app?: FirebaseApp): VertexAI; + +// @public (undocumented) +export interface GroundingAttribution { + // (undocumented) + confidenceScore?: number; + // (undocumented) + retrievedContext?: RetrievedContextAttribution; + // (undocumented) + segment: Segment; + // (undocumented) + web?: WebAttribution; +} + +// @public +export interface GroundingMetadata { + // (undocumented) + groundingAttributions: GroundingAttribution[]; + // (undocumented) + retrievalQueries?: string[]; + // (undocumented) + webSearchQueries?: string[]; +} + +// @public (undocumented) +export enum HarmBlockMethod { + // (undocumented) + HARM_BLOCK_METHOD_UNSPECIFIED = "HARM_BLOCK_METHOD_UNSPECIFIED", + // (undocumented) + PROBABILITY = "PROBABILITY", + // (undocumented) + SEVERITY = "SEVERITY" +} + +// @public +export enum HarmBlockThreshold { + // (undocumented) + BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", + // (undocumented) + BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", + // (undocumented) + BLOCK_NONE = "BLOCK_NONE", + // (undocumented) + BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", + // (undocumented) + HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED" +} + +// @public +export enum HarmCategory { + // (undocumented) + HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT", + // (undocumented) + HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT", + // (undocumented) + HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", + // (undocumented) + HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT", + // (undocumented) + HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED" +} + +// @public +export enum HarmProbability { + // (undocumented) + HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED", + // (undocumented) + HIGH = "HIGH", + // (undocumented) + LOW = "LOW", + // (undocumented) + MEDIUM = "MEDIUM", + // (undocumented) + NEGLIGIBLE = "NEGLIGIBLE" +} + +// @public +export enum HarmSeverity { + // (undocumented) + HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH", + // (undocumented) + HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", + // (undocumented) + HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", + // (undocumented) + HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", + // (undocumented) + HARM_SEVERITY_UNSPECIFIED = "HARM_SEVERITY_UNSPECIFIED" +} + +// @public +export interface InlineDataPart { + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData: GenerativeContentBlob; + // (undocumented) + text?: never; + videoMetadata?: VideoMetadata; +} + +// @public +export interface ModelParams extends BaseParams { + // (undocumented) + model: string; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart; + +// @public +export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; + +// @public +export interface PromptFeedback { + // (undocumented) + blockReason: BlockReason; + // (undocumented) + blockReasonMessage?: string; + // (undocumented) + safetyRatings: SafetyRating[]; +} + +// @public +export interface RequestOptions { + baseUrl?: string; + timeout?: number; +} + +// @public (undocumented) +export interface RetrievedContextAttribution { + // (undocumented) + title: string; + // (undocumented) + uri: string; +} + +// @public +export type Role = (typeof POSSIBLE_ROLES)[number]; + +// @public +export interface SafetyRating { + // (undocumented) + blocked: boolean; + // (undocumented) + category: HarmCategory; + // (undocumented) + probability: HarmProbability; + // (undocumented) + probabilityScore: number; + // (undocumented) + severity: HarmSeverity; + // (undocumented) + severityScore: number; +} + +// @public +export interface SafetySetting { + // (undocumented) + category: HarmCategory; + // (undocumented) + method: HarmBlockMethod; + // (undocumented) + threshold: HarmBlockThreshold; +} + +// @public (undocumented) +export interface Segment { + // (undocumented) + endIndex: number; + // (undocumented) + partIndex: number; + // (undocumented) + startIndex: number; +} + +// @public +export interface StartChatParams extends BaseParams { + // (undocumented) + history?: Content[]; + // (undocumented) + systemInstruction?: string | Part | Content; + // (undocumented) + toolConfig?: ToolConfig; + // (undocumented) + tools?: Tool[]; +} + +// @public +export interface TextPart { + // (undocumented) + functionCall?: never; + // (undocumented) + functionResponse?: never; + // (undocumented) + inlineData?: never; + // (undocumented) + text: string; +} + +// @public +export type Tool = FunctionDeclarationsTool; + +// @public +export interface ToolConfig { + // (undocumented) + functionCallingConfig: FunctionCallingConfig; +} + +// @public +export interface UsageMetadata { + // (undocumented) + candidatesTokenCount: number; + // (undocumented) + promptTokenCount: number; + // (undocumented) + totalTokenCount: number; +} + +// @public +export interface VertexAI { + app: FirebaseApp; + // (undocumented) + location: string; +} + +// @public +export interface VideoMetadata { + endOffset: string; + startOffset: string; +} + +// @public (undocumented) +export interface WebAttribution { + // (undocumented) + title: string; + // (undocumented) + uri: string; +} + + +``` diff --git a/packages/firebase/package.json b/packages/firebase/package.json index c2320f541c8..c1aa6405871 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -215,17 +215,17 @@ }, "default": "./storage/dist/esm/index.esm.js" }, - "./vertexai": { - "types": "./vertexai/dist/vertexai/index.d.ts", + "./vertexai-preview": { + "types": "./vertexai-preview/dist/vertexai-preview/index.d.ts", "node": { - "require": "./vertexai/dist/index.cjs.js", - "import": "./vertexai/dist/index.mjs" + "require": "./vertexai-preview/dist/index.cjs.js", + "import": "./vertexai-preview/dist/index.mjs" }, "browser": { - "require": "./vertexai/dist/index.cjs.js", - "import": "./vertexai/dist/esm/index.esm.js" + "require": "./vertexai-preview/dist/index.cjs.js", + "import": "./vertexai-preview/dist/esm/index.esm.js" }, - "default": "./vertexai/dist/esm/index.esm.js" + "default": "./vertexai-preview/dist/esm/index.esm.js" }, "./compat/analytics": { "types": "./compat/analytics/dist/compat/analytics/index.d.ts", @@ -412,7 +412,7 @@ "@firebase/app-check": "0.8.3", "@firebase/app-check-compat": "0.3.10", "@firebase/util": "1.9.5", - "@firebase/vertexai": "0.0.1" + "@firebase/vertexai-preview": "0.0.0" }, "devDependencies": { "rollup": "2.79.1", @@ -445,7 +445,7 @@ "messaging", "messaging/sw", "database", - "vertexai" + "vertexai-preview" ], "typings": "empty.d.ts" } diff --git a/packages/firebase/vertexai/index.ts b/packages/firebase/vertexai-preview/index.ts similarity index 93% rename from packages/firebase/vertexai/index.ts rename to packages/firebase/vertexai-preview/index.ts index 2645fd3004f..20d7697c1e0 100644 --- a/packages/firebase/vertexai/index.ts +++ b/packages/firebase/vertexai-preview/index.ts @@ -15,4 +15,4 @@ * limitations under the License. */ -export * from '@firebase/vertexai'; +export * from '@firebase/vertexai-preview'; diff --git a/packages/firebase/vertexai/package.json b/packages/firebase/vertexai-preview/package.json similarity index 55% rename from packages/firebase/vertexai/package.json rename to packages/firebase/vertexai-preview/package.json index 20e04a3bbb5..9dfe8f0c3fa 100644 --- a/packages/firebase/vertexai/package.json +++ b/packages/firebase/vertexai-preview/package.json @@ -1,7 +1,7 @@ { - "name": "firebase/vertexai", + "name": "firebase/vertexai-preview", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm.js", "module": "dist/esm/index.esm.js", - "typings": "dist/vertexai/index.d.ts" + "typings": "dist/vertexai-preview/index.d.ts" } \ No newline at end of file diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 4ae076cdda2..ce5ba1323df 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,7 +1,7 @@ { - "name": "@firebase/vertexai", - "version": "0.0.1", - "description": "A template package for new firebase packages", + "name": "@firebase/vertexai-preview", + "version": "0.0.0", + "description": "A Firebase SDK for VertexAI (preview)", "author": "Firebase (https://firebase.google.com/)", "engines": { "node": ">=18.0.0" @@ -30,13 +30,14 @@ "scripts": { "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "build": "rollup -c", + "build": "rollup -c && yarn api-report", "build:deps": "lerna run --scope @firebase/vertexai --include-dependencies build", "dev": "rollup -c -w", "testsetup": "yarn ts-node ./test-utils/convert-mocks.ts", "test": "run-p --npm-path npm lint test:browser", "test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test", - "test:browser": "yarn testsetup && karma start --single-run" + "test:browser": "yarn testsetup && karma start --single-run", + "api-report": "api-extractor run --local --verbose" }, "peerDependencies": { "@firebase/app": "0.x", diff --git a/packages/vertexai/src/api.ts b/packages/vertexai/src/api.ts index 19d250ccb79..053946e51ef 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/vertexai/src/api.ts @@ -45,20 +45,26 @@ declare module '@firebase/component' { export function getVertexAI(app: FirebaseApp = getApp()): VertexAI { app = getModularInstance(app); // Dependencies - const vertexProvider: Provider<'vertex'> = _getProvider(app, VERTEX_TYPE); + const vertexProvider: Provider<'vertexAI'> = _getProvider(app, VERTEX_TYPE); return vertexProvider.getImmediate({ identifier: DEFAULT_LOCATION }); } +/** + * Returns a {@link GenerativeModel} class with methods for inference + * and other functionality. + * + * @public + */ export function getGenerativeModel( - vertex: VertexAI, + vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions ): GenerativeModel { if (!modelParams.model) { throw ERROR_FACTORY.create(VertexError.NO_MODEL); } - return new GenerativeModel(vertex, modelParams, requestOptions); + return new GenerativeModel(vertexAI, modelParams, requestOptions); } diff --git a/packages/vertexai/src/constants.ts b/packages/vertexai/src/constants.ts index e4bb26baa1d..97f6d813abc 100644 --- a/packages/vertexai/src/constants.ts +++ b/packages/vertexai/src/constants.ts @@ -17,7 +17,7 @@ import { version } from '../package.json'; -export const VERTEX_TYPE = 'vertex'; +export const VERTEX_TYPE = 'vertexAI'; export const DEFAULT_LOCATION = 'us-central1'; diff --git a/packages/vertexai/src/errors.ts b/packages/vertexai/src/errors.ts index 2aa72ac44ea..c0b9d83aaeb 100644 --- a/packages/vertexai/src/errors.ts +++ b/packages/vertexai/src/errors.ts @@ -39,7 +39,7 @@ const ERRORS: ErrorMap = { `contain a valid project ID.`, [VertexError.NO_MODEL]: `Must provide a model name. ` + - `Example: genai.getGenerativeModel({ model: 'my-model-name' })`, + `Example: getGenerativeModel({ model: 'my-model-name' })`, [VertexError.PARSE_FAILED]: `Parsing failed: {$message}`, [VertexError.RESPONSE_ERROR]: `Response error: {$message}. Response body stored in ` + @@ -57,7 +57,7 @@ interface ErrorParams { } export const ERROR_FACTORY = new ErrorFactory( - 'vertex', - 'Vertex', + 'vertexAI', + 'VertexAI', ERRORS ); diff --git a/packages/vertexai/src/types/content.ts b/packages/vertexai/src/types/content.ts index c626ce75fc9..75054f8299c 100644 --- a/packages/vertexai/src/types/content.ts +++ b/packages/vertexai/src/types/content.ts @@ -80,7 +80,7 @@ export interface VideoMetadata { } /** - * Content part interface if the part represents a {@link FunctionCall}`. + * Content part interface if the part represents a {@link FunctionCall}. * @public */ export interface FunctionCallPart { diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index 70ce881ff8a..079d72f348f 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -33,7 +33,7 @@ export interface BaseParams { } /** - * Params passed to {@link GoogleGenerativeAI.getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface ModelParams extends BaseParams { diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 375bd340e42..c46a243edef 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -74,6 +74,11 @@ export interface GenerateContentResponse { usageMetadata?: UsageMetadata; } +/** + * Usage metadata about a {@link GenerateContentResponse}. + * + * @public + */ export interface UsageMetadata { promptTokenCount: number; candidatesTokenCount: number; diff --git a/scripts/docgen/docgen.ts b/scripts/docgen/docgen.ts index 0b38da3bd8b..3f4d10ebbd9 100644 --- a/scripts/docgen/docgen.ts +++ b/scripts/docgen/docgen.ts @@ -54,7 +54,8 @@ const PREFERRED_PARAMS = [ 'messaging', 'performance', 'remoteConfig', - 'storage' + 'storage', + 'vertexAI' ]; yargs