@firebase/vertexai
Version:
A Firebase SDK for VertexAI
131 lines (130 loc) • 3.08 kB
TypeScript
/**
* @license
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Role is the producer of the content.
* @public
*/
export type Role = (typeof POSSIBLE_ROLES)[number];
/**
* Possible roles.
* @public
*/
export declare const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"];
/**
* Harm categories that would cause prompts or candidates to be blocked.
* @public
*/
export declare enum HarmCategory {
HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT"
}
/**
* Threshold above which a prompt or candidate will be blocked.
* @public
*/
export declare enum HarmBlockThreshold {
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
BLOCK_NONE = "BLOCK_NONE"
}
/**
* @public
*/
export declare enum HarmBlockMethod {
SEVERITY = "SEVERITY",
PROBABILITY = "PROBABILITY"
}
/**
* Probability that a prompt or candidate matches a harm category.
* @public
*/
export declare enum HarmProbability {
NEGLIGIBLE = "NEGLIGIBLE",
LOW = "LOW",
MEDIUM = "MEDIUM",
HIGH = "HIGH"
}
/**
* Harm severity levels.
* @public
*/
export declare enum HarmSeverity {
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE",
HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW",
HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM",
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
}
/**
* Reason that a prompt was blocked.
* @public
*/
export declare enum BlockReason {
SAFETY = "SAFETY",
OTHER = "OTHER"
}
/**
* Reason that a candidate finished.
* @public
*/
export declare enum FinishReason {
STOP = "STOP",
MAX_TOKENS = "MAX_TOKENS",
SAFETY = "SAFETY",
RECITATION = "RECITATION",
OTHER = "OTHER"
}
/**
* @public
*/
export declare enum FunctionCallingMode {
AUTO = "AUTO",
ANY = "ANY",
NONE = "NONE"
}
/**
* Content part modality.
* @public
*/
export declare enum Modality {
/**
* Unspecified modality.
*/
MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
/**
* Plain text.
*/
TEXT = "TEXT",
/**
* Image.
*/
IMAGE = "IMAGE",
/**
* Video.
*/
VIDEO = "VIDEO",
/**
* Audio.
*/
AUDIO = "AUDIO",
/**
* Document (for example, PDF).
*/
DOCUMENT = "DOCUMENT"
}