Skip to content
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

Feature/export import stage 2 #3063

Merged
merged 11 commits into from
Sep 10, 2024
Merged

Feature/export import stage 2 #3063

merged 11 commits into from
Sep 10, 2024

Conversation

chungyau97
Copy link
Contributor

@chungyau97 chungyau97 commented Aug 23, 2024

Description

Allow to import and export below items:

  • Chatflows
  • Agentflows
  • Tools

Export All

This will generate: AllData.json
image
image

Import All

Import First Time

image
image
image

Import Second Time

If the UUID is not unique, name of chatflow/agentflow/tool will get added "with new id".
image
image
image

Tools

Chatflow and Agentflow will retain the data of tools that they are using.
image
image

Transaction Working in action

Test 1: Passing in AppServer
Test 2: No passing in AppServer

@chungyau97
Copy link
Contributor Author

chungyau97 commented Sep 6, 2024

Update 1:

Check input param for export data

  1. From GET/api/v1/export/all to POST/api/v1/export-import/export.
  2. Check request body whether match the required input.
  3. Backend now support UI popup dialog to select which they want to export.

Fail Input

  1. Missing parameter
  2. Incorrect name
  3. Error type
{
    "tool": "true",
    "multiagents": true
}

image

Success Input

{
    "tool": true,
    "chatflow": true,
    "multiagent": true
}

image

@@ -0,0 +1,10 @@
import client from './client'

const exportAll = () => client.get('/export-import/export/all')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HenryHengZJ

Remember to modify this part to

const exportData = (body) => client.post('/export-import/export', body)

Body example:

{
    "tool": true,
    "chatflow": true,
    "multiagent": true
}

@@ -258,24 +259,24 @@ const ProfileSection = ({ username, handleLogout }) => {
<ListItemButton
sx={{ borderRadius: `${customization.borderRadius}px` }}
onClick={() => {
getAllChatflowsApi.request()
exportAllApi.request()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HenryHengZJ

Need to modify this to call out the dialogbox input you wanted instead of straight away making request.

if (newTool.id) id = newTool.id
if (foundIds.includes(id)) {
newTool.id = undefined
newTool.name += ' with new id'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with new id

@@ -234,7 +236,6 @@ const importChatflows = async (newChatflows: Partial<ChatFlow>[]): Promise<any>
newChatflow.id = undefined
newChatflow.name += ' with new id'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with new id

@HenryHengZJ HenryHengZJ merged commit 56f9208 into main Sep 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants