VertexAILLM¶
VertexAI LLM 实现,运行 Gemini 的异步 API 客户端。
-
Gemini API: https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini
要使用
VertexAILLM
,必须使用以下方法之一配置 Google Cloud 身份验证- 设置
GOOGLE_CLOUD_CREDENTIALS
环境变量 - 使用
gcloud auth application-default login
命令 - 使用
google-cloud-aiplatform
库中的vertexai.init
函数
- 设置
属性¶
-
model: 用于 LLM 的模型名称,例如 "gemini-1.0-pro"。 支持的模型。
-
_aclient: 用于 Vertex AI Gemini API 的
GenerativeModel
。 它是内部使用的。在 `load` 方法中设置。