-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(ai): add DeepSeek AI integrations #41087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release
Are you sure you want to change the base?
feat(ai): add DeepSeek AI integrations #41087
Conversation
WalkthroughThis update introduces a new Deepseek AI plugin to the system. It adds all necessary backend Java classes, constants, models, utilities, and configuration files for plugin registration, execution, and editor UI integration. The change also includes a database migration for plugin installation and comprehensive unit tests for plugin functionality and command logic. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant DeepseekAiPlugin
participant DeepseekAiPluginExecutor
participant Deepseek AI API
User->>UI: Configure and trigger action
UI->>DeepseekAiPlugin: Submit action request
DeepseekAiPlugin->>DeepseekAiPluginExecutor: Execute action
DeepseekAiPluginExecutor->>Deepseek AI API: Send HTTP request (with Bearer token)
Deepseek AI API-->>DeepseekAiPluginExecutor: Return response
DeepseekAiPluginExecutor-->>DeepseekAiPlugin: Process and return result
DeepseekAiPlugin-->>UI: Return execution result
UI-->>User: Display AI response
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 19
🧹 Nitpick comments (13)
app/server/.vscode/settings.json (1)
1-3
: Consider moving IDE-specific settings out of the repo or scope-widening them
.vscode
configs are usually developer- or workspace-specific. Checking them in at a nested path (app/server/.vscode
) risks:• Diverging configs across modules.
• Accidental overrides of a contributor’s personal settings.
• Forcing 4 GiB heap (-Xmx4G
) on lower-spec laptops.Options:
- Put a single repo-root
.vscode/settings.json
and document the memory flag as a recommendation.- Keep IDE hints in the wiki /
CONTRIBUTING.md
and add.vscode/
to.gitignore
.Up to you, but worth a quick team sync before merging.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIConstants.java (2)
44-46
: Consider reducing the in-memory size limit.100MB seems excessive for typical AI API responses. Consider a more conservative limit like 10-20MB to prevent memory issues under load.
- public static final ExchangeStrategies EXCHANGE_STRATEGIES = ExchangeStrategies.builder() - .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(/* 100MB */ 100 * 1024 * 1024)) - .build(); + public static final ExchangeStrategies EXCHANGE_STRATEGIES = ExchangeStrategies.builder() + .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(/* 20MB */ 20 * 1024 * 1024)) + .build();
8-8
: Consider environment-specific configuration for the API host.Hard-coding the API host URL limits flexibility across environments. Consider making this configurable.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java (1)
68-71
: Rename variable for consistency.Using 'openAiHost' for Deepseek API is confusing.
- String openAiHost = datasourceConfiguration.getUrl(); - if (!StringUtils.hasText(openAiHost)) { - openAiHost = DEEPSEEK_AI_HOST; // fallback to default if not configured - } + String deepseekHost = datasourceConfiguration.getUrl(); + if (!StringUtils.hasText(deepseekHost)) { + deepseekHost = DEEPSEEK_AI_HOST; // fallback to default if not configured + }Also update usages on lines 73, 75, and 77:
- return URI.create(openAiHost + CHAT_ENDPOINT); + return URI.create(deepseekHost + CHAT_ENDPOINT);app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/Role.java (1)
3-8
: Add documentation for role definitions.Consider adding Javadoc to explain the purpose of each role.
+/** + * Represents the role of a message in a chat conversation. + */ public enum Role { + /** System instructions or context */ system, + /** User input or questions */ user, + /** AI assistant responses */ assistant, + /** Tool/function call results */ tool }app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/FormatRequestDTO.java (2)
1-1
: Remove empty line at file start.- package com.external.plugins.models;
9-12
: Consider field visibility and validation.The field should be private and consider adding validation for allowed format types.
@Getter @Setter public class FormatRequestDTO { - String type = "text"; + private String type = "text"; + + /** + * Validates and sets the response format type. + * @param type Must be "text" or "json_object" + */ + public void setType(String type) { + if (type != null && !type.equals("text") && !type.equals("json_object")) { + throw new IllegalArgumentException("Invalid format type. Must be 'text' or 'json_object'"); + } + this.type = type; + } }app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/AIRequestDTO.java (1)
10-10
: Add explicit access modifier to the model field.The
model
field should have an explicit access modifier for clarity. Consider making itprivate
to follow encapsulation principles.- String model; + private String model;app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatMessage.java (1)
10-12
: Add explicit access modifiers to fields.Both fields should have explicit access modifiers for better encapsulation and code clarity.
- Role role; - String content; + private Role role; + private String content;app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/form.json (1)
26-34
: Consider conditional visibility for API Key field.The API Key field is always required, even when "No Auth" is selected. Consider adding conditional visibility to hide this field when authentication is not needed.
"label": "API Key", "configProperty": "datasourceConfiguration.authentication.bearerToken", "controlType": "INPUT_TEXT", "dataType": "PASSWORD", "initialValue": "", "isRequired": true, - "encrypted": true + "encrypted": true, + "conditional": { + "path": "datasourceConfiguration.authentication.authenticationType", + "eq": "bearerToken" + }app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java (1)
31-31
: Address the TODO comment for tools functionality.The TODO comment indicates missing tools implementation. Consider creating a follow-up task to implement this feature.
app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java (1)
25-26
: Consider adding rollback implementation.The empty rollback method is acceptable for plugin additions, but consider implementing it for better migration safety.
app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/ChatCommandTest.java (1)
83-145
: Consider using DeepSeek-specific models for testing.The test includes many OpenAI models that may not be relevant to DeepSeek AI. Consider focusing on DeepSeek-specific models for more accurate testing.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
app/server/.vscode/settings.json
(1 hunks)app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/PluginConstants.java
(2 hunks)app/server/appsmith-plugins/deepseekAiPlugin/pom.xml
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/AICommand.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIConstants.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIErrorMessages.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/AIRequestDTO.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatMessage.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/FormatRequestDTO.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/Role.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/AIMethodStrategy.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/editor/root.json
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/form.json
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/plugin.properties
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/AIPluginTest.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/ChatCommandTest.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java
(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Pull request titles in the Appsmith codebase should follow the Conventional Commits specification, using the format 'type(scope): description' with valid types such as feat, fix, docs, style, refactor, perf, test, build, ci, chore, and revert.
app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java (2)
Learnt from: trishaanand
PR: appsmithorg/appsmith#30087
File: app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration043AddIndexActionCollectionPageID.java:27-28
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The user has clarified that the migration `Migration043AddIndexActionCollectionPageID` is not critical and does not require a rollback strategy.
Learnt from: trishaanand
PR: appsmithorg/appsmith#30087
File: app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration043AddIndexActionCollectionPageID.java:27-28
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The user has clarified that the migration `Migration043AddIndexActionCollectionPageID` is not critical and does not require a rollback strategy.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java (2)
Learnt from: sondermanish
PR: appsmithorg/appsmith#36413
File: app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/ImportServiceCEImpl.java:514-518
Timestamp: 2024-09-20T07:55:30.235Z
Learning: In the `ImportServiceCEImpl` class, when throwing new `AppsmithException` instances, avoid adding the original `Throwable` as the cause due to messaging constraints.
Learnt from: sondermanish
PR: appsmithorg/appsmith#36413
File: app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/ImportServiceCEImpl.java:514-518
Timestamp: 2024-10-08T15:32:34.114Z
Learning: In the `ImportServiceCEImpl` class, when throwing new `AppsmithException` instances, avoid adding the original `Throwable` as the cause due to messaging constraints.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIErrorMessages.java (1)
Learnt from: ashit-rath
PR: appsmithorg/appsmith#36926
File: app/client/src/ce/pages/Editor/IDE/Header/useLibraryHeaderTitle.ts:1-1
Timestamp: 2024-10-22T04:46:13.268Z
Learning: In this project, importing constants from 'ee/constants/messages' in CE files is a known and acceptable pattern.
app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/ChatCommandTest.java (2)
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/utils/autocomplete/__tests__/TernServer.test.ts:254-0
Timestamp: 2024-07-26T21:12:57.228Z
Learning: Integration tests cover the `hasCreateDSActionPermissionInApp` function, as clarified by the user.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/utils/autocomplete/__tests__/TernServer.test.ts:254-0
Timestamp: 2024-10-08T15:32:34.115Z
Learning: Integration tests cover the `hasCreateDSActionPermissionInApp` function, as clarified by the user.
app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/AIPluginTest.java (4)
Learnt from: NilanshBansal
PR: appsmithorg/appsmith#37106
File: app/server/appsmith-plugins/redisPlugin/src/test/java/com/external/plugins/RedisPluginTest.java:277-287
Timestamp: 2024-11-18T10:40:04.648Z
Learning: When testing with mock certificates in `RedisPluginTest.java`, additional assertions for verifying the connection's security, TLS handshake, and certificate usage are not required.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/utils/autocomplete/__tests__/TernServer.test.ts:254-0
Timestamp: 2024-07-26T21:12:57.228Z
Learning: Integration tests cover the `hasCreateDSActionPermissionInApp` function, as clarified by the user.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/utils/autocomplete/__tests__/TernServer.test.ts:254-0
Timestamp: 2024-10-08T15:32:34.115Z
Learning: Integration tests cover the `hasCreateDSActionPermissionInApp` function, as clarified by the user.
Learnt from: NilanshBansal
PR: appsmithorg/appsmith#33641
File: app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CacheableRepositoryHelperCE.java:23-25
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The new methods `fetchDefaultTenant` and `evictCachedTenant` in the `CacheableRepositoryHelperCE` interface are covered by existing and new tests, as confirmed by NilanshBansal.
🧬 Code Graph Analysis (3)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatMessage.java (2)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java (1)
Getter
(8-33)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/AIRequestDTO.java (1)
Getter
(6-11)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/FormatRequestDTO.java (1)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java (1)
Getter
(8-33)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java (2)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIConstants.java (1)
DeepseekAIConstants
(5-47)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIErrorMessages.java (1)
DeepseekAIErrorMessages
(3-32)
🔇 Additional comments (15)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/plugin.properties (1)
1-6
: LGTM!Plugin properties are correctly configured.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/AIRequestDTO.java (1)
8-11
: Simple and effective base DTO design.The minimalist approach is appropriate for a base class that will be extended by more specific request DTOs.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatMessage.java (1)
8-13
: Well-designed chat message model.The class structure is clean and appropriate for representing chat messages with role-based content. The use of an enum for roles provides type safety.
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/PluginConstants.java (2)
28-28
: Consistent plugin package naming.The package name follows the established pattern of other AI plugins in the codebase.
60-60
: Clear and descriptive plugin name.The plugin name "DeepSeek AI" is clear and follows the naming convention used by other AI plugins.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/form.json (1)
1-47
: Well-structured datasource configuration form.The form configuration follows established patterns and provides all necessary fields for DeepSeek AI integration with appropriate defaults and validation.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java (1)
23-35
: Solid validation and error handling approach.The method provides good validation of the input format and proper error handling using the established exception patterns. The use of constants for error messages is consistent with the codebase.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/setting.json (1)
1-47
: Configuration looks good with standard settings.The JSON schema is well-structured with appropriate defaults and control types for the three core settings.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java (1)
10-33
: DTO structure is well-designed with appropriate defaults.The class properly extends AIRequestDTO and includes all necessary chat parameters with sensible default values.
app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java (1)
28-49
: Migration structure follows best practices.Proper error handling for duplicate keys and workspace installation integration.
app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/ChatCommandTest.java (1)
23-156
: Comprehensive test coverage with clean structure.The test class provides excellent coverage of ChatCommand functionality with proper assertions and setup.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/AIMethodStrategy.java (1)
21-36
: Well-designed strategy pattern with room for future expansion.The implementation properly validates form data and maintains extensibility for future AI command types while currently supporting the core ChatCommand functionality.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/AICommand.java (1)
11-26
: LGTM! Well-designed command interface.The interface follows the command pattern appropriately with clear method contracts for trigger/execution phases.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/editor/root.json (1)
1-186
: LGTM! Comprehensive editor configuration.The UI configuration is well-structured with appropriate validation rules, tooltips, and default values for all chat model parameters.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java (1)
59-122
: LGTM! Well-implemented command with proper validation.The implementation correctly handles all chat parameters with appropriate defaults and error handling. The delegation to utility methods for common operations is a good design choice.
...appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
Outdated
Show resolved
Hide resolved
...appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
Outdated
Show resolved
Hide resolved
...appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
Outdated
Show resolved
Hide resolved
...appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
Outdated
Show resolved
Hide resolved
if (messages.containsKey(VIEW_TYPE) && JSON.equals(messages.get(VIEW_TYPE))) { | ||
// data is present in data key as String | ||
return gson.fromJson((String) messages.get(DATA), listType); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add null checks and safe casting for JSON deserialization.
The code assumes messages.get(DATA)
returns a String, but this could fail if the value is null or not a String.
if (messages.containsKey(VIEW_TYPE) && JSON.equals(messages.get(VIEW_TYPE))) {
// data is present in data key as String
- return gson.fromJson((String) messages.get(DATA), listType);
+ Object dataValue = messages.get(DATA);
+ if (dataValue instanceof String) {
+ return gson.fromJson((String) dataValue, listType);
+ } else {
+ throw new AppsmithPluginException(
+ AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
+ String.format(STRING_APPENDER, EXECUTION_FAILURE, INCORRECT_MESSAGE_FORMAT));
+ }
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (messages.containsKey(VIEW_TYPE) && JSON.equals(messages.get(VIEW_TYPE))) { | |
// data is present in data key as String | |
return gson.fromJson((String) messages.get(DATA), listType); | |
} | |
if (messages.containsKey(VIEW_TYPE) && JSON.equals(messages.get(VIEW_TYPE))) { | |
// data is present in data key as String | |
Object dataValue = messages.get(DATA); | |
if (dataValue instanceof String) { | |
return gson.fromJson((String) dataValue, listType); | |
} else { | |
throw new AppsmithPluginException( | |
AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, | |
String.format(STRING_APPENDER, EXECUTION_FAILURE, INCORRECT_MESSAGE_FORMAT)); | |
} | |
} |
🤖 Prompt for AI Agents
In
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java
around lines 30 to 33, the code assumes messages.get(DATA) is a non-null String,
which can cause errors if it is null or of a different type. Add a null check to
ensure messages.get(DATA) is not null, and verify its type before casting to
String. Only proceed with gson.fromJson if these conditions are met to safely
deserialize the JSON.
if (!jsonObject.has(DATA) && jsonObject.get(DATA) instanceof JSONArray) { | ||
// let's throw some error. | ||
throw Exceptions.propagate( | ||
new AppsmithPluginException(AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix logic error in condition.
The condition should use OR (||) instead of AND (&&).
-if (!jsonObject.has(DATA) && jsonObject.get(DATA) instanceof JSONArray) {
+if (!jsonObject.has(DATA) || !(jsonObject.get(DATA) instanceof JSONArray)) {
// let's throw some error.
throw Exceptions.propagate(
new AppsmithPluginException(AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR));
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (!jsonObject.has(DATA) && jsonObject.get(DATA) instanceof JSONArray) { | |
// let's throw some error. | |
throw Exceptions.propagate( | |
new AppsmithPluginException(AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR)); | |
} | |
if (!jsonObject.has(DATA) || !(jsonObject.get(DATA) instanceof JSONArray)) { | |
// let's throw some error. | |
throw Exceptions.propagate( | |
new AppsmithPluginException(AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR)); | |
} |
🤖 Prompt for AI Agents
In
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
around lines 253 to 257, the if condition incorrectly uses AND (&&) to check if
jsonObject does not have DATA and if jsonObject.get(DATA) is an instance of
JSONArray. Change the logical operator to OR (||) so the condition correctly
triggers when either jsonObject lacks DATA or jsonObject.get(DATA) is a
JSONArray, then throw the AppsmithPluginException as intended.
AICommand AICommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson); | ||
|
||
// morph the essentials | ||
AIRequestDTO AIRequestDTO = AICommand.makeRequestBody(actionConfiguration); | ||
URI uri = AICommand.createExecutionUri(datasourceConfiguration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow Java naming conventions for variables.
Variables should use camelCase, not PascalCase.
-AICommand AICommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson);
+AICommand aiCommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson);
// morph the essentials
-AIRequestDTO AIRequestDTO = AICommand.makeRequestBody(actionConfiguration);
-URI uri = AICommand.createExecutionUri(datasourceConfiguration);
-HttpMethod httpMethod = AICommand.getExecutionMethod();
+AIRequestDTO aiRequestDTO = aiCommand.makeRequestBody(actionConfiguration);
+URI uri = aiCommand.createExecutionUri(datasourceConfiguration);
+HttpMethod httpMethod = aiCommand.getExecutionMethod();
Update line 117 accordingly:
-return RequestUtils.makeRequest(httpMethod, uri, bearerTokenAuth, BodyInserters.fromValue(AIRequestDTO))
+return RequestUtils.makeRequest(httpMethod, uri, bearerTokenAuth, BodyInserters.fromValue(aiRequestDTO))
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
AICommand AICommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson); | |
// morph the essentials | |
AIRequestDTO AIRequestDTO = AICommand.makeRequestBody(actionConfiguration); | |
URI uri = AICommand.createExecutionUri(datasourceConfiguration); | |
AICommand aiCommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson); | |
// morph the essentials | |
AIRequestDTO aiRequestDTO = aiCommand.makeRequestBody(actionConfiguration); | |
URI uri = aiCommand.createExecutionUri(datasourceConfiguration); | |
HttpMethod httpMethod = aiCommand.getExecutionMethod(); | |
return RequestUtils.makeRequest( | |
httpMethod, | |
uri, | |
bearerTokenAuth, | |
BodyInserters.fromValue(aiRequestDTO) | |
); |
🤖 Prompt for AI Agents
In
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
around lines 104 to 108, the variables AICommand and AIRequestDTO use PascalCase
which violates Java naming conventions. Rename these variables to aiCommand and
aiRequestDTO respectively to follow camelCase naming conventions for variables.
...r/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
Outdated
Show resolved
Hide resolved
AICommand AICommand = AIMethodStrategy.selectTriggerMethod(request, gson); | ||
HttpMethod httpMethod = AICommand.getTriggerHTTPMethod(); | ||
URI uri = AICommand.createTriggerUri(datasourceConfiguration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow Java naming conventions for variables.
Variable should use camelCase.
-AICommand AICommand = AIMethodStrategy.selectTriggerMethod(request, gson);
-HttpMethod httpMethod = AICommand.getTriggerHTTPMethod();
-URI uri = AICommand.createTriggerUri(datasourceConfiguration);
+AICommand aiCommand = AIMethodStrategy.selectTriggerMethod(request, gson);
+HttpMethod httpMethod = aiCommand.getTriggerHTTPMethod();
+URI uri = aiCommand.createTriggerUri(datasourceConfiguration);
Also update references on lines 269 and 280:
-if (AICommand.isModelCompatible(model)) {
+if (aiCommand.isModelCompatible(model)) {
-.map(model -> AICommand.getModelMap(modelsMap.get(model)))
+.map(model -> aiCommand.getModelMap(modelsMap.get(model)))
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
AICommand AICommand = AIMethodStrategy.selectTriggerMethod(request, gson); | |
HttpMethod httpMethod = AICommand.getTriggerHTTPMethod(); | |
URI uri = AICommand.createTriggerUri(datasourceConfiguration); | |
AICommand aiCommand = AIMethodStrategy.selectTriggerMethod(request, gson); | |
HttpMethod httpMethod = aiCommand.getTriggerHTTPMethod(); | |
URI uri = aiCommand.createTriggerUri(datasourceConfiguration); |
🤖 Prompt for AI Agents
In
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
around lines 223 to 225, rename the variable AICommand to aiCommand to follow
Java camelCase naming conventions. Also update all references to this variable
on lines 269 and 280 accordingly to use the new camelCase name.
@@ -0,0 +1,313 @@ | |||
package com.external.plugins; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify IconLocation property in migration file.
The PR objectives mention an IconLocation property pointing to an external URL that needs updating.
🏁 Script executed:
#!/bin/bash
# Description: Search for IconLocation property and external URL references in migration files
rg -A 3 -B 3 "IconLocation|assets\.appsmith\.com" --glob "*Migration074*"
Length of output: 1339
🏁 Script executed:
#!/bin/bash
# Locate Deepseek AI plugin definition in baseline plugin.jsonl to get the correct icon URL
rg -A5 -B5 '"deepseekAi"' deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl
Length of output: 82
Update Deepseek AI Plugin Icon URL in Migration and Baseline JSON
- In
app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java
replace the external Hugging Face URL in
plugin.setIconLocation(...)
with the Appsmith assets S3 URL. For example:// before
- plugin.setIconLocation("https://cdn-avatars.huggingface.co/v1/production/uploads/6538815d1bdb3c40db94fbfa/xMBly9PUMphrFVMxLX4kq.png");
// after
- plugin.setIconLocation("https://s3.us-east-2.amazonaws.com/assets.appsmith.com/plugins/deepseek-ai.png");
- Ensure the CE baseline plugin definitions at
`deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl`
include a matching Deepseek AI entry with the same `iconLocation`. If it’s missing, add or update:
```jsonl
{
"id": "deepseekAi",
"name": "Deepseek AI",
"iconLocation": "https://s3.us-east-2.amazonaws.com/assets.appsmith.com/plugins/deepseek-ai.png",
…
}
🤖 Prompt for AI Agents
In
appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
at line 1, update the Deepseek AI plugin icon URL in the migration file
appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java
by replacing the external Hugging Face URL in the plugin.setIconLocation(...)
call with the Appsmith assets S3 URL
"https://s3.us-east-2.amazonaws.com/assets.appsmith.com/plugins/deepseek-ai.png".
Also, verify that the CE baseline plugin definitions file
deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl contains a matching
Deepseek AI entry with the same iconLocation URL; if missing, add or update this
entry accordingly.
a4f67e8
to
10de1e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (4)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java (4)
104-104
: Fix Java naming convention violation.Variable should use camelCase, not PascalCase.
-AICommand aICommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson); +AICommand aiCommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson);
107-109
: Fix Java naming convention violation.Variable should use camelCase, not PascalCase.
-AIRequestDTO aIRequestDTO = aICommand.makeRequestBody(actionConfiguration); -URI uri = aICommand.createExecutionUri(datasourceConfiguration); -HttpMethod httpMethod = aICommand.getExecutionMethod(); +AIRequestDTO aiRequestDTO = aiCommand.makeRequestBody(actionConfiguration); +URI uri = aiCommand.createExecutionUri(datasourceConfiguration); +HttpMethod httpMethod = aiCommand.getExecutionMethod();Also update line 117:
-return RequestUtils.makeRequest(httpMethod, uri, bearerTokenAuth, BodyInserters.fromValue(aIRequestDTO)) +return RequestUtils.makeRequest(httpMethod, uri, bearerTokenAuth, BodyInserters.fromValue(aiRequestDTO))
223-225
: Fix Java naming convention violation.Variable should use camelCase, not PascalCase.
-AICommand aICommand = AIMethodStrategy.selectTriggerMethod(request, gson); -HttpMethod httpMethod = aICommand.getTriggerHTTPMethod(); -URI uri = aICommand.createTriggerUri(datasourceConfiguration); +AICommand aiCommand = AIMethodStrategy.selectTriggerMethod(request, gson); +HttpMethod httpMethod = aiCommand.getTriggerHTTPMethod(); +URI uri = aiCommand.createTriggerUri(datasourceConfiguration);Also update references on lines 269 and 280:
-if (aICommand.isModelCompatible(model)) { +if (aiCommand.isModelCompatible(model)) {-.map(model -> aICommand.getModelMap(modelsMap.get(model))) +.map(model -> aiCommand.getModelMap(modelsMap.get(model)))
253-257
: Fix logic error in condition.The condition should check if DATA is missing OR if DATA is NOT a JSONArray, since line 261 expects DATA to be a JSONArray.
-if (!jsonObject.has(DATA) || jsonObject.get(DATA) instanceof JSONArray) { +if (!jsonObject.has(DATA) || !(jsonObject.get(DATA) instanceof JSONArray)) { // let's throw some error. throw Exceptions.propagate( new AppsmithPluginException(AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR)); }
🧹 Nitpick comments (4)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java (1)
292-292
: Fix formatting: add space after comma.-URI uri = RequestUtils.createUriFromCommand(MODEL,datasourceConfiguration); +URI uri = RequestUtils.createUriFromCommand(MODEL, datasourceConfiguration);app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/AIPluginTest.java (3)
27-27
: Consider renaming the test class for better specificity.The class name
AIPluginTest
is quite generic. Consider renaming toDeepseekAiPluginTest
to clearly indicate which plugin is being tested.-public class AIPluginTest { +public class DeepseekAiPluginTest {
31-47
: Consider extracting MockSharedConfig for reusability.The
MockSharedConfig
inner class could be extracted to a separate test utility class if other plugin tests need similar mock configurations.
88-88
: Remove Chinese comments from the codebase.Replace the Chinese comments with English equivalents for consistency with the codebase standards.
- // 修复:使用 mockEndpoint 的 URL + // Fix: Use mockEndpoint URL- // 修复:使用 mockEndpoint 的 URL + // Fix: Use mockEndpoint URLAlso applies to: 111-111
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/PluginConstants.java
(2 hunks)app/server/appsmith-plugins/deepseekAiPlugin/pom.xml
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/AICommand.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIConstants.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIErrorMessages.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/AIRequestDTO.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatMessage.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/FormatRequestDTO.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/Role.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/AIMethodStrategy.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/editor/root.json
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/form.json
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/plugin.properties
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/AIPluginTest.java
(1 hunks)app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/ChatCommandTest.java
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- app/server/appsmith-plugins/deepseekAiPlugin/pom.xml
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/RequestUtils.java
🚧 Files skipped from review as they are similar to previous changes (18)
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/Role.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/AIRequestDTO.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatMessage.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/plugin.properties
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/FormatRequestDTO.java
- app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/PluginConstants.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/setting.json
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/form.json
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/MessageUtils.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIConstants.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/AICommand.java
- app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration074AddDeepseekAIPlugin.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/models/ChatRequestDTO.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/constants/DeepseekAIErrorMessages.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/resources/editor/root.json
- app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/utils/AIMethodStrategy.java
- app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/ChatCommandTest.java
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Pull request titles in the Appsmith codebase should follow the Conventional Commits specification, using the format 'type(scope): description' with valid types such as feat, fix, docs, style, refactor, perf, test, build, ci, chore, and revert.
app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/AIPluginTest.java (13)
Learnt from: NilanshBansal
PR: appsmithorg/appsmith#37106
File: app/server/appsmith-plugins/redisPlugin/src/test/java/com/external/plugins/RedisPluginTest.java:277-287
Timestamp: 2024-11-18T10:40:04.648Z
Learning: When testing with mock certificates in `RedisPluginTest.java`, additional assertions for verifying the connection's security, TLS handshake, and certificate usage are not required.
Learnt from: NilanshBansal
PR: appsmithorg/appsmith#33641
File: app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CacheableRepositoryHelperCE.java:23-25
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The new methods `fetchDefaultTenant` and `evictCachedTenant` in the `CacheableRepositoryHelperCE` interface are covered by existing and new tests, as confirmed by NilanshBansal.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/utils/autocomplete/__tests__/TernServer.test.ts:254-0
Timestamp: 2024-07-26T21:12:57.228Z
Learning: Integration tests cover the `hasCreateDSActionPermissionInApp` function, as clarified by the user.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/utils/autocomplete/__tests__/TernServer.test.ts:254-0
Timestamp: 2024-10-08T15:32:34.115Z
Learning: Integration tests cover the `hasCreateDSActionPermissionInApp` function, as clarified by the user.
Learnt from: brayn003
PR: appsmithorg/appsmith#40462
File: app/client/src/instrumentation/index.ts:0-0
Timestamp: 2025-04-29T09:12:14.552Z
Learning: Only comment on files that are directly related to the PR's objectives, even if other files appear in the diff. For PR #40462, the focus is on the import override feature for artifacts, not on instrumentation or telemetry files.
Learnt from: abhvsn
PR: appsmithorg/appsmith#36596
File: app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java:475-475
Timestamp: 2024-10-04T05:51:15.138Z
Learning: In `app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java`, the variable `newsletterSignedUpUserEmail` is always expected to be non-null because the user's email is always present in the user object, so an additional null check is unnecessary.
Learnt from: sondermanish
PR: appsmithorg/appsmith#36413
File: app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/ImportServiceCEImpl.java:514-518
Timestamp: 2024-09-20T07:55:30.235Z
Learning: In the `ImportServiceCEImpl` class, when throwing new `AppsmithException` instances, avoid adding the original `Throwable` as the cause due to messaging constraints.
Learnt from: sondermanish
PR: appsmithorg/appsmith#36413
File: app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/ImportServiceCEImpl.java:514-518
Timestamp: 2024-10-08T15:32:34.114Z
Learning: In the `ImportServiceCEImpl` class, when throwing new `AppsmithException` instances, avoid adding the original `Throwable` as the cause due to messaging constraints.
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.md:0-0
Timestamp: 2025-06-30T09:25:58.488Z
Learning: Verify that new features are properly implemented and tested
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.md:0-0
Timestamp: 2025-06-30T09:25:58.488Z
Learning: Validate that new features are completely and correctly implemented
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Bug fixes should be verified to ensure they meet quality standards, including proper steps for fixing and validation of the fix.
Learnt from: abhishek-bandameedi
PR: appsmithorg/appsmith#35133
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBox2_spec.js:0-0
Timestamp: 2024-07-24T08:29:41.208Z
Learning: In Cypress tests for the Appsmith project, ensure the use of locator variables for selectors and include multiple assertions for comprehensive testing.
Learnt from: abhishek-bandameedi
PR: appsmithorg/appsmith#35133
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBox2_spec.js:0-0
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In Cypress tests for the Appsmith project, ensure the use of locator variables for selectors and include multiple assertions for comprehensive testing.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java (7)
Learnt from: sharat87
PR: appsmithorg/appsmith#39337
File: app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/ImportServiceCEImpl.java:154-160
Timestamp: 2025-02-18T15:18:20.927Z
Learning: Specific JSON parsing error handling using try-catch blocks isn't needed in the ImportServiceCEImpl's extractArtifactExchangeJson method as Mono.fromCallable provides adequate error handling.
Learnt from: sharat87
PR: appsmithorg/appsmith#37326
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:0-0
Timestamp: 2024-11-30T00:37:12.269Z
Learning: In `deploy/docker/fs/opt/appsmith/utils/bin/backup.js`, exception handling is performed outside the `executePostgresDumpCMD` function, so adding try-catch blocks within `executePostgresDumpCMD` that rethrow the error is unnecessary.
Learnt from: brayn003
PR: appsmithorg/appsmith#38060
File: app/client/src/git/sagas/deleteBranchSaga.ts:38-45
Timestamp: 2024-12-10T10:52:57.789Z
Learning: In the TypeScript file `app/client/src/git/sagas/deleteBranchSaga.ts`, within the `deleteBranchSaga` function, error handling is managed outside the scope of the catch block. Therefore, casting `error` to `string` in this context is acceptable.
Learnt from: abhvsn
PR: appsmithorg/appsmith#36458
File: deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl:17-18
Timestamp: 2024-09-20T14:55:06.929Z
Learning: In the product, icon URLs are referred to using 'https://s3.us-east-2.amazonaws.com/assets.appsmith.com/...'.
Learnt from: abhvsn
PR: appsmithorg/appsmith#36458
File: deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl:17-18
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In the product, icon URLs are referred to using 'https://s3.us-east-2.amazonaws.com/assets.appsmith.com/...'.
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Cursor AI rules for Appsmith are automatically triggered by pull request and file change events, and can also be manually invoked through specific commands such as 'validate_pr_title', 'verify_bug_fix', 'generate_tests', 'optimize_performance', and 'validate_feature'.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#37330
File: app/client/src/pages/Editor/gitSync/components/GitChangesList/StaticChange.tsx:52-52
Timestamp: 2024-11-12T07:37:42.598Z
Learning: The icon provider components in `app/client/packages/design-system/widgets-old/src/Icon/index.tsx` and `app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx` should provide both `settings-2-line` and `settings-v3` icons and should not be updated to remove the old icon.
🔇 Additional comments (1)
app/server/appsmith-plugins/deepseekAiPlugin/src/test/java/com/external/plugins/AIPluginTest.java (1)
62-126
: Well-structured test coverage with proper reactive testing.The test methods provide comprehensive coverage of the plugin's core functionality:
- Datasource validation with valid and invalid configurations
- Connection testing with success and failure scenarios
- Proper use of StepVerifier with
verifyComplete()
calls- Appropriate mock setup with MockWebServer
The tests effectively validate the plugin's behavior and integration with the Appsmith framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (4)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java (4)
102-102
: Follow Java naming conventions for variables.Variable should use camelCase, not PascalCase.
-AICommand aICommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson); +AICommand aiCommand = AIMethodStrategy.selectExecutionMethod(actionConfiguration, gson);
105-107
: Follow Java naming conventions for variables.Variables should use camelCase, not PascalCase.
-AIRequestDTO aIRequestDTO = aICommand.makeRequestBody(actionConfiguration); -URI uri = aICommand.createExecutionUri(datasourceConfiguration); -HttpMethod httpMethod = aICommand.getExecutionMethod(); +AIRequestDTO aiRequestDTO = aiCommand.makeRequestBody(actionConfiguration); +URI uri = aiCommand.createExecutionUri(datasourceConfiguration); +HttpMethod httpMethod = aiCommand.getExecutionMethod();Also update line 115:
-return RequestUtils.makeRequest(httpMethod, uri, bearerTokenAuth, BodyInserters.fromValue(aIRequestDTO)) +return RequestUtils.makeRequest(httpMethod, uri, bearerTokenAuth, BodyInserters.fromValue(aiRequestDTO))
221-221
: Follow Java naming conventions for variables.Variable should use camelCase.
-AICommand aICommand = AIMethodStrategy.selectTriggerMethod(request, gson); +AICommand aiCommand = AIMethodStrategy.selectTriggerMethod(request, gson);Also update references on lines 267 and 278:
-if (aICommand.isModelCompatible(model)) { +if (aiCommand.isModelCompatible(model)) {-.map(model -> aICommand.getModelMap(modelsMap.get(model))) +.map(model -> aiCommand.getModelMap(modelsMap.get(model)))
251-255
: Fix logic error in condition.The condition should use OR (||) instead of AND (&&).
-if (!jsonObject.has(DATA) && jsonObject.get(DATA) instanceof JSONArray) { +if (!jsonObject.has(DATA) || !(jsonObject.get(DATA) instanceof JSONArray)) { // let's throw some error. throw Exceptions.propagate( new AppsmithPluginException(AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR)); }
🧹 Nitpick comments (1)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java (1)
290-290
: Fix formatting: add missing space after comma.-URI uri = RequestUtils.createUriFromCommand(MODEL,datasourceConfiguration); +URI uri = RequestUtils.createUriFromCommand(MODEL, datasourceConfiguration);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Pull request titles in the Appsmith codebase should follow the Conventional Commits specification, using the format 'type(scope): description' with valid types such as feat, fix, docs, style, refactor, perf, test, build, ci, chore, and revert.
app/server/appsmith-plugins/deepseekAiPlugin/src/main/java/com/external/plugins/DeepseekAiPlugin.java (7)
Learnt from: sharat87
PR: appsmithorg/appsmith#39337
File: app/server/appsmith-server/src/main/java/com/appsmith/server/imports/internal/ImportServiceCEImpl.java:154-160
Timestamp: 2025-02-18T15:18:20.927Z
Learning: Specific JSON parsing error handling using try-catch blocks isn't needed in the ImportServiceCEImpl's extractArtifactExchangeJson method as Mono.fromCallable provides adequate error handling.
Learnt from: sharat87
PR: appsmithorg/appsmith#37326
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:0-0
Timestamp: 2024-11-30T00:37:12.269Z
Learning: In `deploy/docker/fs/opt/appsmith/utils/bin/backup.js`, exception handling is performed outside the `executePostgresDumpCMD` function, so adding try-catch blocks within `executePostgresDumpCMD` that rethrow the error is unnecessary.
Learnt from: brayn003
PR: appsmithorg/appsmith#38060
File: app/client/src/git/sagas/deleteBranchSaga.ts:38-45
Timestamp: 2024-12-10T10:52:57.789Z
Learning: In the TypeScript file `app/client/src/git/sagas/deleteBranchSaga.ts`, within the `deleteBranchSaga` function, error handling is managed outside the scope of the catch block. Therefore, casting `error` to `string` in this context is acceptable.
Learnt from: abhvsn
PR: appsmithorg/appsmith#36458
File: deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl:17-18
Timestamp: 2024-09-20T14:55:06.929Z
Learning: In the product, icon URLs are referred to using 'https://s3.us-east-2.amazonaws.com/assets.appsmith.com/...'.
Learnt from: abhvsn
PR: appsmithorg/appsmith#36458
File: deploy/docker/fs/opt/appsmith/baseline-ce/plugin.jsonl:17-18
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In the product, icon URLs are referred to using 'https://s3.us-east-2.amazonaws.com/assets.appsmith.com/...'.
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Cursor AI rules for Appsmith are automatically triggered by pull request and file change events, and can also be manually invoked through specific commands such as 'validate_pr_title', 'verify_bug_fix', 'generate_tests', 'optimize_performance', and 'validate_feature'.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#37330
File: app/client/src/pages/Editor/gitSync/components/GitChangesList/StaticChange.tsx:52-52
Timestamp: 2024-11-12T07:37:42.598Z
Learning: The icon provider components in `app/client/packages/design-system/widgets-old/src/Icon/index.tsx` and `app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx` should provide both `settings-2-line` and `settings-v3` icons and should not be updated to remove the old icon.
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Description
Tip
This commit integrates DeepSeek AI support into AppSmith, expanding its LLM connectivity. Broadening LLM integrations will enhance AppSmith's robustness and extensibility, strengthening its competitive edge.
This contribution aligns with my current work involving DeepSeek and addresses community requests for this integration.
https://github.com/appsmithorg/appsmith/issues/40678
https://github.com/appsmithorg/appsmith/issues/41006
Important Notes:
In com.appsmith.server.migrations.db.ce.Migration074AddDeepseekAIPlugin, the current IconLocation property references assets.appsmith.com. This must be updated before merging to use the correct local/plugin asset path.
Fixes #
Issue Number
Additional authentication methods and tooling support are architecturally reserved in this implementation and will be delivered in future iterations.
Automation
/ok-to-test tags=""
🔍 Cypress test results
Caution
If you modify the content in this section, you are likely to disrupt the CI result for your PR.
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
Chores