1 line
110 KiB
JSON
1 line
110 KiB
JSON
{"repo": "bytechefhq/bytechef", "files": {"server/libs/modules/components/ai/llm/deepseek/src/main/java/com/bytechef/component/ai/llm/deepseek/action/DeepSeekChatAction.java": {"588d5f57df91f71aea03d7e7a82067478d5105cb": {"t": 1785746109.6580393, "n": 6121, "h": "26af4b20807c07ff", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .help(\"\", \"https://docs.bytechef.io/reference/components/deepseek_v1#ask\")\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters, responseFormatRequired) -> {\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .options(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "8b6113aad89a1f51f8e876ba3f00fcffd1fcdd39": {"t": 1785759920.9792309, "n": 6121, "h": "26af4b20807c07ff", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .help(\"\", \"https://docs.bytechef.io/reference/components/deepseek_v1#ask\")\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters, responseFormatRequired) -> {\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .options(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "ed50b259d5338509c7e030cc04ff928d0bfdaee8": {"t": 1785759922.4563076, "n": 6128, "h": "82ec229451f30b4c", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .help(\"\", \"https://docs.bytechef.io/reference/components/deepseek_v1#ask\")\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters, responseFormatRequired) -> {\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "161ca54eb897773ead9702fcaf487e4abc1a1bdd": {"t": 1785759925.362476, "n": 6253, "h": "97f6bf1d582c1a56", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .help(\"\", \"https://docs.bytechef.io/reference/components/deepseek_v1#ask\")\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL =\n (inputParameters, connectionParameters, responseFormatRequired) -> {\n\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "2d0a9405ff118f75ba5430f8a909a3285810daf4": {"t": 1785759926.7479396, "n": 6045, "h": "02fc2f2c833b83dd", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters, responseFormatRequired) -> {\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "aafbb603cdda507f4aa68bd032591460a5ce7816": {"t": 1785759927.9590316, "n": 6051, "h": "cb55bccd69ff8d27", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters, responseFormatRequired) -> {\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context, true);\n }\n}\n"}, "70298cd726b22492c8fc6d28178c684ecd3c5a28": {"t": 1785759929.5475268, "n": 6045, "h": "02fc2f2c833b83dd", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters, responseFormatRequired) -> {\n ResponseFormat responseFormat = null;\n\n if (responseFormatRequired) {\n ChatModel.ResponseFormat chatModelResponseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = chatModelResponseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n responseFormat = ResponseFormat.builder()\n .type(type)\n .build();\n }\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(responseFormat)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "168b9f2156e610dde87fd3071bc05cc46f3c6d9a": {"t": 1785759930.961125, "n": 5883, "h": "bfcfecdaa5f78506", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.ai.deepseek.api.ResponseFormat.Type;\n\n/**\n * @author Monika Kušter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n STOP_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> {\n ChatModel.ResponseFormat responseFormat = inputParameters.getRequiredFromPath(\n RESPONSE + \".\" + RESPONSE_FORMAT, ChatModel.ResponseFormat.class);\n\n Type type = responseFormat == ChatModel.ResponseFormat.TEXT ? Type.TEXT : Type.JSON_OBJECT;\n\n ResponseFormat format = ResponseFormat.builder()\n .type(type)\n .build();\n\n return DeepSeekChatModel.builder()\n .deepSeekApi(\n DeepSeekApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n DeepSeekChatOptions.builder()\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .model(inputParameters.getRequiredString(MODEL))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .responseFormat(format)\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .build())\n .build();\n };\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "0d7081e26b7dd753ac8871d05aefc2a62d75a129": {"t": 1785759934.4338634, "n": 5817, "h": "8dab0fd26723a166", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ATTACHMENTS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FORMAT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.SYSTEM_PROMPT_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n FORMAT_PROPERTY,\n PROMPT_PROPERTY,\n SYSTEM_PROMPT_PROPERTY,\n ATTACHMENTS_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "791aa17543e69bacba0b8b115ba22ee66aadb257": {"t": 1785759935.9610856, "n": 5345, "h": "fa15655ecd512a1d", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "3772d89382f5b45a6106dbd1f86bbbae8524291a": {"t": 1785759937.5514743, "n": 5327, "h": "7a1bd9228fc81037", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output()\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "a624cb385b9e9e8d392ad41672359e8998267f8a": {"t": 1785759939.2422037, "n": 5345, "h": "fa15655ecd512a1d", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "07aa6488eccba4562ed4695f8f62e14846b1ea16": {"t": 1785759940.8559263, "n": 5358, "h": "d297944aadaf3a4c", "c": "/*\n * Copyright 2023-present ByteChef Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output(ModelUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(ModelUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "dff9d9077cd0839c11d5ea20a42071cc7da49bba": {"t": 1785759942.410074, "n": 5352, "h": "7bd38115262af7ff", "c": "/*\n * Copyright 2023-present ByteChef Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.ai.llm.deepseek.constant.DeepSeekConstants.CHAT_MODEL_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.LLMUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n CHAT_MODEL_PROPERTY,\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output(LLMUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(LLMUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}, "1badb6841391ac08bd972c6cb61094b76724800b": {"t": 1785759943.967999, "n": 5434, "h": "611b58863f8a8d94", "c": "/*\n * Copyright 2023-present ByteChef Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.ASK;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.LOGIT_BIAS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MESSAGES_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.N_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P_PROPERTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.USER_PROPERTY;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static com.bytechef.component.definition.ComponentDsl.action;\nimport static com.bytechef.component.definition.ComponentDsl.string;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.LLMUtils;\nimport com.bytechef.component.definition.ActionContext;\nimport com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.definition.TypeReference;\nimport org.springframework.ai.openai.OpenAiChatModel;\nimport org.springframework.ai.openai.OpenAiChatOptions;\nimport org.springframework.ai.openai.api.OpenAiApi;\n\n/**\n * @author Monika Domiter\n * @author Marko Kriskovic\n */\npublic class DeepSeekChatAction {\n\n public static final ModifiableActionDefinition ACTION_DEFINITION = action(ASK)\n .title(\"Ask\")\n .description(\"Ask anything you want.\")\n .properties(\n string(MODEL)\n .label(\"Model\")\n .description(\"ID of the model to use.\")\n .required(true),\n MESSAGES_PROPERTY,\n RESPONSE_PROPERTY,\n MAX_TOKENS_PROPERTY,\n N_PROPERTY,\n TEMPERATURE_PROPERTY,\n TOP_P_PROPERTY,\n FREQUENCY_PENALTY_PROPERTY,\n PRESENCE_PENALTY_PROPERTY,\n LOGIT_BIAS_PROPERTY,\n STOP_PROPERTY,\n USER_PROPERTY)\n .output(LLMUtils::output)\n .perform(DeepSeekChatAction::perform);\n\n public static final ChatModel CHAT_MODEL = (inputParameters, connectionParameters) -> OpenAiChatModel.builder()\n .openAiApi(\n OpenAiApi.builder()\n .apiKey(connectionParameters.getString(TOKEN))\n .baseUrl(\"https://api.deepseek.com\")\n .restClientBuilder(LLMUtils.getRestClientBuilder())\n .build())\n .defaultOptions(\n OpenAiChatOptions.builder()\n .model(inputParameters.getRequiredString(MODEL))\n .frequencyPenalty(inputParameters.getDouble(FREQUENCY_PENALTY))\n .logitBias(inputParameters.getMap(LOGIT_BIAS, new TypeReference<>() {}))\n .maxTokens(inputParameters.getInteger(MAX_TOKENS))\n .N(inputParameters.getInteger(N))\n .presencePenalty(inputParameters.getDouble(PRESENCE_PENALTY))\n .stop(inputParameters.getList(STOP, new TypeReference<>() {}))\n .temperature(inputParameters.getDouble(TEMPERATURE))\n .topP(inputParameters.getDouble(TOP_P))\n .user(inputParameters.getString(USER))\n .build())\n .build();\n\n private DeepSeekChatAction() {\n }\n\n public static Object perform(Parameters inputParameters, Parameters connectionParameters, ActionContext context) {\n return CHAT_MODEL.getResponse(inputParameters, connectionParameters, context);\n }\n}\n"}}, "server/libs/modules/components/ai/llm/deepseek/src/test/java/com/bytechef/component/ai/llm/deepseek/action/DeepSeekChatActionTest.java": {"588d5f57df91f71aea03d7e7a82067478d5105cb": {"t": 1785746122.2413058, "n": 6935, "h": "2dde028d5daeb9ca", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertInstanceOf;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.mockito.ArgumentCaptor.forClass;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.mockStatic;\nimport static org.mockito.Mockito.when;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.test.definition.MockParametersFactory;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.MockedStatic;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.web.client.RestClient.Builder;\n\n/**\n * @author Nikolina Spehar\n */\nclass DeepSeekChatActionTest {\n\n private final Builder mockRestClientBuilder = mock(Builder.class);\n private final Parameters mockedConnectionParameters = MockParametersFactory.create(Map.of(TOKEN, \"TOKEN\"));\n private final ArgumentCaptor<String> stringArgumentCaptor = forClass(String.class);\n private final ArgumentCaptor<Builder> restClientBuilderArgumentCaptor = forClass(Builder.class);\n private MockedStatic<DeepSeekApi> deepSeekApiMockedStatic;\n private MockedStatic<ModelUtils> modelUtilsMockedStatic;\n\n @BeforeEach\n void beforeEach() {\n deepSeekApiMockedStatic = mockStatic(DeepSeekApi.class);\n modelUtilsMockedStatic = mockStatic(ModelUtils.class);\n\n modelUtilsMockedStatic.when(ModelUtils::getRestClientBuilder)\n .thenReturn(mockRestClientBuilder);\n\n DeepSeekApi.Builder mockedApiBuilder = mock(DeepSeekApi.Builder.class);\n DeepSeekApi mockedApi = mock(DeepSeekApi.class);\n\n deepSeekApiMockedStatic.when(DeepSeekApi::builder)\n .thenReturn(mockedApiBuilder);\n\n when(mockedApiBuilder.apiKey(stringArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.baseUrl(stringArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.restClientBuilder(restClientBuilderArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.build())\n .thenReturn(mockedApi);\n }\n\n @AfterEach\n void afterEach() {\n assertEquals(List.of(\"TOKEN\", \"https://api.deepseek.com\"), stringArgumentCaptor.getAllValues());\n assertEquals(mockRestClientBuilder, restClientBuilderArgumentCaptor.getValue());\n\n deepSeekApiMockedStatic.close();\n modelUtilsMockedStatic.close();\n }\n\n @Test\n void testCreateChatModelWithResponseFormat() {\n Parameters mockedInputParameters = MockParametersFactory.create(\n Map.of(RESPONSE, Map.of(RESPONSE_FORMAT, ChatModel.ResponseFormat.JSON.name()), MODEL, \"deepseek-chat\",\n TEMPERATURE, 0.7, MAX_TOKENS, 1000, TOP_P, 0.9, FREQUENCY_PENALTY, 0.5,\n PRESENCE_PENALTY, 0.3, STOP, List.of(\"stop\")));\n\n org.springframework.ai.chat.model.ChatModel chatModel = DeepSeekChatAction.CHAT_MODEL.createChatModel(\n mockedInputParameters, mockedConnectionParameters, true);\n\n assertNotNull(chatModel);\n assertInstanceOf(DeepSeekChatModel.class, chatModel);\n\n DeepSeekChatOptions options = (DeepSeekChatOptions) chatModel.getDefaultOptions();\n\n assertEquals(\"deepseek-chat\", options.getModel());\n assertEquals(0.7, options.getTemperature());\n assertEquals(1000, options.getMaxTokens());\n assertEquals(0.9, options.getTopP());\n assertEquals(0.5, options.getFrequencyPenalty());\n assertEquals(0.3, options.getPresencePenalty());\n assertEquals(List.of(\"stop\"), options.getStop());\n\n ResponseFormat responseFormat = options.getResponseFormat();\n\n assertNotNull(responseFormat);\n assertEquals(ResponseFormat.Type.JSON_OBJECT, responseFormat.getType());\n }\n\n @Test\n void testCreateChatModelWithoutResponseFormat() {\n Parameters mockedInputParameters = MockParametersFactory.create(\n Map.of(MODEL, \"deepseek-chat\", TEMPERATURE, 0.7, MAX_TOKENS, 1000, TOP_P, 0.9, FREQUENCY_PENALTY, 0.5,\n PRESENCE_PENALTY, 0.3, STOP, List.of(\"stop\")));\n\n org.springframework.ai.chat.model.ChatModel chatModel = DeepSeekChatAction.CHAT_MODEL.createChatModel(\n mockedInputParameters, mockedConnectionParameters, false);\n\n assertNotNull(chatModel);\n assertInstanceOf(DeepSeekChatModel.class, chatModel);\n\n DeepSeekChatOptions options = (DeepSeekChatOptions) chatModel.getDefaultOptions();\n\n assertEquals(\"deepseek-chat\", options.getModel());\n assertEquals(0.7, options.getTemperature());\n assertEquals(1000, options.getMaxTokens());\n assertEquals(0.9, options.getTopP());\n assertEquals(0.5, options.getFrequencyPenalty());\n assertEquals(0.3, options.getPresencePenalty());\n assertEquals(List.of(\"stop\"), options.getStop());\n assertNull(options.getResponseFormat());\n }\n}\n"}, "ed50b259d5338509c7e030cc04ff928d0bfdaee8": {"t": 1785759920.1187706, "n": 6935, "h": "2dde028d5daeb9ca", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertInstanceOf;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.mockito.ArgumentCaptor.forClass;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.mockStatic;\nimport static org.mockito.Mockito.when;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.test.definition.MockParametersFactory;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.MockedStatic;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.web.client.RestClient.Builder;\n\n/**\n * @author Nikolina Spehar\n */\nclass DeepSeekChatActionTest {\n\n private final Builder mockRestClientBuilder = mock(Builder.class);\n private final Parameters mockedConnectionParameters = MockParametersFactory.create(Map.of(TOKEN, \"TOKEN\"));\n private final ArgumentCaptor<String> stringArgumentCaptor = forClass(String.class);\n private final ArgumentCaptor<Builder> restClientBuilderArgumentCaptor = forClass(Builder.class);\n private MockedStatic<DeepSeekApi> deepSeekApiMockedStatic;\n private MockedStatic<ModelUtils> modelUtilsMockedStatic;\n\n @BeforeEach\n void beforeEach() {\n deepSeekApiMockedStatic = mockStatic(DeepSeekApi.class);\n modelUtilsMockedStatic = mockStatic(ModelUtils.class);\n\n modelUtilsMockedStatic.when(ModelUtils::getRestClientBuilder)\n .thenReturn(mockRestClientBuilder);\n\n DeepSeekApi.Builder mockedApiBuilder = mock(DeepSeekApi.Builder.class);\n DeepSeekApi mockedApi = mock(DeepSeekApi.class);\n\n deepSeekApiMockedStatic.when(DeepSeekApi::builder)\n .thenReturn(mockedApiBuilder);\n\n when(mockedApiBuilder.apiKey(stringArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.baseUrl(stringArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.restClientBuilder(restClientBuilderArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.build())\n .thenReturn(mockedApi);\n }\n\n @AfterEach\n void afterEach() {\n assertEquals(List.of(\"TOKEN\", \"https://api.deepseek.com\"), stringArgumentCaptor.getAllValues());\n assertEquals(mockRestClientBuilder, restClientBuilderArgumentCaptor.getValue());\n\n deepSeekApiMockedStatic.close();\n modelUtilsMockedStatic.close();\n }\n\n @Test\n void testCreateChatModelWithResponseFormat() {\n Parameters mockedInputParameters = MockParametersFactory.create(\n Map.of(RESPONSE, Map.of(RESPONSE_FORMAT, ChatModel.ResponseFormat.JSON.name()), MODEL, \"deepseek-chat\",\n TEMPERATURE, 0.7, MAX_TOKENS, 1000, TOP_P, 0.9, FREQUENCY_PENALTY, 0.5,\n PRESENCE_PENALTY, 0.3, STOP, List.of(\"stop\")));\n\n org.springframework.ai.chat.model.ChatModel chatModel = DeepSeekChatAction.CHAT_MODEL.createChatModel(\n mockedInputParameters, mockedConnectionParameters, true);\n\n assertNotNull(chatModel);\n assertInstanceOf(DeepSeekChatModel.class, chatModel);\n\n DeepSeekChatOptions options = (DeepSeekChatOptions) chatModel.getDefaultOptions();\n\n assertEquals(\"deepseek-chat\", options.getModel());\n assertEquals(0.7, options.getTemperature());\n assertEquals(1000, options.getMaxTokens());\n assertEquals(0.9, options.getTopP());\n assertEquals(0.5, options.getFrequencyPenalty());\n assertEquals(0.3, options.getPresencePenalty());\n assertEquals(List.of(\"stop\"), options.getStop());\n\n ResponseFormat responseFormat = options.getResponseFormat();\n\n assertNotNull(responseFormat);\n assertEquals(ResponseFormat.Type.JSON_OBJECT, responseFormat.getType());\n }\n\n @Test\n void testCreateChatModelWithoutResponseFormat() {\n Parameters mockedInputParameters = MockParametersFactory.create(\n Map.of(MODEL, \"deepseek-chat\", TEMPERATURE, 0.7, MAX_TOKENS, 1000, TOP_P, 0.9, FREQUENCY_PENALTY, 0.5,\n PRESENCE_PENALTY, 0.3, STOP, List.of(\"stop\")));\n\n org.springframework.ai.chat.model.ChatModel chatModel = DeepSeekChatAction.CHAT_MODEL.createChatModel(\n mockedInputParameters, mockedConnectionParameters, false);\n\n assertNotNull(chatModel);\n assertInstanceOf(DeepSeekChatModel.class, chatModel);\n\n DeepSeekChatOptions options = (DeepSeekChatOptions) chatModel.getDefaultOptions();\n\n assertEquals(\"deepseek-chat\", options.getModel());\n assertEquals(0.7, options.getTemperature());\n assertEquals(1000, options.getMaxTokens());\n assertEquals(0.9, options.getTopP());\n assertEquals(0.5, options.getFrequencyPenalty());\n assertEquals(0.3, options.getPresencePenalty());\n assertEquals(List.of(\"stop\"), options.getStop());\n assertNull(options.getResponseFormat());\n }\n}\n"}, "054cf335b98d08350354ce1c20817d07475d42b9": {"t": 1785759921.410272, "n": 7173, "h": "f68cde758e88a3c9", "c": "/*\n * Copyright 2025 ByteChef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.bytechef.component.ai.llm.deepseek.action;\n\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.FREQUENCY_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MAX_TOKENS;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.MODEL;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.PRESENCE_PENALTY;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.RESPONSE_FORMAT;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.STOP;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TEMPERATURE;\nimport static com.bytechef.component.ai.llm.constant.LLMConstants.TOP_P;\nimport static com.bytechef.component.definition.Authorization.TOKEN;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertInstanceOf;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.mockito.ArgumentCaptor.forClass;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.mockStatic;\nimport static org.mockito.Mockito.when;\n\nimport com.bytechef.component.ai.llm.ChatModel;\nimport com.bytechef.component.ai.llm.util.ModelUtils;\nimport com.bytechef.component.definition.Parameters;\nimport com.bytechef.component.test.definition.MockParametersFactory;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.MockedStatic;\nimport org.springframework.ai.deepseek.DeepSeekChatModel;\nimport org.springframework.ai.deepseek.DeepSeekChatOptions;\nimport org.springframework.ai.deepseek.api.DeepSeekApi;\nimport org.springframework.ai.deepseek.api.ResponseFormat;\nimport org.springframework.web.client.RestClient;\n\n/**\n * @author Nikolina Spehar\n */\nclass DeepSeekChatActionTest {\n\n private final RestClient.Builder mockRestClientBuilder = mock(RestClient.Builder.class);\n private final Parameters mockedConnectionParameters = MockParametersFactory.create(Map.of(TOKEN, \"TOKEN\"));\n private final ArgumentCaptor<String> stringArgumentCaptor = forClass(String.class);\n private final ArgumentCaptor<RestClient.Builder> restClientBuilderArgumentCaptor =\n forClass(RestClient.Builder.class);\n private MockedStatic<DeepSeekApi> deepSeekApiMockedStatic;\n private MockedStatic<ModelUtils> modelUtilsMockedStatic;\n\n @BeforeEach\n void beforeEach() {\n deepSeekApiMockedStatic = mockStatic(DeepSeekApi.class);\n modelUtilsMockedStatic = mockStatic(ModelUtils.class);\n\n modelUtilsMockedStatic.when(ModelUtils::getRestClientBuilder)\n .thenReturn(mockRestClientBuilder);\n\n DeepSeekApi.Builder mockedApiBuilder = mock(DeepSeekApi.Builder.class);\n DeepSeekApi mockedApi = mock(DeepSeekApi.class);\n\n deepSeekApiMockedStatic.when(DeepSeekApi::builder)\n .thenReturn(mockedApiBuilder);\n\n when(mockedApiBuilder.apiKey(stringArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.baseUrl(stringArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.restClientBuilder(restClientBuilderArgumentCaptor.capture()))\n .thenReturn(mockedApiBuilder);\n when(mockedApiBuilder.build())\n .thenReturn(mockedApi);\n }\n\n @AfterEach\n void afterEach() {\n assertEquals(List.of(\"TOKEN\", \"https://api.deepseek.com\"), stringArgumentCaptor.getAllValues());\n assertEquals(mockRestClientBuilder, restClientBuilderArgumentCaptor.getValue());\n\n deepSeekApiMockedStatic.close();\n modelUtilsMockedStatic.close();\n }\n\n @Test\n void testCreateChatModelWithResponseFormat() {\n Parameters mockedInputParameters = MockParametersFactory.create(\n Map.of(\n RESPONSE, Map.of(RESPONSE_FORMAT, ChatModel.ResponseFormat.JSON.name()),\n MODEL, \"deepseek-chat\",\n TEMPERATURE, 0.7,\n MAX_TOKENS, 1000,\n TOP_P, 0.9,\n FREQUENCY_PENALTY, 0.5,\n PRESENCE_PENALTY, 0.3,\n STOP, List.of(\"stop\")));\n\n org.springframework.ai.chat.model.ChatModel chatModel = DeepSeekChatAction.CHAT_MODEL.createChatModel(\n mockedInputParameters, mockedConnectionParameters, true);\n\n assertNotNull(chatModel);\n assertInstanceOf(DeepSeekChatModel.class, chatModel);\n\n DeepSeekChatOptions options = (DeepSeekChatOptions) chatModel.getDefaultOptions();\n\n assertEquals(\"deepseek-chat\", options.getModel());\n assertEquals(0.7, options.getTemperature());\n assertEquals(1000, options.getMaxTokens());\n assertEquals(0.9, options.getTopP());\n assertEquals(0.5, options.getFrequencyPenalty());\n assertEquals(0.3, options.getPresencePenalty());\n assertEquals(List.of(\"stop\"), options.getStop());\n\n ResponseFormat responseFormat = options.getResponseFormat();\n\n assertNotNull(responseFormat);\n assertEquals(ResponseFormat.Type.JSON_OBJECT, responseFormat.getType());\n }\n\n @Test\n void testCreateChatModelWithoutResponseFormat() {\n Parameters mockedInputParameters = MockParametersFactory.create(\n Map.of(\n MODEL, \"deepseek-chat\",\n TEMPERATURE, 0.7,\n MAX_TOKENS, 1000,\n TOP_P, 0.9,\n FREQUENCY_PENALTY, 0.5,\n PRESENCE_PENALTY, 0.3,\n STOP, List.of(\"stop\")));\n\n org.springframework.ai.chat.model.ChatModel chatModel = DeepSeekChatAction.CHAT_MODEL.createChatModel(\n mockedInputParameters, mockedConnectionParameters, false);\n\n assertNotNull(chatModel);\n assertInstanceOf(DeepSeekChatModel.class, chatModel);\n\n DeepSeekChatOptions options = (DeepSeekChatOptions) chatModel.getDefaultOptions();\n\n assertEquals(\"deepseek-chat\", options.getModel());\n assertEquals(0.7, options.getTemperature());\n assertEquals(1000, options.getMaxTokens());\n assertEquals(0.9, options.getTopP());\n assertEquals(0.5, options.getFrequencyPenalty());\n assertEquals(0.3, options.getPresencePenalty());\n assertEquals(List.of(\"stop\"), options.getStop());\n assertNull(options.getResponseFormat());\n }\n}\n"}}}} |