@@ -102,6 +102,10 @@ const ANSWER_LANGUAGE_OPTIONS = [
102102 { label : 'Vietnamese' , id : 'VI' } ,
103103]
104104
105+ const ANSWER_LANGUAGE_IDS = new Set (
106+ ANSWER_LANGUAGE_OPTIONS . map ( ( option ) => option . id ) . filter ( ( id ) => id !== '' )
107+ )
108+
105109const SEARCH_ONLY_LANGUAGES = [
106110 { label : 'Chinese (Simplified)' , id : 'ZH-HANS' } ,
107111 { label : 'Chinese (Traditional)' , id : 'ZH-HANT' } ,
@@ -159,14 +163,16 @@ export const YouComBlock: BlockConfig = {
159163 { text : ', within' , field : 'includeDomains' } ,
160164 ] ,
161165 [ GET_CONTENTS ] : [ { text : 'Read page contents from' , field : 'urls' , core : true } ] ,
162- [ ANSWER ] : [ { text : 'Answer' , field : 'query ' , after : 'with cited sources' , core : true } ] ,
166+ [ ANSWER ] : [ { text : 'Answer' , field : 'question ' , after : 'with cited sources' , core : true } ] ,
163167 [ RESEARCH ] : [
164168 { text : 'Research' , field : 'input' , core : true } ,
165169 { text : 'at' , field : 'researchEffort' , after : 'effort' } ,
166170 ] ,
167171 [ GET_RESEARCH_TASK ] : [ { text : 'Check research task' , field : 'taskId' , core : true } ] ,
168- [ FINANCE_RESEARCH ] : [ { text : 'Research financial question' , field : 'input' , core : true } ] ,
169- [ SEARCH_IMAGES ] : [ { text : 'Find images of' , field : 'query' , core : true } ] ,
172+ [ FINANCE_RESEARCH ] : [
173+ { text : 'Research financial question' , field : 'financeInput' , core : true } ,
174+ ] ,
175+ [ SEARCH_IMAGES ] : [ { text : 'Find images of' , field : 'imageQuery' , core : true } ] ,
170176 [ GET_ACCOUNT_BALANCE ] : [ 'Get remaining API credit balance' ] ,
171177 } ,
172178 } ,
@@ -197,15 +203,15 @@ export const YouComBlock: BlockConfig = {
197203 required : true ,
198204 } ,
199205 {
200- id : 'query ' ,
206+ id : 'question ' ,
201207 title : 'Question' ,
202208 type : 'long-input' ,
203209 placeholder : 'Enter your question' ,
204210 condition : { field : 'operation' , value : ANSWER } ,
205211 required : true ,
206212 } ,
207213 {
208- id : 'query ' ,
214+ id : 'imageQuery ' ,
209215 title : 'Image Query' ,
210216 type : 'long-input' ,
211217 placeholder : 'Enter what to find images of (supports site: and filetype:)' ,
@@ -342,7 +348,7 @@ export const YouComBlock: BlockConfig = {
342348 required : true ,
343349 } ,
344350 {
345- id : 'input ' ,
351+ id : 'financeInput ' ,
346352 title : 'Financial Question' ,
347353 type : 'long-input' ,
348354 placeholder : 'e.g., What drove NVIDIA revenue growth in fiscal 2025?' ,
@@ -504,10 +510,17 @@ export const YouComBlock: BlockConfig = {
504510 const maxAge = toOptionalNumber ( params . maxAge )
505511 if ( maxAge !== undefined ) result . maxAge = maxAge
506512
507- // Hidden advanced fields still serialize; keep Search-only languages (JA) out of Answer
508- if ( params . operation === ANSWER ) result . language = params . answerLanguage || undefined
509- if ( params . operation === FINANCE_RESEARCH && params . financeResearchEffort ) {
510- result . researchEffort = params . financeResearchEffort
513+ // Agent tool calls run this over LLM args too, so fall back to the tool param names
514+ if ( params . operation === ANSWER ) {
515+ result . query = params . question ?? params . query
516+ // Hidden advanced fields still serialize; keep Search-only languages (JA) out of Answer
517+ const language = params . answerLanguage || params . language
518+ result . language = ANSWER_LANGUAGE_IDS . has ( language ) ? language : undefined
519+ }
520+ if ( params . operation === SEARCH_IMAGES ) result . query = params . imageQuery ?? params . query
521+ if ( params . operation === FINANCE_RESEARCH ) {
522+ result . input = params . financeInput ?? params . input
523+ if ( params . financeResearchEffort ) result . researchEffort = params . financeResearchEffort
511524 }
512525 const effort = result . researchEffort ?? params . researchEffort
513526 const isSyncResearch =
@@ -522,14 +535,17 @@ export const YouComBlock: BlockConfig = {
522535 inputs : {
523536 operation : { type : 'string' , description : 'Operation to perform' } ,
524537 apiKey : { type : 'string' , description : 'You.com API key' } ,
525- query : { type : 'string' , description : 'Search query, question, or image query' } ,
538+ query : { type : 'string' , description : 'Search query' } ,
539+ question : { type : 'string' , description : 'Question to answer' } ,
540+ imageQuery : { type : 'string' , description : 'Image search query' } ,
526541 extractionMode : { type : 'string' , description : 'Per-result content: highlights or full_page' } ,
527542 extractionFormats : { type : 'json' , description : 'Full page formats: markdown, html' } ,
528543 extractionSource : { type : 'string' , description : 'Full page source: blend, cache, or fetch' } ,
529544 urls : { type : 'string' , description : 'Comma-separated URLs to fetch' } ,
530545 formats : { type : 'json' , description : 'Content formats: markdown, html, metadata' } ,
531546 maxAge : { type : 'number' , description : 'Maximum cached content age in seconds' } ,
532- input : { type : 'string' , description : 'Research or financial research question' } ,
547+ input : { type : 'string' , description : 'Research question' } ,
548+ financeInput : { type : 'string' , description : 'Financial research question' } ,
533549 researchEffort : { type : 'string' , description : 'Research effort level' } ,
534550 outputSchema : { type : 'json' , description : 'JSON Schema for structured research output' } ,
535551 background : { type : 'boolean' , description : 'Run research as a background task' } ,
0 commit comments