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

improve import seeding #1288

Merged
merged 2 commits into from
Dec 9, 2024
Merged

improve import seeding #1288

merged 2 commits into from
Dec 9, 2024

Conversation

Josh-XT
Copy link
Owner

@Josh-XT Josh-XT commented Dec 9, 2024

This pull request includes several changes to the agixt/SeedImports.py file to improve the import process for agents, extensions, chains, prompts, and providers. The changes include adding checks to prevent duplicate entries, ensuring a default user exists, and refactoring the code for better readability and maintainability.

Improvements to import processes:

  • Added a new function ensure_default_user to ensure the default admin user exists.
  • Modified import_agents, import_extensions, import_chains, import_prompts, and import_providers functions to include checks for existing entries before adding new ones to prevent duplicates. [1] [2] [3] [4] [5]

Codebase simplification and refactoring:

  • Removed unused imports and code related to conversations to clean up the file. [1] [2]
  • Refactored the retry logic in import_chains to make it more concise and readable.
  • Ensured that sessions are properly closed after database operations to avoid potential resource leaks. [1] [2] [3] [4]

@Josh-XT Josh-XT marked this pull request as ready for review December 9, 2024 17:29
@Josh-XT Josh-XT merged commit f641c72 into main Dec 9, 2024
7 checks passed
@Josh-XT Josh-XT deleted the improve-import-seeding branch December 9, 2024 17:29
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.

1 participant