mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 18:23:40 +08:00
feat: support claude and gemini in vertex ai (#1621)
* feat: support claude and gemini in vertex ai * fix: do not show api key field in channel page when the type is VertexAI * fix: update getToken function to include channelId in cache key
This commit is contained in:
@@ -161,6 +161,12 @@ export const CHANNEL_OPTIONS = {
|
||||
value: 39,
|
||||
color: 'primary'
|
||||
},
|
||||
42: {
|
||||
key: 42,
|
||||
text: 'VertexAI',
|
||||
value: 42,
|
||||
color: 'primary'
|
||||
},
|
||||
41: {
|
||||
key: 41,
|
||||
text: 'Novita',
|
||||
|
||||
@@ -165,6 +165,8 @@ const EditModal = ({ open, channelId, onCancel, onOk }) => {
|
||||
if (values.key === '') {
|
||||
if (values.config.ak && values.config.sk && values.config.region) {
|
||||
values.key = `${values.config.ak}|${values.config.sk}|${values.config.region}`;
|
||||
} else if (values.config.region && values.config.vertex_ai_project_id && values.config.vertex_ai_adc) {
|
||||
values.key = `${values.config.region}|${values.config.vertex_ai_project_id}|${values.config.vertex_ai_adc}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,26 @@ const typeConfig = {
|
||||
}
|
||||
},
|
||||
modelGroup: 'Coze'
|
||||
}
|
||||
},
|
||||
42: {
|
||||
inputLabel: {
|
||||
key: '',
|
||||
config: {
|
||||
region: 'Vertex AI Region',
|
||||
vertex_ai_project_id: 'Vertex AI Project ID',
|
||||
vertex_ai_adc: 'Google Cloud Application Default Credentials JSON'
|
||||
}
|
||||
},
|
||||
prompt: {
|
||||
key: '',
|
||||
config: {
|
||||
region: 'Vertex AI Region.g. us-east5',
|
||||
vertex_ai_project_id: 'Vertex AI Project ID',
|
||||
vertex_ai_adc: 'Google Cloud Application Default Credentials JSON: https://cloud.google.com/docs/authentication/application-default-credentials'
|
||||
}
|
||||
},
|
||||
modelGroup: 'anthropic'
|
||||
},
|
||||
};
|
||||
|
||||
export { defaultConfig, typeConfig };
|
||||
|
||||
Reference in New Issue
Block a user