2121import static com .bytechef .component .ai .llm .constant .LLMConstants .ATTACHMENTS_PROPERTY ;
2222import static com .bytechef .component .ai .llm .constant .LLMConstants .FORMAT_PROPERTY ;
2323import static com .bytechef .component .ai .llm .constant .LLMConstants .FREQUENCY_PENALTY ;
24- import static com .bytechef .component .ai .llm .constant .LLMConstants .FREQUENCY_PENALTY_PROPERTY ;
2524import static com .bytechef .component .ai .llm .constant .LLMConstants .LOGIT_BIAS ;
26- import static com .bytechef .component .ai .llm .constant .LLMConstants .LOGIT_BIAS_PROPERTY ;
2725import static com .bytechef .component .ai .llm .constant .LLMConstants .MAX_TOKENS ;
28- import static com .bytechef .component .ai .llm .constant .LLMConstants .MAX_TOKENS_PROPERTY ;
2926import static com .bytechef .component .ai .llm .constant .LLMConstants .MESSAGES_PROPERTY ;
3027import static com .bytechef .component .ai .llm .constant .LLMConstants .MODEL ;
3128import static com .bytechef .component .ai .llm .constant .LLMConstants .PRESENCE_PENALTY ;
32- import static com .bytechef .component .ai .llm .constant .LLMConstants .PRESENCE_PENALTY_PROPERTY ;
3329import static com .bytechef .component .ai .llm .constant .LLMConstants .PROMPT_PROPERTY ;
3430import static com .bytechef .component .ai .llm .constant .LLMConstants .REASONING ;
35- import static com .bytechef .component .ai .llm .constant .LLMConstants .REASONING_PROPERTY ;
3631import static com .bytechef .component .ai .llm .constant .LLMConstants .RESPONSE ;
3732import static com .bytechef .component .ai .llm .constant .LLMConstants .RESPONSE_FORMAT ;
3833import static com .bytechef .component .ai .llm .constant .LLMConstants .RESPONSE_PROPERTY ;
3934import static com .bytechef .component .ai .llm .constant .LLMConstants .SEED ;
40- import static com .bytechef .component .ai .llm .constant .LLMConstants .SEED_PROPERTY ;
4135import static com .bytechef .component .ai .llm .constant .LLMConstants .STOP ;
42- import static com .bytechef .component .ai .llm .constant .LLMConstants .STOP_PROPERTY ;
4336import static com .bytechef .component .ai .llm .constant .LLMConstants .SYSTEM_PROMPT_PROPERTY ;
4437import static com .bytechef .component .ai .llm .constant .LLMConstants .TEMPERATURE ;
45- import static com .bytechef .component .ai .llm .constant .LLMConstants .TEMPERATURE_PROPERTY ;
4638import static com .bytechef .component .ai .llm .constant .LLMConstants .TOP_K ;
47- import static com .bytechef .component .ai .llm .constant .LLMConstants .TOP_K_PROPERTY ;
4839import static com .bytechef .component .ai .llm .constant .LLMConstants .TOP_P ;
49- import static com .bytechef .component .ai .llm .constant .LLMConstants .TOP_P_PROPERTY ;
5040import static com .bytechef .component .ai .llm .constant .LLMConstants .USER ;
5141import static com .bytechef .component .ai .llm .constant .LLMConstants .USER_PROPERTY ;
5242import static com .bytechef .component .ai .llm .constant .LLMConstants .VERBOSITY ;
53- import static com .bytechef .component .ai .llm .constant .LLMConstants .VERBOSITY_PROPERTY ;
5443import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .CHAT_MODEL_PROPERTY ;
44+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .FREQUENCY_PENALTY_PROPERTY ;
45+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .LOGIT_BIAS_PROPERTY ;
5546import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .LOGPROBS ;
5647import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .LOGPROBS_PROPERTY ;
5748import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .MAX_COMPLETION_TOKENS ;
5849import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .MAX_COMPLETION_TOKENS_PROPERTY ;
59- import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .SUPPORTED_PARAMETERS ;
50+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .MAX_TOKENS_PROPERTY ;
51+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .PRESENCE_PENALTY_PROPERTY ;
52+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .REASONING_PROPERTY ;
53+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .SEED_PROPERTY ;
54+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .STOP_PROPERTY ;
6055import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .SUPPORTED_PARAMETERS_PROPERTY ;
56+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .TEMPERATURE_PROPERTY ;
57+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .TOP_K_PROPERTY ;
6158import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .TOP_LOGPROBS ;
6259import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .TOP_LOGPROBS_PROPERTY ;
60+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .TOP_P_PROPERTY ;
61+ import static com .bytechef .component .ai .llm .open .router .constant .OpenRouterConstants .VERBOSITY_PROPERTY ;
6362import static com .bytechef .component .definition .Authorization .TOKEN ;
6463import static com .bytechef .component .definition .ComponentDsl .action ;
6564
6665import com .bytechef .component .ai .llm .ChatModel ;
66+ import com .bytechef .component .ai .llm .ChatModel .ResponseFormat ;
6767import com .bytechef .component .ai .llm .open .router .model .OpenRouterChatModel ;
6868import com .bytechef .component .ai .llm .util .ModelUtils ;
6969import com .bytechef .component .definition .ActionContext ;
@@ -88,34 +88,20 @@ public class OpenRouterChatAction {
8888 ATTACHMENTS_PROPERTY ,
8989 MESSAGES_PROPERTY ,
9090 RESPONSE_PROPERTY ,
91- FREQUENCY_PENALTY_PROPERTY
92- .displayCondition ("contains(%s, 'frequency_penalty')" .formatted (SUPPORTED_PARAMETERS )),
93- LOGIT_BIAS_PROPERTY
94- .displayCondition ("contains(%s, 'logit_bias')" .formatted (SUPPORTED_PARAMETERS )),
95- LOGPROBS_PROPERTY
96- .displayCondition ("contains(%s, 'logprobs')" .formatted (SUPPORTED_PARAMETERS )),
97- MAX_COMPLETION_TOKENS_PROPERTY
98- .displayCondition ("contains(%s, 'max_completion_tokens')" .formatted (SUPPORTED_PARAMETERS )),
99- MAX_TOKENS_PROPERTY
100- .displayCondition ("contains(%s, 'max_tokens')" .formatted (SUPPORTED_PARAMETERS )),
101- PRESENCE_PENALTY_PROPERTY
102- .displayCondition ("contains(%s, 'presence_penalty')" .formatted (SUPPORTED_PARAMETERS )),
103- REASONING_PROPERTY
104- .displayCondition ("contains(%s, 'reasoning')" .formatted (SUPPORTED_PARAMETERS )),
105- SEED_PROPERTY
106- .displayCondition ("contains(%s, 'seed')" .formatted (SUPPORTED_PARAMETERS )),
107- STOP_PROPERTY
108- .displayCondition ("contains(%s, 'stop')" .formatted (SUPPORTED_PARAMETERS )),
109- TEMPERATURE_PROPERTY
110- .displayCondition ("contains(%s, 'temperature')" .formatted (SUPPORTED_PARAMETERS )),
111- TOP_LOGPROBS_PROPERTY
112- .displayCondition ("contains(%s, 'top_logprobs')" .formatted (SUPPORTED_PARAMETERS )),
113- TOP_K_PROPERTY
114- .displayCondition ("contains(%s, 'top_k')" .formatted (SUPPORTED_PARAMETERS )),
115- TOP_P_PROPERTY
116- .displayCondition ("contains(%s, 'top_p')" .formatted (SUPPORTED_PARAMETERS )),
117- VERBOSITY_PROPERTY
118- .displayCondition ("contains(%s, 'verbosity')" .formatted (SUPPORTED_PARAMETERS )),
91+ FREQUENCY_PENALTY_PROPERTY ,
92+ LOGIT_BIAS_PROPERTY ,
93+ LOGPROBS_PROPERTY ,
94+ MAX_COMPLETION_TOKENS_PROPERTY ,
95+ MAX_TOKENS_PROPERTY ,
96+ PRESENCE_PENALTY_PROPERTY ,
97+ REASONING_PROPERTY ,
98+ SEED_PROPERTY ,
99+ STOP_PROPERTY ,
100+ TEMPERATURE_PROPERTY ,
101+ TOP_LOGPROBS_PROPERTY ,
102+ TOP_K_PROPERTY ,
103+ TOP_P_PROPERTY ,
104+ VERBOSITY_PROPERTY ,
119105 USER_PROPERTY )
120106 .output (ModelUtils ::output )
121107 .perform (OpenRouterChatAction ::perform );
@@ -124,8 +110,8 @@ public class OpenRouterChatAction {
124110 boolean jsonFormat = false ;
125111
126112 if (responseFormatRequired ) {
127- ChatModel . ResponseFormat responseFormat = inputParameters .getRequiredFromPath (
128- RESPONSE + "." + RESPONSE_FORMAT , ChatModel . ResponseFormat .class );
113+ ResponseFormat responseFormat = inputParameters .getRequiredFromPath (
114+ RESPONSE + "." + RESPONSE_FORMAT , ResponseFormat .class );
129115
130116 jsonFormat = !responseFormat .equals (TEXT );
131117 }
0 commit comments