@@ -8,6 +8,10 @@ const getCurrentOllamaModels = () => {
88 return useProvidersStore . getState ( ) . providers . ollama . models
99}
1010
11+ const getCurrentVLLMModels = ( ) => {
12+ return useProvidersStore . getState ( ) . providers . vllm . models
13+ }
14+
1115const getTranslationPrompt = ( targetLanguage : string ) =>
1216 `Translate the following text into ${ targetLanguage || 'English' } . Output ONLY the translated text with no additional commentary, explanations, or notes.`
1317
@@ -55,6 +59,19 @@ export const TranslateBlock: BlockConfig = {
5559 } )
5660 } ,
5761 } ,
62+ {
63+ id : 'vertexCredential' ,
64+ title : 'Google Cloud Account' ,
65+ type : 'oauth-input' ,
66+ serviceId : 'vertex-ai' ,
67+ requiredScopes : [ 'https://www.googleapis.com/auth/cloud-platform' ] ,
68+ placeholder : 'Select Google Cloud account' ,
69+ required : true ,
70+ condition : {
71+ field : 'model' ,
72+ value : providers . vertex . models ,
73+ } ,
74+ } ,
5875 {
5976 id : 'apiKey' ,
6077 title : 'API Key' ,
@@ -63,17 +80,21 @@ export const TranslateBlock: BlockConfig = {
6380 password : true ,
6481 connectionDroppable : false ,
6582 required : true ,
66- // Hide API key for hosted models and Ollama models
83+ // Hide API key for hosted models, Ollama models, vLLM models, and Vertex models (uses OAuth)
6784 condition : isHosted
6885 ? {
6986 field : 'model' ,
70- value : getHostedModels ( ) ,
87+ value : [ ... getHostedModels ( ) , ... providers . vertex . models ] ,
7188 not : true , // Show for all models EXCEPT those listed
7289 }
7390 : ( ) => ( {
7491 field : 'model' ,
75- value : getCurrentOllamaModels ( ) ,
76- not : true , // Show for all models EXCEPT Ollama models
92+ value : [
93+ ...getCurrentOllamaModels ( ) ,
94+ ...getCurrentVLLMModels ( ) ,
95+ ...providers . vertex . models ,
96+ ] ,
97+ not : true , // Show for all models EXCEPT Ollama, vLLM, and Vertex models
7798 } ) ,
7899 } ,
79100 {
@@ -105,6 +126,7 @@ export const TranslateBlock: BlockConfig = {
105126 type : 'short-input' ,
106127 placeholder : 'your-gcp-project-id' ,
107128 connectionDroppable : false ,
129+ required : true ,
108130 condition : {
109131 field : 'model' ,
110132 value : providers . vertex . models ,
@@ -116,6 +138,7 @@ export const TranslateBlock: BlockConfig = {
116138 type : 'short-input' ,
117139 placeholder : 'us-central1' ,
118140 connectionDroppable : false ,
141+ required : true ,
119142 condition : {
120143 field : 'model' ,
121144 value : providers . vertex . models ,
@@ -144,6 +167,7 @@ export const TranslateBlock: BlockConfig = {
144167 azureApiVersion : params . azureApiVersion ,
145168 vertexProject : params . vertexProject ,
146169 vertexLocation : params . vertexLocation ,
170+ vertexCredential : params . vertexCredential ,
147171 } ) ,
148172 } ,
149173 } ,
@@ -155,6 +179,10 @@ export const TranslateBlock: BlockConfig = {
155179 azureApiVersion : { type : 'string' , description : 'Azure API version' } ,
156180 vertexProject : { type : 'string' , description : 'Google Cloud project ID for Vertex AI' } ,
157181 vertexLocation : { type : 'string' , description : 'Google Cloud location for Vertex AI' } ,
182+ vertexCredential : {
183+ type : 'string' ,
184+ description : 'Google Cloud OAuth credential ID for Vertex AI' ,
185+ } ,
158186 systemPrompt : { type : 'string' , description : 'Translation instructions' } ,
159187 } ,
160188 outputs : {
0 commit comments