feat: add redux action to generate aiagent schemas (#39791)

## Description


Fixes #39781

## Automation

/ok-to-test tags="@tag.JS, @tag.Datasource"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]
> 🔴 🔴 🔴 Some tests have failed.
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13941556348>
> Commit: 658690724e2be068b5b5c0d8148619d5b0bf071d
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13941556348&attempt=3&selectiontype=test&testsstatus=failed&specsstatus=fail"
target="_blank">Cypress dashboard</a>.
> Tags: @tag.JS, @tag.Datasource
> Spec: 
> The following are new failures, please fix them before merging the PR:
<ol>
>
<li>cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts</ol>
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master"
target="_blank">List of identified flaky tests</a>.
> <hr>Wed, 19 Mar 2025 09:16:15 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced the AI agent schema generation process with improved status
tracking for initiation, cancellation, success, and error scenarios.
- Introduced refined state management to ensure a more responsive and
reliable experience during schema generation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ilia 2025-03-19 10:20:16 +01:00 committed by GitHub
parent 0695bb37c9
commit c82e795770
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -163,6 +163,24 @@ export const handlers = {
) => {
set(state, ["isSchemaGenerating", action.payload.id], false);
},
[ReduxActionTypes.GENERATE_AI_AGENT_SCHEMA_REQUEST]: (
state: PluginActionEditorState,
action: ReduxAction<{ id: string }>,
) => {
set(state, ["isSchemaGenerating", action.payload.id], true);
},
[ReduxActionTypes.GENERATE_AI_AGENT_SCHEMA_SUCCESS]: (
state: PluginActionEditorState,
action: ReduxAction<{ id: string }>,
) => {
set(state, ["isSchemaGenerating", action.payload.id], false);
},
[ReduxActionErrorTypes.GENERATE_AI_AGENT_SCHEMA_ERROR]: (
state: PluginActionEditorState,
action: ReduxAction<{ id: string }>,
) => {
set(state, ["isSchemaGenerating", action.payload.id], false);
},
[ReduxActionTypes.SET_PLUGIN_ACTION_EDITOR_FORM_SELECTED_TAB]: (
state: PluginActionEditorState,
action: ReduxAction<{ selectedTab: string }>,

View File

@ -720,6 +720,9 @@ const ActionExecutionTypes = {
"GENERATE_PLUGIN_ACTION_SCHEMA_CANCELLED",
GENERATE_PLUGIN_ACTION_SCHEMA_SUCCESS:
"GENERATE_PLUGIN_ACTION_SCHEMA_SUCCESS",
GENERATE_AI_AGENT_SCHEMA_REQUEST: "GENERATE_AI_AGENT_SCHEMA_REQUEST",
GENERATE_AI_AGENT_SCHEMA_CANCELLED: "GENERATE_AI_AGENT_SCHEMA_CANCELLED",
GENERATE_AI_AGENT_SCHEMA_SUCCESS: "GENERATE_AI_AGENT_SCHEMA_SUCCESS",
CLEAR_ACTION_RESPONSE: "CLEAR_ACTION_RESPONSE",
SHOW_ACTION_MODAL: "SHOW_ACTION_MODAL",
CANCEL_ACTION_MODAL: "CANCEL_ACTION_MODAL",
@ -734,6 +737,7 @@ const ActionExecutionErrorTypes = {
RUN_ACTION_ERROR: "RUN_ACTION_ERROR",
GENERATE_JS_FUNCTION_SCHEMA_ERROR: "GENERATE_JS_FUNCTION_SCHEMA_ERROR",
GENERATE_PLUGIN_ACTION_SCHEMA_ERROR: "GENERATE_PLUGIN_ACTION_SCHEMA_ERROR",
GENERATE_AI_AGENT_SCHEMA_ERROR: "GENERATE_AI_AGENT_SCHEMA_ERROR",
EXECUTE_PLUGIN_ACTION_ERROR: "EXECUTE_PLUGIN_ACTION_ERROR",
};