Full Code of TransformerOptimus/SuperAGI for AI

main c3c1982e7bd6 cached
630 files
1.9 MB
460.6k tokens
2048 symbols
1 requests
Download .txt
Showing preview only (2,084K chars total). Download the full file or copy to clipboard to get everything.
Repository: TransformerOptimus/SuperAGI
Branch: main
Commit: c3c1982e7bd6
Files: 630
Total size: 1.9 MB

Directory structure:
gitextract_6lrw3u4j/

├── .do/
│   ├── app.yaml
│   └── deploy.template.yaml
├── .dockerignore
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   └── 1.BUG_REPORT.yml
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       ├── ci.yml
│       └── codeql.yml
├── .gitignore
├── .pre-commit-config.yaml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Dockerfile
├── Dockerfile-gpu
├── DockerfileCelery
├── DockerfileRedis
├── LICENSE
├── README.MD
├── alembic.ini
├── cli2.py
├── config_template.yaml
├── docker-compose-dev.yaml
├── docker-compose-gpu.yml
├── docker-compose.image.example.yaml
├── docker-compose.yaml
├── entrypoint.sh
├── entrypoint_celery.sh
├── gui/
│   ├── .dockerignore
│   ├── .eslintrc.json
│   ├── Dockerfile
│   ├── DockerfileProd
│   ├── README.md
│   ├── app/
│   │   ├── globals.css
│   │   └── layout.js
│   ├── jsconfig.json
│   ├── next.config.js
│   ├── package.json
│   ├── pages/
│   │   ├── Content/
│   │   │   ├── APM/
│   │   │   │   ├── Apm.module.css
│   │   │   │   ├── ApmDashboard.js
│   │   │   │   └── BarGraph.js
│   │   │   ├── Agents/
│   │   │   │   ├── ActionConsole.js
│   │   │   │   ├── ActivityFeed.js
│   │   │   │   ├── AgentCreate.js
│   │   │   │   ├── AgentSchedule.js
│   │   │   │   ├── AgentTemplatesList.js
│   │   │   │   ├── AgentWorkspace.js
│   │   │   │   ├── Agents.js
│   │   │   │   ├── Agents.module.css
│   │   │   │   ├── Details.js
│   │   │   │   ├── ResourceList.js
│   │   │   │   ├── ResourceManager.js
│   │   │   │   ├── RunHistory.js
│   │   │   │   ├── TaskQueue.js
│   │   │   │   └── react-datetime.css
│   │   │   ├── Knowledge/
│   │   │   │   ├── AddKnowledge.js
│   │   │   │   ├── Knowledge.js
│   │   │   │   ├── Knowledge.module.css
│   │   │   │   ├── KnowledgeDetails.js
│   │   │   │   └── KnowledgeForm.js
│   │   │   ├── Marketplace/
│   │   │   │   ├── AgentTemplate.js
│   │   │   │   ├── KnowledgeTemplate.js
│   │   │   │   ├── Market.js
│   │   │   │   ├── Market.module.css
│   │   │   │   ├── MarketAgent.js
│   │   │   │   ├── MarketKnowledge.js
│   │   │   │   ├── MarketTools.js
│   │   │   │   ├── MarketplacePublic.js
│   │   │   │   └── ToolkitTemplate.js
│   │   │   ├── Models/
│   │   │   │   ├── AddModel.js
│   │   │   │   ├── AddModelMarketPlace.js
│   │   │   │   ├── MarketModels.js
│   │   │   │   ├── ModelDetails.js
│   │   │   │   ├── ModelForm.js
│   │   │   │   ├── ModelInfo.js
│   │   │   │   ├── ModelMetrics.js
│   │   │   │   ├── ModelTemplate.js
│   │   │   │   └── Models.js
│   │   │   └── Toolkits/
│   │   │       ├── AddTool.js
│   │   │       ├── Metrics.js
│   │   │       ├── Tool.module.css
│   │   │       ├── ToolkitWorkspace.js
│   │   │       └── Toolkits.js
│   │   ├── Dashboard/
│   │   │   ├── Content.js
│   │   │   ├── Dashboard.module.css
│   │   │   ├── Settings/
│   │   │   │   ├── AddDatabase.js
│   │   │   │   ├── ApiKeys.js
│   │   │   │   ├── Database.js
│   │   │   │   ├── DatabaseDetails.js
│   │   │   │   ├── Model.js
│   │   │   │   ├── Settings.js
│   │   │   │   └── Webhooks.js
│   │   │   ├── SideBar.js
│   │   │   └── TopBar.js
│   │   ├── _app.css
│   │   ├── _app.js
│   │   └── api/
│   │       ├── DashboardService.js
│   │       └── apiConfig.js
│   └── utils/
│       ├── eventBus.js
│       └── utils.js
├── install_tool_dependencies.sh
├── local-llm
├── local-llm-gpu
├── main.py
├── migrations/
│   ├── README
│   ├── env.py
│   ├── script.py.mako
│   └── versions/
│       ├── 1d54db311055_add_permissions.py
│       ├── 2cc1179834b0_agent_executions_modified.py
│       ├── 2f97c068fab9_resource_modified.py
│       ├── 2fbd6472112c_add_feed_group_id_to_execution_and_feed.py
│       ├── 3356a2f89a33_added_configurations_table.py
│       ├── 35e47f20475b_renamed_tokens_calls.py
│       ├── 3867bb00a495_added_first_login_source.py
│       ├── 40affbf3022b_add_filter_colume_in_webhooks.py
│       ├── 446884dcae58_add_api_key_and_web_hook.py
│       ├── 44b0d6f2d1b3_init_models.py
│       ├── 467e85d5e1cd_updated_resources_added_exec_id.py
│       ├── 516ecc1c723d_adding_marketplace_template_id_to_agent_.py
│       ├── 5184645e9f12_add_question_to_agent_execution_.py
│       ├── 520aa6776347_create_models_config.py
│       ├── 598cfb37292a_adding_agent_templates.py
│       ├── 5d5f801f28e7_create_model_table.py
│       ├── 661ec8a4c32e_open_ai_error_handling.py
│       ├── 71e3980d55f5_knowledge_and_vector_dbs.py
│       ├── 7a3e336c0fba_added_tools_related_models.py
│       ├── 83424de1347e_added_agent_execution_config.py
│       ├── 8962bed0d809_creating_agent_templates.py
│       ├── 9270eb5a8475_local_llms.py
│       ├── 9419b3340af7_create_agent_workflow.py
│       ├── a91808a89623_added_resources.py
│       ├── ba60b12ae109_create_agent_scheduler.py
│       ├── be1d922bf2ad_create_call_logs_table.py
│       ├── c02f3d759bf3_add_summary_to_resource.py
│       ├── c4f2f6ba602a_agent_workflow_wait_step.py
│       ├── c5c19944c90c_create_oauth_tokens.py
│       ├── cac478732572_delete_agent_feature.py
│       ├── d8315244ea43_updated_tool_configs.py
│       ├── d9b3436197eb_renaming_templates.py
│       ├── e39295ec089c_creating_events.py
│       └── fe234ea6e9bc_modify_agent_workflow_tables.py
├── nginx/
│   └── default.conf
├── package.json
├── requirements.txt
├── run.bat
├── run.sh
├── run_gui.py
├── run_gui.sh
├── superagi/
│   ├── __init__.py
│   ├── agent/
│   │   ├── __init__.py
│   │   ├── agent_iteration_step_handler.py
│   │   ├── agent_message_builder.py
│   │   ├── agent_prompt_builder.py
│   │   ├── agent_prompt_template.py
│   │   ├── agent_tool_step_handler.py
│   │   ├── agent_workflow_step_wait_handler.py
│   │   ├── common_types.py
│   │   ├── output_handler.py
│   │   ├── output_parser.py
│   │   ├── prompts/
│   │   │   ├── agent_queue_input.txt
│   │   │   ├── agent_recursive_summary.txt
│   │   │   ├── agent_summary.txt
│   │   │   ├── agent_tool_input.txt
│   │   │   ├── agent_tool_output.txt
│   │   │   ├── analyse_task.txt
│   │   │   ├── create_tasks.txt
│   │   │   ├── initialize_tasks.txt
│   │   │   ├── prioritize_tasks.txt
│   │   │   └── superagi.txt
│   │   ├── queue_step_handler.py
│   │   ├── task_queue.py
│   │   ├── tool_builder.py
│   │   ├── tool_executor.py
│   │   ├── types/
│   │   │   ├── __init__.py
│   │   │   ├── agent_execution_status.py
│   │   │   ├── agent_workflow_step_action_types.py
│   │   │   └── wait_step_status.py
│   │   └── workflow_seed.py
│   ├── apm/
│   │   ├── __init__.py
│   │   ├── analytics_helper.py
│   │   ├── call_log_helper.py
│   │   ├── event_handler.py
│   │   ├── knowledge_handler.py
│   │   └── tools_handler.py
│   ├── config/
│   │   ├── __init__.py
│   │   └── config.py
│   ├── controllers/
│   │   ├── __init__.py
│   │   ├── agent.py
│   │   ├── agent_execution.py
│   │   ├── agent_execution_config.py
│   │   ├── agent_execution_feed.py
│   │   ├── agent_execution_permission.py
│   │   ├── agent_template.py
│   │   ├── agent_workflow.py
│   │   ├── analytics.py
│   │   ├── api/
│   │   │   └── agent.py
│   │   ├── api_key.py
│   │   ├── budget.py
│   │   ├── config.py
│   │   ├── google_oauth.py
│   │   ├── knowledge_configs.py
│   │   ├── knowledges.py
│   │   ├── marketplace_stats.py
│   │   ├── models_controller.py
│   │   ├── organisation.py
│   │   ├── project.py
│   │   ├── resources.py
│   │   ├── tool.py
│   │   ├── tool_config.py
│   │   ├── toolkit.py
│   │   ├── twitter_oauth.py
│   │   ├── types/
│   │   │   ├── agent_execution_config.py
│   │   │   ├── agent_publish_config.py
│   │   │   ├── agent_schedule.py
│   │   │   ├── agent_with_config.py
│   │   │   ├── agent_with_config_schedule.py
│   │   │   └── models_types.py
│   │   ├── user.py
│   │   ├── vector_db_indices.py
│   │   ├── vector_dbs.py
│   │   └── webhook.py
│   ├── helper/
│   │   ├── agent_schedule_helper.py
│   │   ├── auth.py
│   │   ├── calendar_date.py
│   │   ├── encyption_helper.py
│   │   ├── error_handler.py
│   │   ├── feed_parser.py
│   │   ├── github_helper.py
│   │   ├── google_calendar_creds.py
│   │   ├── google_search.py
│   │   ├── google_serp.py
│   │   ├── imap_email.py
│   │   ├── json_cleaner.py
│   │   ├── llm_loader.py
│   │   ├── models_helper.py
│   │   ├── prompt_reader.py
│   │   ├── read_email.py
│   │   ├── resource_helper.py
│   │   ├── s3_helper.py
│   │   ├── time_helper.py
│   │   ├── token_counter.py
│   │   ├── tool_helper.py
│   │   ├── twitter_helper.py
│   │   ├── twitter_tokens.py
│   │   ├── validate_csv.py
│   │   ├── webhook_manager.py
│   │   └── webpage_extractor.py
│   ├── image_llms/
│   │   ├── __init__.py
│   │   ├── base_image_llm.py
│   │   └── openai_dalle.py
│   ├── jobs/
│   │   ├── __init__.py
│   │   ├── agent_executor.py
│   │   └── scheduling_executor.py
│   ├── lib/
│   │   └── logger.py
│   ├── llms/
│   │   ├── __init__.py
│   │   ├── base_llm.py
│   │   ├── google_palm.py
│   │   ├── grammar/
│   │   │   └── json.gbnf
│   │   ├── hugging_face.py
│   │   ├── llm_model_factory.py
│   │   ├── local_llm.py
│   │   ├── openai.py
│   │   ├── replicate.py
│   │   └── utils/
│   │       ├── __init__.py
│   │       └── huggingface_utils/
│   │           ├── __init__.py
│   │           ├── public_endpoints.py
│   │           └── tasks.py
│   ├── models/
│   │   ├── __init__.py
│   │   ├── agent.py
│   │   ├── agent_config.py
│   │   ├── agent_execution.py
│   │   ├── agent_execution_config.py
│   │   ├── agent_execution_feed.py
│   │   ├── agent_execution_permission.py
│   │   ├── agent_schedule.py
│   │   ├── agent_template.py
│   │   ├── agent_template_config.py
│   │   ├── api_key.py
│   │   ├── base_model.py
│   │   ├── budget.py
│   │   ├── call_logs.py
│   │   ├── configuration.py
│   │   ├── db.py
│   │   ├── events.py
│   │   ├── knowledge_configs.py
│   │   ├── knowledges.py
│   │   ├── marketplace_stats.py
│   │   ├── models.py
│   │   ├── models_config.py
│   │   ├── oauth_tokens.py
│   │   ├── organisation.py
│   │   ├── project.py
│   │   ├── resource.py
│   │   ├── tool.py
│   │   ├── tool_config.py
│   │   ├── toolkit.py
│   │   ├── types/
│   │   │   ├── __init__.py
│   │   │   ├── agent_config.py
│   │   │   ├── login_request.py
│   │   │   └── validate_llm_api_key_request.py
│   │   ├── user.py
│   │   ├── vector_db_configs.py
│   │   ├── vector_db_indices.py
│   │   ├── vector_dbs.py
│   │   ├── webhook_events.py
│   │   ├── webhooks.py
│   │   └── workflows/
│   │       ├── __init__.py
│   │       ├── agent_workflow.py
│   │       ├── agent_workflow_step.py
│   │       ├── agent_workflow_step_tool.py
│   │       ├── agent_workflow_step_wait.py
│   │       ├── iteration_workflow.py
│   │       └── iteration_workflow_step.py
│   ├── resource_manager/
│   │   ├── __init__.py
│   │   ├── file_manager.py
│   │   ├── llama_document_summary.py
│   │   ├── llama_vector_store_factory.py
│   │   ├── resource_manager.py
│   │   └── resource_summary.py
│   ├── tool_manager.py
│   ├── tools/
│   │   ├── __init__.py
│   │   ├── apollo/
│   │   │   ├── __init__.py
│   │   │   ├── apollo_search.py
│   │   │   └── apollo_toolkit.py
│   │   ├── base_tool.py
│   │   ├── code/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── coding_toolkit.py
│   │   │   ├── improve_code.py
│   │   │   ├── prompts/
│   │   │   │   ├── generate_logic.txt
│   │   │   │   ├── improve_code.txt
│   │   │   │   ├── write_code.txt
│   │   │   │   ├── write_spec.txt
│   │   │   │   └── write_test.txt
│   │   │   ├── write_code.py
│   │   │   ├── write_spec.py
│   │   │   └── write_test.py
│   │   ├── duck_duck_go/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── duck_duck_go_search.py
│   │   │   └── duck_duck_go_search_toolkit.py
│   │   ├── email/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── email_toolkit.py
│   │   │   ├── read_email.py
│   │   │   ├── send_email.py
│   │   │   └── send_email_attachment.py
│   │   ├── file/
│   │   │   ├── __init__.py
│   │   │   ├── append_file.py
│   │   │   ├── delete_file.py
│   │   │   ├── file_toolkit.py
│   │   │   ├── list_files.py
│   │   │   ├── read_file.py
│   │   │   └── write_file.py
│   │   ├── github/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── add_file.py
│   │   │   ├── delete_file.py
│   │   │   ├── fetch_pull_request.py
│   │   │   ├── github_toolkit.py
│   │   │   ├── prompts/
│   │   │   │   └── code_review.txt
│   │   │   ├── review_pull_request.py
│   │   │   └── search_repo.py
│   │   ├── google_calendar/
│   │   │   ├── README.md
│   │   │   ├── create_calendar_event.py
│   │   │   ├── delete_calendar_event.py
│   │   │   ├── event_details_calendar.py
│   │   │   ├── google_calendar_toolkit.py
│   │   │   └── list_calendar_events.py
│   │   ├── google_search/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── google_search.py
│   │   │   └── google_search_toolkit.py
│   │   ├── google_serp_search/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── google_serp_search.py
│   │   │   └── google_serp_search_toolkit.py
│   │   ├── image_generation/
│   │   │   ├── README.MD
│   │   │   ├── README.STABLE_DIFFUSION.md
│   │   │   ├── __init__.py
│   │   │   ├── dalle_image_gen.py
│   │   │   ├── image_generation_toolkit.py
│   │   │   └── stable_diffusion_image_gen.py
│   │   ├── instagram_tool/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── instagram.py
│   │   │   └── instagram_toolkit.py
│   │   ├── jira/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── create_issue.py
│   │   │   ├── edit_issue.py
│   │   │   ├── get_projects.py
│   │   │   ├── jira_toolkit.py
│   │   │   ├── search_issues.py
│   │   │   └── tool.py
│   │   ├── knowledge_search/
│   │   │   ├── knowledge_search.py
│   │   │   └── knowledge_search_toolkit.py
│   │   ├── resource/
│   │   │   ├── __init__.py
│   │   │   ├── query_resource.py
│   │   │   └── resource_toolkit.py
│   │   ├── searx/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── search_scraper.py
│   │   │   ├── searx.py
│   │   │   └── searx_toolkit.py
│   │   ├── slack/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── send_message.py
│   │   │   └── slack_toolkit.py
│   │   ├── thinking/
│   │   │   ├── __init__.py
│   │   │   ├── prompts/
│   │   │   │   └── thinking.txt
│   │   │   ├── thinking_toolkit.py
│   │   │   └── tools.py
│   │   ├── tool_response_query_manager.py
│   │   ├── twitter/
│   │   │   ├── README.md
│   │   │   ├── send_tweets.py
│   │   │   └── twitter_toolkit.py
│   │   └── webscaper/
│   │       ├── README.MD
│   │       ├── __init__.py
│   │       ├── tools.py
│   │       └── web_scraper_toolkit.py
│   ├── types/
│   │   ├── __init__.py
│   │   ├── common.py
│   │   ├── key_type.py
│   │   ├── model_source_types.py
│   │   ├── queue_status.py
│   │   ├── storage_types.py
│   │   └── vector_store_types.py
│   ├── vector_embeddings/
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── pinecone.py
│   │   ├── qdrant.py
│   │   ├── vector_embedding_factory.py
│   │   └── weaviate.py
│   ├── vector_store/
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── chromadb.py
│   │   ├── document.py
│   │   ├── embedding/
│   │   │   ├── __init__.py
│   │   │   ├── base.py
│   │   │   ├── openai.py
│   │   │   └── palm.py
│   │   ├── pinecone.py
│   │   ├── qdrant.py
│   │   ├── redis.py
│   │   ├── vector_factory.py
│   │   └── weaviate.py
│   └── worker.py
├── test.py
├── test_main.http
├── tests/
│   ├── __init__.py
│   ├── integration_tests/
│   │   ├── __init__.py
│   │   ├── vector_embeddings/
│   │   │   ├── __init__.py
│   │   │   ├── test_pinecone.py
│   │   │   ├── test_qdrant.py
│   │   │   └── test_weaviate.py
│   │   └── vector_store/
│   │       ├── __init__.py
│   │       ├── test_qdrant.py
│   │       └── test_weaviate.py
│   ├── tools/
│   │   └── google_calendar/
│   │       ├── create_event_test.py
│   │       ├── delete_event_test.py
│   │       ├── event_details_test.py
│   │       └── list_events_test.py
│   └── unit_tests/
│       ├── __init__.py
│       ├── agent/
│       │   ├── __init__.py
│       │   ├── test_agent_iteration_step_handler.py
│       │   ├── test_agent_message_builder.py
│       │   ├── test_agent_prompt_builder.py
│       │   ├── test_agent_prompt_template.py
│       │   ├── test_agent_tool_step_handler.py
│       │   ├── test_agent_workflow_step_wait_handler.py
│       │   ├── test_output_handler.py
│       │   ├── test_output_parser.py
│       │   ├── test_queue_step_handler.py
│       │   ├── test_task_queue.py
│       │   ├── test_tool_builder.py
│       │   └── test_tool_executor.py
│       ├── apm/
│       │   ├── __init__.py
│       │   ├── test_analytics_helper.py
│       │   ├── test_call_log_helper.py
│       │   ├── test_event_handler.py
│       │   ├── test_knowledge_handler.py
│       │   └── test_tools_handler.py
│       ├── controllers/
│       │   ├── __init__.py
│       │   ├── api/
│       │   │   ├── __init__.py
│       │   │   └── test_agent.py
│       │   ├── test_agent.py
│       │   ├── test_agent_execution.py
│       │   ├── test_agent_execution_config.py
│       │   ├── test_agent_execution_feeds.py
│       │   ├── test_agent_template.py
│       │   ├── test_analytics.py
│       │   ├── test_models_controller.py
│       │   ├── test_publish_agent.py
│       │   ├── test_tool.py
│       │   ├── test_tool_config.py
│       │   ├── test_toolkit.py
│       │   ├── test_update_agent_config_table.py
│       │   └── test_user.py
│       ├── helper/
│       │   ├── __init__.py
│       │   ├── test_agent_schedule_helper.py
│       │   ├── test_calendar_date.py
│       │   ├── test_error_handling.py
│       │   ├── test_feed_parser.py
│       │   ├── test_github_helper.py
│       │   ├── test_json_cleaner.py
│       │   ├── test_resource_helper.py
│       │   ├── test_s3_helper.py
│       │   ├── test_time_helper.py
│       │   ├── test_token_counter.py
│       │   ├── test_tool_helper.py
│       │   ├── test_twitter_helper.py
│       │   ├── test_twitter_tokens.py
│       │   └── test_webhooks.py
│       ├── jobs/
│       │   ├── __init__.py
│       │   ├── conftest.py
│       │   ├── test_resource_summary.py
│       │   └── test_scheduling_executor.py
│       ├── llms/
│       │   ├── __init__.py
│       │   ├── test_google_palm.py
│       │   ├── test_hugging_face.py
│       │   ├── test_model_factory.py
│       │   ├── test_open_ai.py
│       │   └── test_replicate.py
│       ├── models/
│       │   ├── __init__.py
│       │   ├── test_agent.py
│       │   ├── test_agent_execution.py
│       │   ├── test_agent_execution_config.py
│       │   ├── test_agent_execution_feed.py
│       │   ├── test_agent_schedule.py
│       │   ├── test_agent_template.py
│       │   ├── test_agent_workflow.py
│       │   ├── test_agent_workflow_step.py
│       │   ├── test_agent_workflow_step_tool.py
│       │   ├── test_api_key.py
│       │   ├── test_call_logs.py
│       │   ├── test_configuration.py
│       │   ├── test_events.py
│       │   ├── test_iteration_workflow.py
│       │   ├── test_iteration_workflow_step.py
│       │   ├── test_knowledge_configs.py
│       │   ├── test_marketplace_stats.py
│       │   ├── test_models.py
│       │   ├── test_models_config.py
│       │   ├── test_project.py
│       │   ├── test_tool.py
│       │   ├── test_tool_config.py
│       │   ├── test_toolkit.py
│       │   ├── test_vector_db_configs.py
│       │   ├── test_vector_db_indices.py
│       │   └── test_vector_dbs.py
│       ├── resource_manager/
│       │   ├── __init__.py
│       │   ├── test_file_manager.py
│       │   ├── test_llama_document_creation.py
│       │   ├── test_llama_vector_store_factory.py
│       │   └── test_save_document_to_vector_store.py
│       ├── test_migrations_multiheads.py
│       ├── test_tool_manager.py
│       ├── tools/
│       │   ├── __init__.py
│       │   ├── code/
│       │   │   ├── __init__.py
│       │   │   ├── test_improve_code.py
│       │   │   ├── test_write_code.py
│       │   │   ├── test_write_spec.py
│       │   │   └── test_write_test.py
│       │   ├── duck_duck_go/
│       │   │   ├── __init__.py
│       │   │   ├── test_duckduckgo_results.py
│       │   │   └── test_duckduckgo_toolkit.py
│       │   ├── email/
│       │   │   ├── __init__.py
│       │   │   ├── test_read_email.py
│       │   │   ├── test_send_email.py
│       │   │   └── test_send_email_attachment.py
│       │   ├── file/
│       │   │   ├── __init__.py
│       │   │   ├── test_list_files.py
│       │   │   └── test_read_file.py
│       │   ├── github/
│       │   │   ├── __init__.py
│       │   │   ├── test_add_file.py
│       │   │   ├── test_fetch_pull_request.py
│       │   │   ├── test_github_delete.py
│       │   │   └── test_review_pull_request.py
│       │   ├── image_generation/
│       │   │   ├── __init__.py
│       │   │   ├── test_dalle_image_gen.py
│       │   │   └── test_stable_diffusion_image_gen.py
│       │   ├── instagram_tool/
│       │   │   ├── __init__.py
│       │   │   ├── test_instagram_tool.py
│       │   │   └── test_instagram_toolkit.py
│       │   ├── jira/
│       │   │   ├── __init__.py
│       │   │   ├── test_create_issue.py
│       │   │   ├── test_edit_issue.py
│       │   │   ├── test_get_projects.py
│       │   │   └── test_search_issues.py
│       │   ├── knowledge_tool/
│       │   │   ├── __init__.py
│       │   │   └── test_knowledge_search.py
│       │   ├── searx/
│       │   │   ├── __init__.py
│       │   │   └── test_searx_toolkit.py
│       │   ├── test_search_repo.py
│       │   └── twitter/
│       │       └── test_send_tweets.py
│       ├── types/
│       │   ├── __init__.py
│       │   └── test_model_source_types.py
│       ├── vector_embeddings/
│       │   ├── __init__.py
│       │   └── test_vector_embedding_factory.py
│       └── vector_store/
│           ├── __init__.py
│           ├── test_chromadb.py
│           ├── test_redis.py
│           └── test_vector_factory.py
├── tgwui/
│   ├── DockerfileTGWUI
│   ├── config/
│   │   ├── loras/
│   │   │   └── place-your-loras-here.txt
│   │   ├── presets/
│   │   │   ├── Debug-deterministic.yaml
│   │   │   ├── Kobold-Godlike.yaml
│   │   │   ├── Kobold-Liminal Drift.yaml
│   │   │   ├── LLaMA-Precise.yaml
│   │   │   ├── Naive.yaml
│   │   │   ├── NovelAI-Best Guess.yaml
│   │   │   ├── NovelAI-Decadence.yaml
│   │   │   ├── NovelAI-Genesis.yaml
│   │   │   ├── NovelAI-Lycaenidae.yaml
│   │   │   ├── NovelAI-Ouroboros.yaml
│   │   │   ├── NovelAI-Pleasing Results.yaml
│   │   │   ├── NovelAI-Sphinx Moth.yaml
│   │   │   ├── NovelAI-Storywriter.yaml
│   │   │   ├── Special-Contrastive Search.yaml
│   │   │   └── Special-Eta Sampling.yaml
│   │   ├── prompts/
│   │   │   ├── Alpaca-with-Input.txt
│   │   │   ├── GPT-4chan.txt
│   │   │   └── QA.txt
│   │   └── training/
│   │       ├── datasets/
│   │       │   └── put-trainer-datasets-here.txt
│   │       └── formats/
│   │           ├── alpaca-chatbot-format.json
│   │           └── alpaca-format.json
│   └── scripts/
│       ├── build_extensions.sh
│       └── docker-entrypoint.sh
├── ui.py
└── wait-for-it.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: .do/app.yaml
================================================
alerts:
  - rule: DEPLOYMENT_FAILED
  - rule: DOMAIN_FAILED
databases:
  - engine: PG
    name: super-agi-main
    num_nodes: 1
    size: basic-xs
    version: "12"
ingress:
  rules:
    - component:
        name: superagi-backend
      match:
        path:
          prefix: /api
name: superagi
services:
  - dockerfile_path: DockerfileRedis
    github: 
      branch: main
      deploy_on_push: true
      repo: TransformerOptimus/SuperAGI
    internal_ports: 
    - 6379
    instance_count: 1
    instance_size_slug: basic-xs
    source_dir: /
    name: superagi-redis
  - dockerfile_path: Dockerfile
    envs:
      - key: REDIS_URL
        scope: RUN_TIME
        value: superagi-redis:6379
      - key: DB_URL
        scope: RUN_TIME
        value: ${super-agi-main.DATABASE_URL}
    github:
      branch: main
      deploy_on_push: true
      repo: TransformerOptimus/SuperAGI
    http_port: 8001
    instance_count: 1
    instance_size_slug: basic-xs
    run_command: /app/entrypoint.sh
    source_dir: /
    name: superagi-backend
  - dockerfile_path: ./gui/DockerfileProd
    github:
      branch: main
      deploy_on_push: true
      repo: TransformerOptimus/SuperAGI
    http_port: 3000
    instance_count: 1
    instance_size_slug: basic-xs
    source_dir: ./gui
    name: superagi-gui
workers:
  - dockerfile_path: Dockerfile
    envs:
      - key: REDIS_URL
        scope: RUN_TIME
        value: superagi-redis:6379
      - key: DB_URL
        scope: RUN_TIME
        value: ${super-agi-main.DATABASE_URL}
    github:
      branch: main
      deploy_on_push: true
      repo: TransformerOptimus/SuperAGI
    instance_count: 1
    instance_size_slug: basic-xs
    run_command: celery -A superagi.worker worker --beat --loglevel=info
    source_dir: /
    name: superagi-celery
  


================================================
FILE: .do/deploy.template.yaml
================================================
spec:
  alerts:
    - rule: DEPLOYMENT_FAILED
    - rule: DOMAIN_FAILED
  databases:
    - engine: PG
      name: super-agi-main
      num_nodes: 1
      size: basic-xs
      version: "12"
  ingress:
    rules:
      - component:
          name: superagi-backend
        match:
          path:
            prefix: /api
  name: superagi
  services:
    - dockerfile_path: DockerfileRedis
      git:
        branch: main
        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
      internal_ports: 
      - 6379
      instance_count: 1
      instance_size_slug: basic-xs
      source_dir: /
      name: superagi-redis
    - dockerfile_path: Dockerfile
      envs:
        - key: REDIS_URL
          scope: RUN_TIME
          value: superagi-redis:6379
        - key: DB_URL
          scope: RUN_TIME
          value: ${super-agi-main.DATABASE_URL}
      git:
        branch: main
        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
      http_port: 8001
      instance_count: 1
      instance_size_slug: basic-xs
      run_command: /app/entrypoint.sh
      source_dir: /
      name: superagi-backend
    - dockerfile_path: ./gui/DockerfileProd
      git:
        branch: main
        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
      http_port: 3000
      instance_count: 1
      instance_size_slug: basic-xs
      source_dir: ./gui
      name: superagi-gui
  workers:
    - dockerfile_path: Dockerfile
      envs:
        - key: REDIS_URL
          scope: RUN_TIME
          value: superagi-redis:6379
        - key: DB_URL
          scope: RUN_TIME
          value: ${super-agi-main.DATABASE_URL}
      git:
        branch: main
        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
      instance_count: 1
      instance_size_slug: basic-xs
      run_command: celery -A superagi.worker worker --beat --loglevel=info
      source_dir: /
      name: superagi-celery
    


================================================
FILE: .dockerignore
================================================
# Ignore everything
**

# Allow files and directories
!/migrations
!/nginx
!/superagi
!/tgwui
!/tools
!/workspace
!/main.py
!/requirements.txt
!/entrypoint.sh
!/entrypoint_celery.sh
!/wait-for-it.sh
!/tools.json
!/install_tool_dependencies.sh
!/alembic.ini

================================================
FILE: .gitattributes
================================================
*.sh text eol=lf


================================================
FILE: .github/ISSUE_TEMPLATE/1.BUG_REPORT.yml
================================================
name: Bug report 
description: Create a bug report for SuperAGI.
labels: ['status: needs triage']
body:
  - type: markdown
    attributes:
      value: |
        ### ⚠️ Issue Creation Guideline
        * Check out our [roadmap] and join our [discord] to discuss what's going on
        * If you need help, you can ask in the [#general] section or in [#support]
        * **Thoroughly search the [existing issues] before creating a new one**
        * Read through our docs:
        [roadmap]: https://github.com/users/TransformerOptimus/projects/5
        [discord]: https://discord.gg/dXbRe5BHJC
        [#general]: https://discord.com/channels/1107593006032355359/1107642413993959505
        [#support]: https://discord.com/channels/1107593006032355359/1107645922797703198
        [existing issues]: https://github.com/TransformerOptimus/SuperAGI/issues
  - type: checkboxes
    attributes:
      label: ⚠️ Check for existing issues before proceeding. ⚠️
      description: >
        Please [search the history](https://github.com/TransformerOptimus/SuperAGI/issues)
        to see if an issue already exists for the same problem.
      options:
        - label: I have searched the existing issues, and there is no existing issue for my problem
          required: true

  - type: markdown
    attributes:
      value: |
        Please confirm that the issue you have is described well and precise in the title above ⬆️.
        Think like this: What would you type if you were searching for the issue?
        
        For example:
        ❌ - my SuperAGI agent keeps looping
        ✅ - After performing Write Tool, SuperAGI goes into a loop where it keeps trying to write the file.
        
        Please help us help you by following these steps:
        - Search for existing issues, adding a comment when you have the same or similar issue is tidier than "new issue" and 
          newer issues will not be reviewed earlier, this is dependent on the current priorities set by our wonderful team
        - Ask on our Discord if your issue is known when you are unsure (https://discord.gg/dXbRe5BHJC)
        - Provide relevant info:
          - Provide Docker Logs(docker compose logs) whenever possible.
          - If it's a pip/packages issue, mention this in the title and provide pip version, python version.
  - type: dropdown
    attributes:
      label: Where are you using SuperAGI?
      description: >
        Please select the operating system you were using to run SuperAGI when this problem occurred.
      options:
        - Windows
        - Linux
        - MacOS
        - Codespaces
        - Web Version
        - Other
    validations:
      required: true
      nested_fields:
        - type: text
          attributes:
            label: Specify the system
            description: Please specify the system you are working on.

  - type: dropdown
    attributes:
      label: Which branch of SuperAGI are you using?
      description: |
        Please select which version of SuperAGI you were using when this issue occurred.
        If installed with git you can run `git branch` to see which version of Auto-GPT you are running.
      options:
        - Main
        - Dev (branch)
    validations:
      required: true

  - type: dropdown
    attributes:
      label: Do you use OpenAI GPT-3.5 or GPT-4?
      description: >
        If you are using SuperAGI with GPT-3.5, your problems may be caused by
        the limitations of GPT-3.5 like incorrect Tool selection thus causing looping in the agent feed.
      options:
        - GPT-3.5
        - GPT-3.5(16k)
        - GPT-4
        - GPT-4(32k)
    validations:
      required: true

  - type: dropdown
    attributes:
      label: Which area covers your issue best?
      description: >
        Select the area related to the issue you are reporting.
      options:
        - Installation and setup
        - Resource Manager
        - Action Console
        - Performance
        - Marketplace
        - Prompt
        - Tools
        - Agents
        - Documentation
        - Logging
        - Other
    validations:
      required: true
      autolabels: true
      nested_fields:
        - type: text
          attributes:
            label: Specify the area
            description: Please specify the area you think is best related to the issue.

  - type: textarea
    attributes:
      label: Describe your issue.
      description: Describe the problem you are experiencing. Try to describe only the issue and phrase it short but clear. ⚠️ Provide NO other data in this field  
    validations:
      required: true

  - type: textarea
    attributes:
     label: How to replicate your Issue?
     description: |
      Mention Agent Name, Agent Description and Agent Goals, along with Model selected. 
      Provide any other data which might be relevant for us to replicate this issue.
      ⚠️ Provide NO other data in this field  
    validations:
     required: false

  - type: markdown
    attributes:
      value: |
        ⚠️ Please keep in mind that the log files may contain personal information such as credentials. Make sure you hide them before copy/pasting it! ⚠️        
  - type: input
    attributes:
      label: Upload Error Log Content
      description: |
        Upload the error log content, this can help us understand the issue better. 
        To do this, you can simply copy the logs from the terminal with which you did 'docker compose up' or in a new terminal, 
        enter 'docker compose logs' and copy/paste the error contents to this field. 
        ⚠️ The activity log may contain personal data given to SuperAGI by you in prompt or input as well as 
        any personal information that SuperAGI collected out of files during last run. Please hide them before sharing. ⚠️
    validations:
      required: True


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!-- Thank you for submitting this PR! :) -->
<!-- Provide a general summary of your changes in the Title above ^, end with (close #<issue-no>) or (fix #<issue-no>) -->

### Description
<!-- The title might not be enough to convey how this change affects the user. -->
<!-- Describe the changes from a user's perspective -->


<!-- Changelog Section End -->

### Related Issues
<!-- Please make sure you have an issue associated with this Pull Request -->
<!-- And then add `(close #<issue-no>)` to the pull request title -->
<!-- Add the issue number below (e.g. #234) -->

### Solution and Design
<!-- How is this issue solved/fixed? What is the design? -->
<!-- It's better if we elaborate -->

### Test Plan
<!-- Describe how you tested this functionality. Include steps to reproduce, relevant test cases, and any other pertinent information. -->

### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Docs update


### Checklist
- [ ] My pull request is atomic and focuses on a single change.
- [ ] I have read the contributing guide and my code conforms to the guidelines.
- [ ] I have documented my changes clearly and comprehensively.
- [ ] I have added the required tests.


================================================
FILE: .github/workflows/ci.yml
================================================
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python CI

on:
  push:
    branches: [ "main", "dev" ]
  pull_request:
    branches: [ "main", "dev" ]

permissions:
  contents: read

jobs:
  lint:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
      with:
        fetch-depth: 0
        ref: ${{ github.event.pull_request.head.ref }}
        repository: ${{ github.event.pull_request.head.repo.full_name }}

    - name: Set up Python 3.9
      uses: actions/setup-python@v3
      with:
        python-version: "3.9"

    - name: Cache Python dependencies
      uses: actions/cache@v2
      with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
          restore-keys: |
            ${{ runner.os }}-pip-

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install flake8 pytest
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
    - name: Lint with flake8
      run: |
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
 
  test:

    permissions:
      # Gives the action the necessary permissions for publishing new
      # comments in pull requests.
      pull-requests: write
      # Gives the action the necessary permissions for pushing data to the
      # python-coverage-comment-action branch, and for editing existing
      # comments (to avoid publishing multiple comments in the same PR)
      contents: write

    runs-on: ubuntu-latest
    timeout-minutes: 30
    strategy:
      matrix:
        python-version: ["3.9"]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.ref }}
          repository: ${{ github.event.pull_request.head.repo.full_name }}
          submodules: true

      - name: Configure git user SuperAGI-Bot
        run: |
          git config --global user.name "SuperAGI-Bot"
          git config --global user.email "github-bot@superagi.com"
          
      - name: Set up Python 3.9
        uses: actions/setup-python@v3
        with:
          python-version: "3.9"

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
            path: ~/.cache/pip
            key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
            restore-keys: |
              ${{ runner.os }}-pip-

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install flake8 pytest
          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
          
      - name: Test with pytest
        run: |
          pytest --cov=superagi --cov-branch --cov-report term-missing --cov-report xml \
            tests/unit_tests -s
        env:
          CI: true
          ENV: DEV
          PLAIN_OUTPUT: True
          REDIS_URL: "localhost:6379"
          IS_TESTING: True
          ENCRYPTION_KEY: "abcdefghijklmnopqrstuvwxyz123456"

      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v3


================================================
FILE: .github/workflows/codeql.yml
================================================
name: "CodeQL"

on:
  push:
    branches: [ 'main', 'dev' ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ 'main' ]
  schedule:
    - cron: '48 0 * * 2'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'javascript', 'python' ]
        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
        # Use only 'java' to analyze code written in Java, Kotlin or both
        # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
        # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

    steps:
    - name: Checkout repository
      uses: actions/checkout@v3

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      with:
        languages: ${{ matrix.language }}
        # If you wish to specify custom queries, you can do so here or in a config file.
        # By default, queries listed here will override any specified in a config file.
        # Prefix the list here with "+" to use these queries and those in the config file.

        # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
        # queries: security-extended,security-and-quality


    # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
    # If this step fails, then you should remove it and run the build manually (see below)
    - name: Autobuild
      uses: github/codeql-action/autobuild@v2

    # ℹ️ Command-line programs to run using the OS shell.
    # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

    #   If the Autobuild fails above, remove it and uncomment the following three lines.
    #   modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

    # - run: |
    #     echo "Run, Build Application using script"
    #     ./location_of_script_within_repo/buildscript.sh

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
      with:
        category: "/language:${{matrix.language}}"


================================================
FILE: .gitignore
================================================
.idea
**/.env
**/.venv
config.yaml
__pycache__
superagi/models/__pycache__
superagi/controllers/__pycache__
**agent_dictvenv
**/__gitpycache__/
gui/node_modules
node_modules
gui/.next
.DS_Store
.DS_Store?
venv
workspace/output
workspace/input
celerybeat-schedule
../bfg-report*
superagi/tools/marketplace_tools/
superagi/tools/external_tools/
tests/unit_tests/resource_manager/test_path
/tools.json

================================================
FILE: .pre-commit-config.yaml
================================================
repos:
  -   repo: local
      hooks:
        -   id: pylint
            name: pylint
            entry: pylint
            language: system
            types: [python]

================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
  and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
  overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
  advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
  address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior,  harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.


================================================
FILE: CONTRIBUTING.md
================================================
#  ⚡ Contributing to SuperAGI
<p align="center">
  <a href="https://superagi.com//#gh-light-mode-only">
    <img src="https://superagi.com/wp-content/uploads/2023/05/Logo-dark.svg" width="318px" alt="SuperAGI logo" />
  </a>
  <a href="https://superagi.com//#gh-dark-mode-only">
    <img src="https://superagi.com/wp-content/uploads/2023/05/Logo-light.svg" width="318px" alt="SuperAGI logo" />
  </a>
</p>

First of all, thank you for taking the time to contribute to this project. We truly appreciate your contributions, whether it's bug reports, feature suggestions, or pull requests. Your time and effort are highly valued in this project. 🚀

This document provides guidelines and best practices to help you to contribute effectively. These are meant to serve as guidelines, not strict rules. We encourage you to use your best judgment and feel comfortable proposing changes to this document through a pull request.

For all contributions, a CLA (Contributor License Agreement) needs to be signed
[here](https://cla-assistant.io/TransformerOptimus/SuperAGI) before (or after) the pull request has been submitted.

**********************************Table of Content:********************************** 
1. [Code of conduct](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#code-of-conduct) 
2. [Quick Start](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#quick-start)
3. [Contributing Guidelines](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#contributing-guidelines)
    1. [Reporting Bugs](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#reporting-bugs)
    2. [New Feature or Suggesting Enhancements](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#new-feature-or-suggesting-enhancements)
4. [Testing](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#testing-changes)
5. [Pull Requests](https://github.com/TransformerOptimus/SuperAGI/blob/CONTRIBUTING.md#pull-requests)

## ✔️ Code of Conduct:

Please read our [Code of Conduct](https://github.com/TransformerOptimus/SuperAGI/blob/main/CODE_OF_CONDUCT.md) to understand the expectations we have for all contributors participating in this project. By participating, you agree to abide by our Code of Conduct.

## 🚀 Quick Start

You can quickly get started with contributing by searching for issues with the labels **"Good First Issue"** or **"Help Needed"** in the [Issues Section](https://github.com/TransformerOptimus/SuperAGI/Issues). If you think you can contribute, comment on the issue and we will assign it to you.  

To set up your development environment, please follow the steps mentioned below : 

1. Fork the repository and create a clone of the fork
2. Create a branch for a feature or a bug you are working on in your fork
3. Once you've created your branch, follow the instructions in the [README.MD](https://github.com/TransformerOptimus/SuperAGI/README.MD)

## Contributing Guidelines 
 
### 🔍 Reporting Bugs

You can start working on an existing bug that has been reported and labeled as **"Bug"** in the Issues Section, and you can report your bugs in the following manner :

1. Title describing the issue clearly and concisely with relevant labels
2. Provide a detailed description of the problem and the necessary steps to reproduce the issue.
3. Include any relevant logs, screenshots, or other helpful information supporting the issue.

### :bulb: New Feature or Suggesting Enhancements

This section guides you through working on an enhancement **Including a completely New Feature** & **Enhancements to an existing functionality**. 

Before getting started, Perform a search on Issues to see if the enhancement or feature has already been suggested and picked up. If the feature or enhancement is suggested and not picked up, comment on the issue and assign yourself to it. 

If the feature or enhancement is not in the issues, find out whether your idea fits with the scope and aims of the project by looking at the [Roadmap](https://github.com/users/TransformerOptimus/projects/5/). If yes, raise an issue with the label **"Feature Request"** in the following manner: 

1. Title describing the feature or enhancement in a clear and concise manner
2. Clearly describe the proposed enhancement, highlighting its benefits and potential drawbacks.
3. Provide examples and supporting information.

Once you have raised the issue and have gotten yourself assigned, you can start working on the feature or enhancement. Please make sure the feature or enhancement you're working on is placed on the Roadmap.

## Testing your Changes

Each method or the function of the code should have a unit test with the maximum coverage possible and on each Pull Request, we have GitHub Actions triggered, which
runs all the unit tests where all the tests should pass for merging the Pull Request. 

## Pull Request

Now that you have worked on your code and tested it thoroughly, you can now go ahead and raise the pull request. Please make sure that the Pull Request adheres to the following guidelines: 

1.  The pull request is atomic and focuses on a single change.
2.  You have read the contributing guide and your code conforms to the guidelines.
3.  You have documented your changes clearly and comprehensively.
4.  You have added the required tests.




================================================
FILE: Dockerfile
================================================
# Stage 1: Compile image
FROM python:3.10-slim-bullseye AS compile-image
WORKDIR /app

RUN apt-get update && \
    apt-get install --no-install-recommends -y wget libpq-dev gcc g++ && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

COPY requirements.txt .
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

RUN python3.10 -c "import nltk; nltk.download('punkt')" && \
  python3.10 -c "import nltk; nltk.download('averaged_perceptron_tagger')"

COPY . .

RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh

# Stage 2: Build image
FROM python:3.10-slim-bullseye AS build-image
WORKDIR /app

RUN apt-get update && \
    apt-get install --no-install-recommends -y libpq-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

COPY --from=compile-image /opt/venv /opt/venv
COPY --from=compile-image /app /app
COPY --from=compile-image /root/nltk_data /root/nltk_data

ENV PATH="/opt/venv/bin:$PATH"

EXPOSE 8001

================================================
FILE: Dockerfile-gpu
================================================
# Define the CUDA SDK version you need
ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04"
FROM nvidia/cuda:${CUDA_IMAGE}

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app

RUN apt-get update && apt-get upgrade -y \
    && apt-get install -y git build-essential \
    python3 python3-pip python3.10-venv  libpq-dev gcc wget \
    ocl-icd-opencl-dev opencl-headers clinfo \
    libclblast-dev libopenblas-dev \
    && mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

# Create a virtual environment and activate it
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

# Install Python dependencies from requirements.txt
COPY requirements.txt .
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Running nltk setup as you mentioned
RUN python3.10 -c "import nltk; nltk.download('punkt')" && \
    python3.10 -c "import nltk; nltk.download('averaged_perceptron_tagger')"

# Copy the application code
COPY . .

ENV CUDA_DOCKER_ARCH=all
ENV LLAMA_CUBLAS=1

RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python==0.2.7 --force-reinstall --upgrade --no-cache-dir

# Make necessary scripts executable
RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh

# Set environment variable to point to the custom libllama.so
# ENV LLAMA_CPP_LIB=/app/llama.cpp/libllama.so

EXPOSE 8001

CMD ["./entrypoint.sh"]

================================================
FILE: DockerfileCelery
================================================
FROM python:3.9

WORKDIR /app

#RUN apt-get update && apt-get install --no-install-recommends -y git wget libpq-dev gcc python3-dev && pip install psycopg2
RUN pip install --upgrade pip

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Downloads the tools
RUN python superagi/tool_manager.py

# Set executable permissions for install_tool_dependencies.sh
RUN chmod +x install_tool_dependencies.sh

# Install dependencies
RUN ./install_tool_dependencies.sh

# Downloads the tools
RUN python superagi/tool_manager.py

# Set executable permissions for install_tool_dependencies.sh
RUN chmod +x install_tool_dependencies.sh

# Install dependencies
RUN ./install_tool_dependencies.sh


CMD ["celery", "-A", "superagi.worker", "worker", "--beat","--loglevel=info"]


================================================
FILE: DockerfileRedis
================================================
FROM redis/redis-stack-server:latest

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2023 TransformerOptimus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.MD
================================================
<p align="center">
  <a href="https://superagi.com//#gh-light-mode-only">
    <img src="https://superagi.com/wp-content/uploads/2023/05/Logo-dark.svg" width="318px" alt="SuperAGI logo" />
  </a>
  <a href="https://superagi.com//#gh-dark-mode-only">
    <img src="https://superagi.com/wp-content/uploads/2023/05/Logo-light.svg" width="318px" alt="SuperAGI logo" />
  </a>

</p>

<p align="center"><i>Open-source framework to build, manage and run useful Autonomous AI Agents</i></p>
    

<p align="center">
<a href="https://superagi.com"> <img src="https://superagi.com/wp-content/uploads/2023/08/Website.svg"></a>
<a href="https://app.superagi.com"> <img src="https://superagi.com/wp-content/uploads/2023/07/Cloud.svg"></a>
<a href="https://marketplace.superagi.com/"> <img src="https://superagi.com/wp-content/uploads/2023/08/Marketplace.svg"></a>
<a href="https://superagi.com/docs/"> <img src="https://superagi.com/wp-content/uploads/2023/08/Docs.svg"></a>
<a href="https://documenter.getpostman.com/view/28438662/2s9Xy6rqP5"> <img src="https://superagi.com/wp-content/uploads/2023/08/APIs.svg"></a>
</p>

<p align="center">
<a href="https://github.com/TransformerOptimus/SuperAGI/fork" target="blank">
<img src="https://img.shields.io/github/forks/TransformerOptimus/SuperAGI?style=for-the-badge" alt="SuperAGI forks"/>
</a>

<a href="https://github.com/TransformerOptimus/SuperAGI/stargazers" target="blank">
<img src="https://img.shields.io/github/stars/TransformerOptimus/SuperAGI?style=for-the-badge" alt="SuperAGI stars"/>
</a>
<a href='https://github.com/TransformerOptimus/SuperAGI/releases'>
<img src='https://img.shields.io/github/release/TransformerOptimus/SuperAGI?&label=Latest&style=for-the-badge'>
</a>

<a href="https://github.com/TransformerOptimus/SuperAGI/commits" target="blank">
<img src="https://img.shields.io/github/commits-since/TransformerOptimus/SuperAGI/v0.0.11.svg?style=for-the-badge" alt="SuperAGI Commits"/>
</a>
</p>

<p align="center"><b>Follow SuperAGI </b></p>

<p align="center">
<a href="https://twitter.com/_superAGI" target="blank">
<img src="https://img.shields.io/twitter/follow/_superAGI?label=Follow: _superAGI&style=social" alt="Follow _superAGI"/>
</a>
<a href="https://www.reddit.com/r/Super_AGI" target="_blank"><img src="https://img.shields.io/twitter/url?label=/r/Super_AGI&logo=reddit&style=social&url=https://github.com/TransformerOptimus/SuperAGI"/></a>

<a href="https://discord.gg/dXbRe5BHJC" target="blank">
<img src="https://img.shields.io/discord/1107593006032355359?label=Join%20SuperAGI&logo=discord&style=social" alt="Join SuperAGI Discord Community"/>
</a>
<a href="https://www.youtube.com/@_superagi" target="_blank"><img src="https://img.shields.io/twitter/url?label=Youtube&logo=youtube&style=social&url=https://github.com/TransformerOptimus/SuperAGI"/></a>
</p>

<p align="center"><b>Connect with the Creator </b></p>

<p align="center">
<a href="https://twitter.com/ishaanbhola" target="blank">
<img src="https://img.shields.io/twitter/follow/ishaanbhola?label=Follow: ishaanbhola&style=social" alt="Follow ishaanbhola"/>
</a>
</p>

<p align="center"><b>Share SuperAGI Repository</b></p>

<p align="center">

<a href="https://twitter.com/intent/tweet?text=Check%20this%20GitHub%20repository%20out.%20SuperAGI%20-%20Let%27s%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.&url=https://github.com/TransformerOptimus/SuperAGI&hashtags=SuperAGI,AGI,Autonomics,future" target="blank">
<img src="https://img.shields.io/twitter/follow/_superAGI?label=Share Repo on Twitter&style=social" alt="Follow _superAGI"/></a> 
<a href="https://t.me/share/url?text=Check%20this%20GitHub%20repository%20out.%20SuperAGI%20-%20Let%27s%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.&url=https://github.com/TransformerOptimus/SuperAGI" target="_blank"><img src="https://img.shields.io/twitter/url?label=Telegram&logo=Telegram&style=social&url=https://github.com/TransformerOptimus/SuperAGI" alt="Share on Telegram"/></a>
<a href="https://api.whatsapp.com/send?text=Check%20this%20GitHub%20repository%20out.%20SuperAGI%20-%20Let's%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.%20https://github.com/TransformerOptimus/SuperAGI"><img src="https://img.shields.io/twitter/url?label=whatsapp&logo=whatsapp&style=social&url=https://github.com/TransformerOptimus/SuperAGI" /></a> <a href="https://www.reddit.com/submit?url=https://github.com/TransformerOptimus/SuperAGI&title=Check%20this%20GitHub%20repository%20out.%20SuperAGI%20-%20Let's%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.
" target="blank">
<img src="https://img.shields.io/twitter/url?label=Reddit&logo=Reddit&style=social&url=https://github.com/TransformerOptimus/SuperAGI" alt="Share on Reddit"/>
</a> <a href="mailto:?subject=Check%20this%20GitHub%20repository%20out.&body=SuperAGI%20-%20Let%27s%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.%3A%0Ahttps://github.com/TransformerOptimus/SuperAGI" target="_blank"><img src="https://img.shields.io/twitter/url?label=Gmail&logo=Gmail&style=social&url=https://github.com/TransformerOptimus/SuperAGI"/></a> <a href="https://www.buymeacoffee.com/superagi" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="23" width="100" style="border-radius:1px"></a>

</p>

<hr>

## What are we ?

A dev-first open source autonomous AI agent framework enabling developers to build, manage & run useful autonomous agents. You can run concurrent agents seamlessly, extend agent capabilities with tools. The agents efficiently perform a variety of tasks and continually improve their performance with each subsequent run.


### 💡 Features

- <b>Provision, Spawn & Deploy Autonomous AI Agents</b> - Create production-ready & scalable autonomous agents.
- <b>Extend Agent Capabilities with Toolkits</b> - Add Toolkits from our marketplace to your agent workflows.
- <b>Graphical User Interface</b> - Access your agents through a graphical user interface.
- <b>Action Console</b> - Interact with agents by giving them input and permissions.
- <b>Multiple Vector DBs</b> - Connect to multiple Vector DBs to enhance your agent’s performance.
- <b>Performance Telemetry</b> - Get insights into your agent’s performance and optimize accordingly.
- <b>Optimized Token Usage</b> - Control token usage to manage costs effectively.
- <b>Agent Memory Storage</b> - Enable your agents to learn and adapt by storing their memory.
- <b>Models</b> - Custom fine tuned models for business specific usecases.
- <b>Workflows</b> - Automate tasks with ease using ReAct LLM's predefined steps.

### 🛠 Toolkits
Toolkits allow SuperAGI Agents to interact with external systems and third-party plugins.

<a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Twitter.png height=50px width=50px alt="Twitter" valign="middle" title="Twitter"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Coding.png height=50px width=50px alt="Coding Tool" valign="middle" title="Coding Tool"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Insta.png height=50px width=50px alt="Instagram" valign="middle" title="Instagram"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Knowledge_tool.png height=50px width=50px alt="Knowledge Search" valign="middle" title="Knowledge Search"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113612.png height=50px width=50px alt="Email"  valign="middle" title="Email"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113610.png height=50px width=50px alt="Jira" valign="middle" title="Jira"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113611.png height=50px width=50px alt="File Manager" valign="middle" title="File Manager"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113613.png height=50px width=50px alt="Google Search" valign="middle" title="Google Search"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113615.png height=50px width=50px alt="Dall-E" valign="middle" title="Dall-E"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113614.png height=50px width=50px alt="Github" valign="middle" title="Github"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113616.png height=50px width=50px alt="Web Interaction" valign="middle" title="Web Interaction"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/05/Group-113622.png height=50px width=50px alt="Duckduckgo" valign="middle" title="Duckduckgo"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Calendar_tool.png height=50px width=50px alt="Google Calendar" valign="middle" title="Google Calendar"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Search_tool.png height=50px width=50px alt="Google Calendar" valign="middle" title="Google Search"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Serp.png height=50px width=50px alt="Serp API" valign="middle" title="Serp API"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Searx.png height=50px width=50px alt="Searx" valign="middle" title="Searx "></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Web_scraper_logo.png height=50px width=50px alt="Web Scraper" valign="middle" title="Web Scraper"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Notion_logo.png height=50px width=50px alt="Notion" valign="middle" title="Notion"></a> <a href="https://marketplace.superagi.com/" target="_blank"><img src=https://superagi.com/wp-content/uploads/2023/08/Apollo_logo.png height=50px width=50px alt="Apollo" valign="middle" title="Apollo"></a>

### ⚙️ Installation

You can install superAGI using one of the following three approaches.

#### ☁️ SuperAGI cloud

To quickly start experimenting with agents without the hassle of setting up the system, try [Superagi Cloud](https://app.superagi.com/)

1. Visit [Superagi Cloud](https://app.superagi.com/) and log in using your github account.

2. In your account settings, go to "Model Providers" and add your API key.

You're all set! Start running your agents effortlessly.

#### 🖥️ Local

1. Open your terminal and clone the SuperAGI repository.
```
git clone https://github.com/TransformerOptimus/SuperAGI.git 
```

2. Navigate to the cloned repository directory using the command:
```
cd SuperAGI
```
3. Create a copy of config_template.yaml, and name it config.yaml.

4. Ensure that Docker is installed on your system. You can download and install it from [here](https://docs.docker.com/get-docker/).

5. Once you have Docker Desktop running, run the following command in the SuperAGI directory:

   a. For regular usage:
      ```
      docker compose -f docker-compose.yaml up --build
      ```

   b. If you want to use SuperAGI with Local LLMs and have GPU, run the following command:
      ```
      docker compose -f docker-compose-gpu.yml up --build
      ```


6. Open your web browser and navigate to http://localhost:3000 to access SuperAGI.

#### 🌀 Digital Ocean

<p align="left">
<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/TransformerOptimus/SuperAGI/tree/main"> <img src="https://www.deploytodo.com/do-btn-blue.svg"></a><br>Deploy SuperAGI to DigitalOcean with one click.
</p>

<a id="architecture">

### 🌐 Architecture
</a>
<details>
<summary>SuperAGI Architecture</summary>

![SuperAGI Architecture](https://superagi.com/wp-content/uploads/2023/09/SuperAGI-Architecture.png)
</details>

<details>
<summary>Agent Architecture</summary>

![Agent Architecture](https://superagi.com/wp-content/uploads/2023/06/Agent-Architecture.png)
</details>

<details>
<summary>Agent Workflow Architecture</summary>

![Agent Workflow Architecture](https://superagi.com/wp-content/uploads/2023/09/Workflow-Architecture.png)
</details>

<details>
<summary>Tools Architecture</summary>

![Tools Architecture](https://superagi.com/wp-content/uploads/2023/09/Tools-Architecture.png)
</details>

<details>
<summary>ER Diagram</summary>

![ER Diagram](https://superagi.com/wp-content/uploads/2023/09/ER-Diagram.png)
</details>

### 📚 Resources

* [Documentation](https://superagi.com/docs/)
* [YouTube Channel](https://www.youtube.com/@_SuperAGI/videos)


### 📖 Need Help?

Join our [Discord community](https://discord.gg/dXbRe5BHJC) for support and discussions.

[![Join us on Discord](https://invidget.switchblade.xyz/uJ3XUGsY2R)](https://discord.gg/uJ3XUGsY2R)

If you have questions or encounter issues, please don't hesitate to [create a new issue](https://github.com/TransformerOptimus/SuperAGI/issues/new/choose) to get support.

### 💻 Contribution
We ❤️ our contributors. We’re committed to fostering an open, welcoming, and safe environment in the community.

If you'd like to contribute, start by reading our [Contribution Guide](https://github.com/TransformerOptimus/SuperAGI/blob/main/CONTRIBUTING.md).

We expect everyone participating in the community to abide by our [Code of Conduct](https://github.com/TransformerOptimus/SuperAGI/blob/main/CODE_OF_CONDUCT.md).

To get more idea on where we are heading, checkout our roadmap [here](https://github.com/users/TransformerOptimus/projects/5/views/1).

Explore some [good first issues](https://github.com/TransformerOptimus/SuperAGI/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to start contributing.

### 👩‍💻 Contributors
[![TransformerOptimus](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/133493246?v=4&w=50&h=50&mask=circle)](https://github.com/TransformerOptimus) [![Cptsnowcrasher](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/133322218?v=4&w=50&h=50&mask=circle)](https://github.com/Cptsnowcrasher) [![vectorcrow](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/133646556?v=4&w=50&h=50&mask=circle)](https://github.com/vectorcrow) [![Akki-jain](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/92881074?v=4&w=50&h=50&mask=circle)](https://github.com/Akki-jain) [![Autocop-Agent](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/129729746?v=4&w=50&h=50&mask=circle)](https://github.com/Autocop-Agent)[![COLONAYUSH](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/60507126?v=4&w=50&h=50&mask=circle)](https://github.com/COLONAYUSH)[![luciferlinx101](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/129729795?v=4&w=50&h=50&mask=circle)](https://github.com/luciferlinx101)[![mukundans89](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/101278493?v=4&w=50&h=50&mask=circle)](https://github.com/mukundans89)[![Fluder-Paradyne](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/121793617?v=4&w=50&h=50&mask=circle)](https://github.com/Fluder-Paradyne)[![nborthy](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/101320057?v=4&w=50&h=50&mask=circle)](https://github.com/nborthy)[![nihirr](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/122777244?v=4&w=50&h=50&mask=circle)](https://github.com/nihirr)[![Tarraann](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/97586318?v=4&w=50&h=50&mask=circle)](https://github.com/Tarraann)[![neelayan7](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/43145646?v=4&w=50&h=50&mask=circle)](https://github.com/neelayan7)[![Arkajit-Datta](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/61142632?v=4&w=50&h=50&mask=circle)](https://github.com/Arkajit-Datta)[![guangchen811](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/103159823?v=4&w=50&h=50&mask=circle)](https://github.com/guangchen811)[![juanfpo96](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/14787156?v=4&w=50&h=50&mask=circle)](https://github.com/juanfpo96)[![iskandarreza](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/32027019?v=4&w=50&h=50&mask=circle)](https://github.com/iskandarreza)[![jpenalbae](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/8380459?v=4&w=50&h=50&mask=circle)](https://github.com/jpenalbae)[![pallasite99](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/26508636?v=4&w=50&h=50&mask=circle)](https://github.com/pallasite99)[![xutpuu](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11964505?v=4&w=50&h=50&mask=circle)](https://github.com/xutpuu)[![alexkreidler](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11166947?v=4&w=50&h=50&mask=circle)](https://github.com/alexkreidler)[![hanhyalex123](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/100895608?v=4&w=50&h=50&mask=circle)](https://github.com/hanhyalex123)[![ps4vs](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/91535358?v=4&w=50&h=50&mask=circle)](https://github.com/ps4vs)[![eltociear](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/22633385?v=4&w=50&h=50&mask=circle)](https://github.com/eltociear)
[![shaiss](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/113060?v=4&w=50&h=50&mask=circle)](https://github.com/shaiss)
[![AdityaRajSingh1992](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/105219157?v=4&w=50&h=50&mask=circle)](https://github.com/AdityaRajSingh1992)
[![namansleeps2](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/134390870?v=4&w=50&h=50&mask=circle)](https://github.com/namansleeps22)
[![sirajperson](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/396941?v=4&w=50&h=50&mask=circle)](https://github.com/sirajperson)
[![hsm207](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/2398765?v=4&w=50&h=50&mask=circle)](https://github.com/hsm207)
[![unkn-wn](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/43097991?v=4&w=50&h=50&mask=circle)](https://github.com/unkn-wn)
[![DMTarmey](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/590474?v=4&w=50&h=50&mask=circle)](https://github.com/DMTarmey)
[![Parth2506](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/122429822?v=4&w=50&h=50&mask=circle)](https://github.com/Parth2506)
[![platinaCoder](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/47349795?v=4&w=50&h=50&mask=circle)](https://github.com/platinaCoder)
[![anisha1607](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/60440541?v=4&w=50&h=50&mask=circle)](https://github.com/anisha1607)
[![jorgectf](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/46056498?v=4&w=50&h=50&mask=circle)](https://github.com/jorgectf)
[![PaulRBerg](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/8782666?v=4&w=50&h=50&mask=circle)](https://github.com/PaulRBerg)
[![boundless-asura](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/122777244?v=4&w=50&h=50&mask=circle)](https://github.com/boundless-asura)
[![JPDucky](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/34105363?v=4&w=50&h=50&mask=circle)](https://github.com/JPDucky)
[![Vibhusha22](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/128478691?v=4&w=50&h=50&mask=circle)](https://github.com/Vibhusha22)
[![ai-akuma](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7444521?v=4&w=50&h=50&mask=circle)](https://github.com/ai-akuma)
[![rounak610](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/81288115?v=4&w=50&h=50&mask=circle)](https://github.com/rounak610)
[![AdarshJha619](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/53672264?v=4&w=50&h=50&mask=circle)](https://github.com/AdarshJha619)
[![ResoluteStoic](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/105219157?v=4&w=50&h=50&mask=circle)](https://github.com/ResoluteStoic)
[![JohnHunt999](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/137149331?v=4&w=50&h=50&mask=circle)](https://github.com/JohnHunt999)
[![Maverick-F35](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/138012351?v=4&w=50&h=50&mask=circle)](https://github.com/Maverick-F359)
[![jorgectf](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/46056498?v=4&w=50&h=50&mask=circle)](https://github.com/jorgectf)
[![AdityaSharma13064](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/138581531?v=4&w=50&h=50&mask=circle)](https://github.com/AdityaSharma13064)
[![lalitlj](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/138583454?v=4&w=50&h=50&mask=circle)](https://github.com/lalitlj)
[![andrew-kelly-neutralaiz](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/128111428?v=4&w=50&h=50&mask=circle)](https://github.com/andrew-kelly-neutralaiz)
[![sayan1101](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/139119661?v=4&w=50&h=50&mask=circle)](https://github.com/sayan1101)


<p align="center"><a href="https://github.com/TransformerOptimus/SuperAGI#"><img src="https://superagi.com/wp-content/uploads/2023/05/backToTopButton.png" alt="Back to top" height="29"/></a></p>

### ⚠️ Under Development!
This project is under active development and may still have issues. We appreciate your understanding and patience. If you encounter any problems, please check the open issues first. If your issue is not listed, kindly create a new issue detailing the error or problem you experienced. Thank you for your support!


================================================
FILE: alembic.ini
================================================
# A generic, single database configuration.

[alembic]
# path to migration scripts
script_location = migrations

# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
# Uncomment the line below if you want the files to be prepended with date and time
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
# for all available tokens
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s

# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
prepend_sys_path = .

# timezone to use when rendering the date within the migration file
# as well as the filename.
# If specified, requires the python-dateutil library that can be
# installed by adding `alembic[tz]` to the pip requirements
# string value is passed to dateutil.tz.gettz()
# leave blank for localtime
# timezone =

# max length of characters to apply to the
# "slug" field
# truncate_slug_length = 40

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false

# set to 'true' to allow .pyc and .pyo files without
# a source .py file to be detected as revisions in the
# versions/ directory
# sourceless = false

# version location specification; This defaults
# to migrations/versions.  When using multiple version
# directories, initial revisions must be specified with --version-path.
# The path separator used here should be the separator specified by "version_path_separator" below.
# version_locations = %(here)s/bar:%(here)s/bat:migrations/versions

# version path separator; As mentioned above, this is the character used to split
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
# Valid values for version_path_separator are:
#
# version_path_separator = :
# version_path_separator = ;
# version_path_separator = space
version_path_separator = os  # Use os.pathsep. Default configuration used for new projects.

# set to 'true' to search source files recursively
# in each "version_locations" directory
# new in Alembic version 1.10
# recursive_version_locations = false

# the output encoding used when revision files
# are written from script.py.mako
# output_encoding = utf-8

sqlalchemy.url = postgresql://superagi:password@super__postgres:5432/super_agi_main

[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts.  See the documentation for further
# detail and examples

# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S


================================================
FILE: cli2.py
================================================
import os
import sys
import subprocess
from time import sleep
import shutil
from sys import platform
from multiprocessing import Process
from superagi.lib.logger import logger


def check_command(command, message):
    if not shutil.which(command):
        logger.info(message)
        sys.exit(1)


def run_npm_commands(shell=False):
    os.chdir("gui")
    try:
        subprocess.run(["npm", "install"], check=True, shell=shell)
    except subprocess.CalledProcessError:
        logger.error(f"Error during '{' '.join(sys.exc_info()[1].cmd)}'. Exiting.")
        sys.exit(1)
    os.chdir("..")


def run_server(shell=False,a_name=None,a_description=None,goals=None):
    tgwui_process = Process(target=subprocess.run, args=(["python", "test.py","--name",a_name,"--description",a_description,"--goals"]+goals,), kwargs={"shell": shell})
    api_process = Process(target=subprocess.run, args=(["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"],), kwargs={"shell": shell})
    celery_process = Process(target=subprocess.run, args=(["celery", "-A", "celery_app", "worker", "--loglevel=info"],), kwargs={"shell": shell})
    ui_process = Process(target=subprocess.run, args=(["python", "test.py","--name",a_name,"--description",a_description,"--goals"]+goals,), kwargs={"shell": shell})
    api_process.start()
    celery_process.start()
    ui_process.start()

    return api_process, ui_process, celery_process


def cleanup(api_process, ui_process, celery_process):
    logger.info("Shutting down processes...")
    api_process.terminate()
    ui_process.terminate()
    celery_process.terminate()
    logger.info("Processes terminated. Exiting.")
    sys.exit(1)


if __name__ == "__main__":
    check_command("node", "Node.js is not installed. Please install it and try again.")
    check_command("npm", "npm is not installed. Please install npm to proceed.")
    check_command("uvicorn", "uvicorn is not installed. Please install uvicorn to proceed.")

    agent_name = input("Enter an agent name: ")
    agent_description = input("Enter an agent description: ")
    goals = []
    while True:
        goal = input("Enter a goal (or 'q' to quit): ")
        if goal == 'q':
            break
        goals.append(goal)
    isWindows = False
    if platform == "win32" or platform == "cygwin":
        isWindows = True
    run_npm_commands(shell=isWindows)

    try:
        api_process, ui_process, celery_process = run_server(isWindows, agent_name, agent_description, goals)
        while True:
            try:
                sleep(30)
            except KeyboardInterrupt:
                cleanup(api_process, ui_process, celery_process)
    except Exception as e:
        cleanup(api_process, ui_process, celery_process)

================================================
FILE: config_template.yaml
================================================
#####################------------------SYSTEM KEYS-------------------------########################
PINECONE_API_KEY: YOUR_PINECONE_API_KEY
PINECONE_ENVIRONMENT: YOUR_PINECONE_ENVIRONMENT

OPENAI_API_KEY: YOUR_OPEN_API_KEY
PALM_API_KEY: YOUR_PALM_API_KEY
REPLICATE_API_TOKEN: YOUR_REPLICATE_API_TOKEN
HUGGING_API_TOKEN: YOUR_HUGGING_FACE_API_TOKEN

# For locally hosted LLMs comment out the next line and uncomment the one after
# to configure a local llm point your browser to 127.0.0.1:7860 and click on the model tab in text generation web ui.
OPENAI_API_BASE: https://api.openai.com/v1
#OPENAI_API_BASE: "http://super__tgwui:5001/v1"

# "gpt-3.5-turbo-0301": 4032, "gpt-4-0314": 8092, "gpt-3.5-turbo": 4032, "gpt-4": 8092, "gpt-4-32k": 32768, "gpt-4-32k-0314": 32768, "llama":2048, "mpt-7b-storywriter":45000
MODEL_NAME: "gpt-3.5-turbo-0301"
# "gpt-3.5-turbo", , "gpt-4", "models/chat-bison-001"
RESOURCES_SUMMARY_MODEL_NAME: "gpt-3.5-turbo"
MAX_TOOL_TOKEN_LIMIT: 800
MAX_MODEL_TOKEN_LIMIT: 4032 # set to 2048 for llama

#DATABASE INFO
# redis details
DB_NAME: super_agi_main
DB_HOST: super__postgres
DB_USERNAME: superagi
DB_PASSWORD: password
DB_URL: postgresql://superagi:password@super__postgres:5432/super_agi_main
REDIS_URL: "super__redis:6379"

#STORAGE TYPE ("FILE" or "S3")
STORAGE_TYPE: "FILE"

#TOOLS
TOOLS_DIR: "superagi/tools"

#STORAGE INFO FOR FILES
RESOURCES_INPUT_ROOT_DIR: workspace/input/{agent_id}
RESOURCES_OUTPUT_ROOT_DIR: workspace/output/{agent_id}/{agent_execution_id} # For keeping resources at agent execution level
#RESOURCES_OUTPUT_ROOT_DIR: workspace/output/{agent_id}  # For keeping resources at agent level

#S3 RELATED DETAILS ONLY WHEN STORAGE_TYPE IS "S3"
BUCKET_NAME:
INSTAGRAM_TOOL_BUCKET_NAME:                                   #Public read bucket, Images generated by stable diffusion are put in this bucket and the public url of the same is generated.
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:

#AUTH
ENV: 'DEV' #DEV,PROD, to use GITHUB OAUTH set to PROD
JWT_SECRET_KEY: 'secret'
expiry_time_hours: 1

#GITHUB OAUTH:
GITHUB_CLIENT_ID:
GITHUB_CLIENT_SECRET:
FRONTEND_URL: "http://localhost:3000"

#ENCRYPTION KEY, Replace this with your own key for production
ENCRYPTION_KEY: abcdefghijklmnopqrstuvwxyz123456

#WEAVIATE

# If you are using docker or web hosted uncomment the next two lines and comment the third one
# WEAVIATE_URL: YOUR_WEAVIATE_URL
# WEAVIATE_API_KEY: YOUR_WEAVIATE_API_KEY
WEAVIATE_USE_EMBEDDED: true


#####################------------------TOOLS KEY-------------------------########################
#If you have google api key and CSE key, use this
GOOGLE_API_KEY: YOUR_GOOGLE_API_KEY
SEARCH_ENGINE_ID: YOUR_SEARCH_ENIGNE_ID

# IF YOU DONT HAVE GOOGLE SEARCH KEY, YOU CAN USE SERPER.DEV KEYS
SERP_API_KEY: YOUR_SERPER_API_KEY

#ENTER YOUR EMAIL CREDENTIALS TO ACCESS EMAIL TOOL
EMAIL_ADDRESS: YOUR_EMAIL_ADDRESS
EMAIL_PASSWORD: YOUR_EMAIL_APP_PASSWORD #get the app password from (https://myaccount.google.com/apppasswords)
EMAIL_SMTP_HOST: smtp.gmail.com #Change the SMTP host if not using Gmail
EMAIL_SMTP_PORT: 587 #Change the SMTP port if not using Gmail
EMAIL_IMAP_SERVER: imap.gmail.com #Change the IMAP Host if not using Gmail
EMAIL_SIGNATURE: Email sent by SuperAGI
EMAIL_DRAFT_MODE_WITH_FOLDER: YOUR_DRAFTS_FOLDER
EMAIL_ATTACHMENT_BASE_PATH: YOUR_DIRECTORY_FOR_EMAIL_ATTACHMENTS

# GITHUB
GITHUB_USERNAME: YOUR_GITHUB_USERNAME
GITHUB_ACCESS_TOKEN: YOUR_GITHUB_ACCESS_TOKEN

#JIRA
JIRA_INSTANCE_URL: YOUR_JIRA_INSTANCE_URL
JIRA_USERNAME: YOUR_JIRA_EMAIL
JIRA_API_TOKEN: YOUR_JIRA_API_TOKEN

#SLACK
SLACK_BOT_TOKEN: YOUR_SLACK_BOT_TOKEN

# For running stable diffusion
STABILITY_API_KEY: YOUR_STABILITY_API_KEY
#Engine IDs that can be used: 'stable-diffusion-v1', 'stable-diffusion-v1-5','stable-diffusion-512-v2-0', 'stable-diffusion-768-v2-0','stable-diffusion-512-v2-1','stable-diffusion-768-v2-1','stable-diffusion-xl-beta-v2-2-2'
ENGINE_ID: "stable-diffusion-xl-beta-v2-2-2"

## To config a vector store for resources manager uncomment config below
## based on the vector store you want to use

## RESOURCE_VECTOR_STORE can be REDIS, PINECONE, CHROMA, QDRANT
#RESOURCE_VECTOR_STORE: YOUR_RESOURCE_VECTOR_STORE
#RESOURCE_VECTOR_STORE_INDEX_NAME: YOUR_RESOURCE_VECTOR_STORE_INDEX_NAME

## To use a custom redis
#REDIS_VECTOR_STORE_URL: YOUR_REDIS_VECTOR_STORE_URL

## To use qdrant for vector store in resources manager
#QDRANT_PORT: YOUR_QDRANT_PORT
#QDRANT_HOST_NAME: YOUR_QDRANT_HOST_NAME

## To use chroma for vector store in resources manager
#CHROMA_HOST_NAME: YOUR_CHROMA_HOST_NAME
#CHROMA_PORT: YOUR_CHROMA_PORT

## To use Qdrant for vector store
#QDRANT_HOST_NAME: YOUR_QDRANT_HOST_NAME
#QDRANT_PORT: YOUR_QDRANT_PORT
#GPU_LAYERS: GPU LAYERS THAT YOU WANT TO OFFLOAD TO THE GPU WHILE USING LOCAL LLMS


================================================
FILE: docker-compose-dev.yaml
================================================
version: '3.8'
services:
  backend:
    volumes:
      - "./:/app"
    build: .
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    command: ["/app/wait-for-it.sh", "super__postgres:5432","-t","60","--","/app/entrypoint.sh"]
  celery:
    volumes:
      - "./:/app"
      - "${EXTERNAL_RESOURCE_DIR:-./workspace}:/app/ext"
    build: .
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    command: ["/app/entrypoint_celery.sh"]
  gui:
    build:
      context: ./gui
      args:
        NEXT_PUBLIC_API_BASE_URL: "/api"
    networks:
      - super_network
#    volumes:
#      - ./gui:/app
#      - /app/node_modules/
#      - /app/.next/
  super__redis:
    image: "redis/redis-stack-server:latest"
    networks:
      - super_network
#    uncomment to expose redis port to host
#    ports:
#      - "6379:6379"
    volumes:
      - redis_data:/data

  super__postgres:
    image: "docker.io/library/postgres:latest"
    environment:
      - POSTGRES_USER=superagi
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=super_agi_main
    volumes:
      - superagi_postgres_data:/var/lib/postgresql/data/
    networks:
      - super_network
#    uncomment to expose postgres port to host
#    ports:
#      - "5432:5432"

  proxy:
    image: nginx:stable-alpine
    ports:
      - "3000:80"
    networks:
      - super_network
    depends_on:
      - backend
      - gui
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf

networks:
  super_network:
    driver: bridge
volumes:
  superagi_postgres_data:
  redis_data:


================================================
FILE: docker-compose-gpu.yml
================================================
version: '3.8'
services:
  backend:
    volumes:
      - "./:/app"
    build:
      context: .
      dockerfile: Dockerfile-gpu 
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    command: ["/app/wait-for-it.sh", "super__postgres:5432","-t","60","--","/app/entrypoint.sh"]
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

  celery:
    volumes:
      - "./:/app"
      - "${EXTERNAL_RESOURCE_DIR:-./workspace}:/app/ext"
    build:
      context: .
      dockerfile: Dockerfile-gpu 
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    command: ["/app/entrypoint_celery.sh"]
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
  gui:
    build:
      context: ./gui
      args:
        NEXT_PUBLIC_API_BASE_URL: "/api"
    networks:
      - super_network
#    volumes:
#      - ./gui:/app
#      - /app/node_modules/
#      - /app/.next/
  super__redis:
    image: "redis/redis-stack-server:latest"
    networks:
      - super_network
#    uncomment to expose redis port to host
#    ports:
#      - "6379:6379"
    volumes:
      - redis_data:/data

  super__postgres:
    image: "docker.io/library/postgres:15"
    environment:
      - POSTGRES_USER=superagi
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=super_agi_main
    volumes:
      - superagi_postgres_data:/var/lib/postgresql/data/
    networks:
      - super_network
#    uncomment to expose postgres port to host
#    ports:
#      - "5432:5432"

  proxy:
    image: nginx:stable-alpine
    ports:
      - "3000:80"
    networks:
      - super_network
    depends_on:
      - backend
      - gui
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf

networks:
  super_network:
    driver: bridge
volumes:
  superagi_postgres_data:
  redis_data:


================================================
FILE: docker-compose.image.example.yaml
================================================
version: '3.8'
services:
  backend:
    image: "superagidev/superagi:main"
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    env_file:
      - config.yaml
    command: ["/app/wait-for-it.sh", "super__postgres:5432","-t","60","--","/app/entrypoint.sh"]

  celery:
    image: "superagidev/superagi:main"
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    env_file:
      - config.yaml
    command: ["/app/entrypoint_celery.sh"]
    volumes:
      - "./workspace:/app/workspace"

  gui:
    image: "superagidev/superagi-frontend:main"
    environment:
      - NEXT_PUBLIC_API_BASE_URL=/api
    networks:
      - super_network

  super__redis:
    image: "redis/redis-stack-server:latest"
    networks:
      - super_network
#    uncomment to expose redis port to host
#    ports:
#      - "6379:6379"
    volumes:
      - redis_data:/data

  super__postgres:
    image: "docker.io/library/postgres:latest"
    environment:
      - POSTGRES_USER=superagi
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=super_agi_main
    volumes:
      - superagi_postgres_data:/var/lib/postgresql/data/
    networks:
      - super_network
#    uncomment to expose postgres port to host
#    ports:
#      - "5432:5432"

  proxy:
    image: nginx:stable-alpine
    ports:
      - "3000:80"
    networks:
      - super_network
    depends_on:
      - backend
      - gui
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf

networks:
  super_network:
    driver: bridge
volumes:
  superagi_postgres_data:
  redis_data:


================================================
FILE: docker-compose.yaml
================================================
version: '3.8'
services:
  backend:
    volumes:
      - "./:/app"
    build: .
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    command: ["/app/wait-for-it.sh", "super__postgres:5432","-t","60","--","/app/entrypoint.sh"]
  celery:
    volumes:
      - "./:/app"
      - "${EXTERNAL_RESOURCE_DIR:-./workspace}:/app/ext"
    build: .
    depends_on:
      - super__redis
      - super__postgres
    networks:
      - super_network
    command: ["/app/entrypoint_celery.sh"]
  gui:
    build:
      context: ./gui
      args:
        NEXT_PUBLIC_API_BASE_URL: "/api"
    networks:
      - super_network
#    volumes:
#      - ./gui:/app
#      - /app/node_modules/
#      - /app/.next/
  super__redis:
    image: "redis/redis-stack-server:latest"
    networks:
      - super_network
#    uncomment to expose redis port to host
#    ports:
#      - "6379:6379"
    volumes:
      - redis_data:/data

  super__postgres:
    image: "docker.io/library/postgres:15"
    environment:
      - POSTGRES_USER=superagi
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=super_agi_main
    volumes:
      - superagi_postgres_data:/var/lib/postgresql/data/
    networks:
      - super_network
#    uncomment to expose postgres port to host
#    ports:
#      - "5432:5432"

  proxy:
    image: nginx:stable-alpine
    ports:
      - "3000:80"
    networks:
      - super_network
    depends_on:
      - backend
      - gui
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf

networks:
  super_network:
    driver: bridge
volumes:
  superagi_postgres_data:
  redis_data:

================================================
FILE: entrypoint.sh
================================================
#!/bin/bash

# Downloads the tools from marketplace and external tool repositories
python superagi/tool_manager.py

# Install dependencies
./install_tool_dependencies.sh

# Run Alembic migrations
alembic upgrade head

# Start the app
exec uvicorn main:app --host 0.0.0.0 --port 8001 --reload


================================================
FILE: entrypoint_celery.sh
================================================
#!/bin/bash

# Downloads the tools
python superagi/tool_manager.py

# Install dependencies
./install_tool_dependencies.sh

exec celery -A superagi.worker worker --beat --loglevel=info

================================================
FILE: gui/.dockerignore
================================================
# Ignore everything
**

# Allow files and directories
!app
!pages
!public
!utils
!package.json
!next.config.js
!package-lock.json
!.eslintrc.json
!jsconfig.json

================================================
FILE: gui/.eslintrc.json
================================================
{
  "extends": "next/core-web-vitals"
}


================================================
FILE: gui/Dockerfile
================================================
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci

# Rebuild the source code only when needed
FROM node:18-alpine AS builder

WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules

COPY . .
ARG NEXT_PUBLIC_API_BASE_URL=/api
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL
ARG NEXT_PUBLIC_MIXPANEL_AUTH_ID
ENV NEXT_PUBLIC_MIXPANEL_AUTH_ID=$NEXT_PUBLIC_MIXPANEL_AUTH_ID
EXPOSE 3000

CMD ["npm", "run", "dev"]

================================================
FILE: gui/DockerfileProd
================================================
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --only=production

# Rebuild the source code only when needed
FROM node:18-alpine AS builder

WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules

COPY . .
ARG NEXT_PUBLIC_API_BASE_URL=/api
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL

RUN npm run build

# Production image, copy all the files and run next
FROM node:18-alpine AS runner
WORKDIR /app

ENV NODE_ENV production

RUN addgroup --system --gid 1001 supergroup
RUN adduser --system --uid 1001 superuser

COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=superuser:supergroup /app/.next/standalone ./
COPY --from=builder --chown=superuser:supergroup /app/.next/static ./.next/static

USER superuser

EXPOSE 3000

ENV PORT 3000

CMD ["node", "server.js"]

================================================
FILE: gui/README.md
================================================
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.


================================================
FILE: gui/app/globals.css
================================================
:root {
  --max-width: 1100px;
  --border-radius: 12px;
  --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
    'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
    'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;

  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;

  --primary-glow: conic-gradient(
    from 180deg at 50% 50%,
    #16abff33 0deg,
    #0885ff33 55deg,
    #54d6ff33 120deg,
    #0071ff33 160deg,
    transparent 360deg
  );
  --secondary-glow: radial-gradient(
    rgba(255, 255, 255, 1),
    rgba(255, 255, 255, 0)
  );

  --tile-start-rgb: 239, 245, 249;
  --tile-end-rgb: 228, 232, 233;
  --tile-border: conic-gradient(
    #00000080,
    #00000040,
    #00000030,
    #00000020,
    #00000010,
    #00000010,
    #00000080
  );

  --callout-rgb: 238, 240, 241;
  --callout-border-rgb: 172, 175, 176;
  --card-rgb: 180, 185, 188;
  --card-border-rgb: 131, 134, 135;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;

    --primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
    --secondary-glow: linear-gradient(
      to bottom right,
      rgba(1, 65, 255, 0),
      rgba(1, 65, 255, 0),
      rgba(1, 65, 255, 0.3)
    );

    --tile-start-rgb: 2, 13, 46;
    --tile-end-rgb: 2, 5, 19;
    --tile-border: conic-gradient(
      #ffffff80,
      #ffffff40,
      #ffffff30,
      #ffffff20,
      #ffffff10,
      #ffffff10,
      #ffffff80
    );

    --callout-rgb: 20, 20, 20;
    --callout-border-rgb: 108, 108, 108;
    --card-rgb: 100, 100, 100;
    --card-border-rgb: 200, 200, 200;
  }
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  color: rgb(var(--foreground-rgb));
  background: linear-gradient(
      to bottom,
      transparent,
      rgb(var(--background-end-rgb))
    )
    rgb(var(--background-start-rgb));
}

a {
  color: inherit;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
  }
}

================================================
FILE: gui/app/layout.js
================================================
import './globals.css'

export const metadata = {
  title: 'Super AGI',
  description: 'Generated by create next app',
}

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}


================================================
FILE: gui/jsconfig.json
================================================
{
  "compilerOptions": {
    "paths": {
      "@/*": ["./*"]
    }
  }
}


================================================
FILE: gui/next.config.js
================================================
/** @type {import('next').NextConfig} */
const nextConfig = {
  assetPrefix: process.env.NODE_ENV === "production" ? "/" : "./",
  output: 'standalone'
};

module.exports = nextConfig;


================================================
FILE: gui/package.json
================================================
{
  "name": "super-agi",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "export": "next export"
  },
  "dependencies": {
    "axios": "^1.4.0",
    "bootstrap": "^5.2.3",
    "date-fns": "^2.30.0",
    "date-fns-tz": "^2.0.0",
    "echarts": "^5.4.2",
    "echarts-for-react": "^3.0.2",
    "eslint": "8.40.0",
    "eslint-config-next": "13.4.2",
    "js-cookie": "^3.0.5",
    "jszip": "^3.10.1",
    "mitt": "^3.0.0",
    "mixpanel-browser": "^2.47.0",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.43",
    "next": "13.4.2",
    "react": "18.2.0",
    "react-datetime": "^3.2.0",
    "react-dom": "18.2.0",
    "react-draggable": "^4.4.5",
    "react-grid-layout": "^1.3.4",
    "react-markdown": "^8.0.7",
    "react-spinners": "^0.13.8",
    "react-tippy": "^1.4.0",
    "react-toastify": "^9.1.3"
  }
}


================================================
FILE: gui/pages/Content/APM/Apm.module.css
================================================
.apm_dashboard_container {
    display: flex;
    flex-direction: column;
}

.apm_dashboard {
    margin-top: 16px;
    height: calc(100vh - 16vh);
    overflow-y: auto;
}

================================================
FILE: gui/pages/Content/APM/ApmDashboard.js
================================================
import React, {useState, useEffect, useCallback, useRef} from 'react';
import Image from "next/image";
import style from "./Apm.module.css";
import 'react-toastify/dist/ReactToastify.css';
import {getActiveRuns, getAgentRuns, getAllAgents, getToolsUsage, getMetrics} from "@/pages/api/DashboardService";
import {formatNumber, formatTime, returnToolkitIcon} from "@/utils/utils";
import {BarGraph} from "./BarGraph.js";
import {WidthProvider, Responsive} from 'react-grid-layout';
import 'react-grid-layout/css/styles.css';
import 'react-resizable/css/styles.css';
import { Tooltip } from 'react-tippy';

const ResponsiveGridLayout = WidthProvider(Responsive);

export default function ApmDashboard() {
  const [agentDetails, setAgentDetails] = useState([]);
  const [tokenDetails, setTokenDetails] = useState([]);
  const [runDetails, setRunDetails] = useState(0);
  const [allAgents, setAllAgents] = useState([]);
  const [dropdown1, setDropDown1] = useState(false);
  const [dropdown2, setDropDown2] = useState(false);
  const [dropdown3, setDropDown3] = useState(false);
  const [selectedAgent, setSelectedAgent] = useState('Select an Agent');
  const [selectedAgentIndex, setSelectedAgentIndex] = useState(-1);
  const [selectedAgentRun, setSelectedAgentRun] = useState([]);
  const [activeRuns, setActiveRuns] = useState([]);
  const [selectedAgentDetails, setSelectedAgentDetails] = useState(null);
  const [toolsUsed, setToolsUsed] = useState([]);
  const [showToolTip, setShowToolTip] = useState(false);
  const [toolTipIndex, setToolTipIndex] = useState(-1);
  const initialLayout = [
    {i: 'total_agents', x: 0, y: 0, w: 3, h: 1.5},
    {i: 'total_tokens', x: 3, y: 0, w: 3, h: 1.5},
    {i: 'total_runs', x: 6, y: 0, w: 3, h: 1.5},
    {i: 'active_runs', x: 9, y: 0, w: 3, h: 2},
    {i: 'most_used_tools', x: 9, y: 1, w: 3, h: 2},
    {i: 'models_by_agents', x: 0, y: 1, w: 3, h: 2.5},
    {i: 'runs_by_model', x: 3, y: 1, w: 3, h: 2.5},
    {i: 'tokens_by_model', x: 6, y: 1, w: 3, h: 2.5},
    {i: 'agent_details', x: 0, y: 2, w: 12, h: 2.5},
    {i: 'total_tokens_consumed', x: 0, y: 3, w: 4, h: 2},
    {i: 'total_calls_made', x: 4, y: 3, w: 4, h: 2},
    {i: 'tokens_consumed_per_call', x: 8, y: 3, w: 4, h: 2},
  ];
  const storedLayout = localStorage.getItem('myLayoutKey');
  const [layout, setLayout] = useState(storedLayout !== null ? JSON.parse(storedLayout) : initialLayout);
  const firstUpdate = useRef(true);

  const onLayoutChange = (currentLayout) => {
    setLayout(currentLayout);
  };

  const onClickLayoutChange = () => {
    localStorage.setItem('myLayoutKey', JSON.stringify(initialLayout));
    setLayout(initialLayout);
  }

  useEffect(() => {
    if (!firstUpdate.current) {
      localStorage.setItem('myLayoutKey', JSON.stringify(layout));
    } else {
      firstUpdate.current = false;
    }
  }, [layout]);

  const assignDefaultDataPerModel = (data, modelList) => {
    const modelsInData = data.map(item => item.name);
    modelList.forEach((model) => {
      if (!modelsInData.includes(model)) {
        data.push({name: model, value: 0});
      }
    });
  };

  useEffect(() => {
    const fetchData = async () => {
      try {
        const [metricsResponse, agentsResponse, activeRunsResponse, toolsUsageResponse] = await Promise.all([getMetrics(), getAllAgents(), getActiveRuns(), getToolsUsage()]);
        const models = ['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4-32k', 'google-palm-bison-001', 'replicate-llama13b-v2-chat'];

        assignDefaultDataPerModel(metricsResponse.data.agent_details.model_metrics, models);
        assignDefaultDataPerModel(metricsResponse.data.tokens_details.model_metrics, models);
        assignDefaultDataPerModel(metricsResponse.data.run_details.model_metrics, models);

        setAgentDetails(metricsResponse.data.agent_details);
        setTokenDetails(metricsResponse.data.tokens_details);
        setRunDetails(metricsResponse.data.run_details);
        setAllAgents(agentsResponse.data.agent_details);
        setActiveRuns(activeRunsResponse.data);
        setToolsUsed(toolsUsageResponse.data);
      } catch (error) {
        console.log(`Error in fetching data: ${error}`);
      }
    }

    fetchData();
    const interval = setInterval(fetchData, 10000);
    return () => clearInterval(interval);
  }, []);

  useEffect(() => {
    console.log(toolsUsed)
  }, [toolsUsed]);

  const handleSelectedAgent = useCallback((index, name) => {
    setDropDown1(false)
    setDropDown2(false)
    setDropDown3(false)
    setSelectedAgent(name)
    setSelectedAgentIndex(index)
    const agentDetails = allAgents.find(agent => agent.agent_id === index);
    setSelectedAgentDetails(agentDetails);

    getAgentRuns(index).then((response) => {
      const data = response.data;
      setSelectedAgentRun(data);
    }).catch((error) => console.error(`Error in fetching agent runs: ${error}`));
  }, [allAgents]);

  useEffect(() => handleSelectedAgent(selectedAgentIndex, selectedAgent), [allAgents]);

  useEffect(() => {
    if (allAgents.length > 0 && selectedAgent === 'Select an Agent') {
      const lastAgent = allAgents[allAgents.length - 1];
      handleSelectedAgent(lastAgent.agent_id, lastAgent.name);
    }
  }, [allAgents, selectedAgent, handleSelectedAgent]);

  const setToolTipState = (state, index) => {
    setShowToolTip(state)
    setToolTipIndex(index)
  }

  return (
    <div className={style.apm_dashboard_container}>
      <div id="apm_dashboard" className={style.apm_dashboard}>
        <div className="horizontal_space_between w_100 align_center padding_0_8">
          <span className="text_14 mt_6 ml_6">Agent Performance Monitoring</span>
          {/*<button onClick={onClickLayoutChange} className="primary_button">Reset</button>*/}
        </div>
        <ResponsiveGridLayout
          className="layout"
          layouts={{lg: layout}}
          onLayoutChange={onLayoutChange}
          breakpoints={{lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0}}
          cols={{lg: 12, md: 12, sm: 12, xs: 12, xxs: 12}}>
          <div key="total_agents" className="display_column_container">
            <span className="text_14 mb_8">Total Agents</span>
            <div
              className="text_60_bold display_flex justify_center align_center w_100 h_100 mb_24 mt_24">{formatNumber(agentDetails.total_agents)}</div>
          </div>
          <div key="total_tokens" className="display_column_container">
            <span className="text_14 mb_8">Total tokens consumed</span>
            <div
              className="text_60_bold display_flex justify_center align_center w_100 h_100 mb_24 mt_24">{formatNumber(tokenDetails.total_tokens)}</div>
          </div>
          <div key="total_runs" className="display_column_container">
            <span className="text_14 mb_8">Total runs</span>
            <div
              className="text_60_bold display_flex justify_center align_center w_100 h_100 mb_24 mt_24">{formatNumber(runDetails.total_runs)}</div>
          </div>

          <div key="models_by_agents" className="display_column_container">
            <span className="text_14 mb_8">Number of Agents per model</span>
            {agentDetails.model_metrics && agentDetails.model_metrics.length > 0
              ? <><BarGraph data={agentDetails.model_metrics} type="value" color="#3C7EFF"/>
                <div className="horizontal_container mt_10">
                  <span className="bar_label_dot" style={{backgroundColor: '#3C7EFF'}}></span>
                  <span className="bar_label_text">Models</span>
                </div>
              </>
              : <div className="vertical_container align_center mt_80 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Agents Found</span>
              </div>}
          </div>

          <div key="runs_by_model" className="display_column_container">
            <span className="text_14 mb_8">Number of Runs per Model</span>
            {runDetails.model_metrics && runDetails.model_metrics.length > 0
              ? <><BarGraph data={runDetails.model_metrics} type="value" color="#3C7EFF"/>
                <div className="horizontal_container mt_10">
                  <span className="bar_label_dot" style={{backgroundColor: '#3C7EFF'}}></span>
                  <span className="bar_label_text">Models</span>
                </div>
              </>
              : <div className="vertical_container align_center mt_80 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Agents Found</span>
              </div>}
          </div>

          <div key="tokens_by_model" className="display_column_container">
            <span className="text_14 mb_8">Total Tokens consumed by models</span>
            {tokenDetails.model_metrics && tokenDetails.model_metrics.length > 0
              ? <><BarGraph data={tokenDetails.model_metrics} type="value" color="#3C7EFF"/>
                <div className="horizontal_container mt_10">
                  <span className="bar_label_dot" style={{backgroundColor: '#3C7EFF'}}></span>
                  <span className="bar_label_text">Models</span>
                </div>
              </>
              : <div className="vertical_container align_center mt_80 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Agents Found</span>
              </div>}
          </div>

          <div key="most_used_tools" className="display_column_container">
            <span className="text_14 mb_8">Most used tools</span>
            {toolsUsed.length === 0 ?
              <div className="vertical_container align_center mt_70 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Used Tools Found</span>
              </div> : <div className="scrollable_container">
                <table className="table_css margin_0 padding_0">
                  <thead>
                  <tr style={{borderTop: 'none'}}>
                    <th className="table_header w_56">Tool</th>
                    <th className="table_header text_align_right w_22">Agents</th>
                    <th className="table_header text_align_right w_22">Calls</th>
                  </tr>
                  </thead>
                </table>

                <div className="overflow_auto w_100">
                  <table className="table_css margin_0">
                    <tbody>
                    {toolsUsed.map((tool, index) => (
                      <tr key={index}>
                        <td className="table_data" style={{width: '100%', display: 'flex', alignItems: 'center'}}>
                          <Image className="image_class bg_black" width={20} height={20}
                                 src={returnToolkitIcon(tool.toolkit)} alt="tool-icon"/>
                          <span>{tool.tool_name}</span>
                        </td>
                        <td className="table_data text_align_right w_22 br_left_grey">{tool.unique_agents}</td>
                        <td className="table_data text_align_right w_22 br_left_grey">{tool.total_usage}</td>
                      </tr>
                    ))}
                    </tbody>
                  </table>
                </div>
              </div>}
          </div>

          <div key="agent_details" className="display_column_container">
            <span className="text_14 mb_8">Agent Overview</span>
            {allAgents.length === 0 ?
              <div className="vertical_container align_center mt_50 w_100">
                <img src="/images/no_permissions.svg" width={300} height={120} alt="No Data"/>
                <span
                  className="text_12 color_white mt_6">{selectedAgent === 'Select an Agent' ? 'Please Select an Agent' :
                  <React.Fragment>No Runs found for <b>{selectedAgent}</b></React.Fragment>}</span>
              </div> : <div className="scrollable_container mt_16">
                <table className="table_css margin_0 padding_0">
                  <thead>
                  <tr style={{borderTop: 'none'}}>
                    <th className="table_header w_20">Agent Name</th>
                    <th className="table_header text_align_right w_10">Model</th>
                    <th className="table_header text_align_right w_12">Tokens Consumed</th>
                    <th className="table_header text_align_right w_6">Runs</th>
                    <th className="table_header text_align_right w_12">Avg tokens per run</th>
                    <th className="table_header text_align_right w_20">Tools</th>
                    <th className="table_header text_align_right w_10">Calls</th>
                    <th className="table_header text_align_right w_10">Avg Run Time</th>
                  </tr>
                  </thead>
                </table>

                <div className="overflow_auto w_100">
                  <table className="table_css margin_0">
                    <tbody>
                    {allAgents.map((run, i) => (
                      <tr key={i}>
                        <td className="table_data w_20">{run.name}</td>
                        <td className="table_data text_align_right w_10 br_left_grey">{run.model_name}</td>
                        <td className="table_data text_align_right w_12 br_left_grey">{formatNumber(run.total_tokens)}</td>
                        <td className="table_data text_align_right w_6 br_left_grey">{run.runs_completed}</td>
                        <td className="table_data text_align_right w_12 br_left_grey">
                          {run.runs_completed ? formatNumber((run.total_tokens / run.runs_completed).toFixed(1)) : '-'}
                        </td>
                        <td className="table_data text_align_right br_left_grey" style={{width: '20%'}}>
                          {run.tools_used && run.tools_used.slice(0, 3).map((tool, index) => (
                              <div key={index} className="tools_used">{tool}</div>
                          ))}
                          {run.tools_used && run.tools_used.length > 3 &&
                              <div style={{display:'inline-flex'}}>
                                <Tooltip
                                    position="top-start"
                                    trigger="mouseenter"
                                    arrow={true}
                                    html={
                                      <>
                                        <div className="bg_primary br_8 padding_5">
                                        {run.tools_used.slice(3).map((tool,index) =>
                                            <div className="tools_used" key={index}>{tool}</div>
                                        )}
                                        </div>
                                      </>
                                    }
                                >
                                  <div className="tools_used cursor_pointer">
                                    +{run.tools_used.length - 3}
                                  </div>
                                </Tooltip>
                              </div>
                          }
                        </td>
                        <td className="table_data text_align_right w_10 br_left_grey">{run.total_calls}</td>
                        <td className="table_data text_align_right w_10 br_left_grey">
                          {run.avg_run_time === 0 ? '-' : `${parseFloat((run.avg_run_time / 60).toFixed(1))} mins`}
                        </td>
                      </tr>))}
                    </tbody>
                  </table>
                </div>
              </div>}
          </div>
          <div key="active_runs" className="display_column_container">
            <span className="text_14 mb_8">Active Runs</span>
            <div className="scrollable_container gap_8">
              {activeRuns.length === 0 ?
                <div className="vertical_container align_center mt_24">
                  <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                  <span className="text_12 color_white mt_6">No active runs found</span>
                </div> : activeRuns.map((run, index) => (
                  <div key={index} className="active_runs">
                    <span className="text_14">{run.name}</span>
                    <div style={{display: 'inline-flex', alignItems: 'center'}}>
                      <span className="text_12 mt_6">{run.agent_name} ·  <Image width={12} height={12} src="/images/schedule.svg" alt="schedule-icon"/>
                        {formatTime(run.created_at)}</span>
                    </div>
                  </div>
                ))}
            </div>
          </div>
          <div key="total_tokens_consumed" className="display_column_container">
            <div className="horizontal_space_between w_100">
              <span className="text_14 mb_8">Tokens Consumed by Runs</span>
              <div style={{position: 'relative', display: 'flex', flexDirection: 'column'}}>
                {allAgents.length > 0 && <div>
                  <div className="text_14 mb_8 cursor_pointer" onClick={() => setDropDown2(!dropdown2)}>{selectedAgent}<img width={18} height={16}
                                                                                    src="/images/expand_more.svg"/></div>
                  {dropdown2 &&
                    <div className="custom_select_options padding_8 position_absolute r_0">
                      {allAgents.map((agent, index) => (
                        <div key={index} className="custom_select_option padding_8" onClick={() => handleSelectedAgent(agent.agent_id, agent.name)}>{agent.name}</div>))}
                    </div>}
                </div>}
              </div>
            </div>
            {selectedAgentRun.length > 0
              ? <><BarGraph data={selectedAgentRun} type="tokens_consumed" color="#3DFF7F"/>
                <div className="horizontal_container mt_10">
                  <span className="bar_label_dot" style={{backgroundColor: '#3DFF7F'}}></span>
                  <span className="bar_label_text">Runs</span>
                </div>
              </>
              : <div className="vertical_container align_center mt_80 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Runs Found</span>
              </div>}
          </div>

          <div key="total_calls_made" className="display_column_container">
            <div className="horizontal_space_between w_100">
              <span className="text_14 mb_8">Calls Made by Runs</span>
              <div className="vertical_containers position_relative">
                {allAgents.length > 0 && <div>
                  <div className="text_14 mb_8 cursor_pointer"
                       onClick={() => setDropDown1(!dropdown1)}>{selectedAgent}<img width={18} height={16} src="/images/expand_more.svg"/>
                  </div>
                  {dropdown1 &&
                    <div className="custom_select_options padding_8 position_absolute r_0">
                      {allAgents.map((agent, index) => (
                        <div key={index} className="custom_select_option padding_8" onClick={() => handleSelectedAgent(agent.agent_id, agent.name)}>{agent.name}</div>))}
                    </div>}
                </div>}
              </div>
            </div>
            {selectedAgentRun.length > 0
              ? <><BarGraph data={selectedAgentRun} type="calls" color="#3DFF7F"/>
                <div className="horizontal_container mt_10">
                  <span className="bar_label_dot" style={{backgroundColor: '#3DFF7F'}}></span>
                  <span className="bar_label_text">Runs</span>
                </div>
              </>
              : <div className="vertical_container align_center mt_80 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Runs Found</span>
              </div>}
          </div>
          <div key="tokens_consumed_per_call" className="display_column_container">
            <div className="horizontal_space_between w_100">
              <span className="text_14 mb_8">Average Tokens consumed in all calls per run </span>
              <div className="vertical_containers position_relative">
                {allAgents.length > 0 && <div>
                  <div className="text_14 mb_8 cursor_pointer"
                       onClick={() => setDropDown3(!dropdown3)}>{selectedAgent}<img width={18} height={16} src="/images/expand_more.svg"/>
                  </div>
                  {dropdown3 &&
                    <div className="custom_select_options padding_8 position_absolute r_0">
                      {allAgents.map((agent, index) => (
                        <div key={index} className="custom_select_option padding_8"
                             onClick={() => handleSelectedAgent(agent.agent_id, agent.name)}>{agent.name}</div>))}
                    </div>}
                </div>}
              </div>
            </div>
            {selectedAgentRun.length > 0
              ? <><BarGraph data={selectedAgentRun} type="tokens_per_call" color="#3DFF7F"/>
                <div className="horizontal_container mt_10">
                  <span className="bar_label_dot" style={{backgroundColor: '#3DFF7F'}}></span>
                  <span className="bar_label_text">Runs</span>
                </div>
              </>
              : <div className="vertical_container align_center mt_80 w_100">
                <img src="/images/no_permissions.svg" width={190} height={74} alt="No Data"/>
                <span className="text_12 color_white mt_6">No Runs Found</span>
              </div>}
          </div>
        </ResponsiveGridLayout>
      </div>
    </div>
  );
}


================================================
FILE: gui/pages/Content/APM/BarGraph.js
================================================
import React, {useEffect, useRef} from "react";
import * as echarts from 'echarts';

export const BarGraph = ({data, type, color}) => {
  const chartRef = useRef(null);
  const containerRef = useRef(null);

  useEffect(() => {
    const chartInstance = echarts.getInstanceByDom(chartRef.current);
    const chart = chartInstance ? chartInstance : echarts.init(chartRef.current);

    const option = {
      color: color,
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow'
        }
      },
      xAxis: {
        type: 'category',
        data: data.map(item => item.name),
        axisLabel: {
          interval: 0,
          rotate: 45,
          color: '#888'
        }
      },
      yAxis: {
        type: 'value',
        axisLabel: {
          formatter: function (value) {
            if (value >= 1000) {
              return `${value / 1000}k`;
            } else {
              return value;
            }
          }
        },
        splitLine: {
          lineStyle: {
            color: 'rgba(255, 255, 255, 0.08)'
          }
        }
      },
      series: [{
        data: data.map(item => type === 'tokens_per_call' ? (item.tokens_consumed / item.calls) : item[type]),
        type: 'bar'
      }],
      responsive: true
    };

    chart.setOption(option);

    const resizeObserver = new ResizeObserver(entries => {
      entries.forEach(entry => {
        chart.resize();
      });
    });

    resizeObserver.observe(containerRef.current);

    return () => resizeObserver.disconnect();
  }, [data, type]);

  return (
    <div ref={containerRef} style={{width: '100%', height: '100%'}}>
      <div ref={chartRef} style={{width: '100%', height: '100%'}}></div>
    </div>
  );
}

export default BarGraph;

================================================
FILE: gui/pages/Content/Agents/ActionConsole.js
================================================
import React, {useState, useEffect} from 'react';
import styles from './Agents.module.css';
import Image from 'next/image';
import {updatePermissions} from '@/pages/api/DashboardService';
import {formatTimeDifference} from '@/utils/utils';

function ActionBox({action, index, denied, reasons, handleDeny, handleSelection, setReasons}) {
  const isDenied = denied[index];

  return (
    <div key={action.id} className={styles.history_box}
         style={{background: '#272335', padding: '16px', cursor: 'default'}}>
      <div style={{display: 'flex', flexDirection: 'column'}}>
        {action.question && (<div className={styles.feed_title}>{action.question}</div>)}
        {!action.question && (<div>Tool <b>{action.tool_name}</b> is seeking for Permissions</div>)}

        {isDenied && (
          <div style={{marginTop: '26px'}}>
            <div>Provide Feedback <span style={{color: '#888888'}}>(Optional)</span></div>
            <input style={{marginTop: '6px'}} type="text" value={reasons[index]} placeholder="Enter your input here"
                   className="input_medium"
                   onChange={(e) => {
                     const newReasons = [...reasons];
                     newReasons[index] = e.target.value;
                     setReasons(newReasons);
                   }}/>
          </div>
        )}
        {isDenied ? (
          <div style={{display: 'inline-flex', gap: '8px'}}>
            <button onClick={() => handleDeny(index)} className="secondary_button mt_16" style={{paddingLeft: '10px'}}>
              <Image width={12} height={12} src="/images/undo.svg" alt="check-icon"/>
              <span className={styles.text_12_n}>Go Back</span>
            </button>
            <button onClick={() => handleSelection(index, false, action.id)} className="secondary_button mt_16"
                    style={{background: 'transparent', border: 'none'}}>
              <span className={styles.text_12_n}>Proceed to Deny</span>
            </button>
          </div>
        ) : (
          <div style={{display: 'inline-flex', gap: '8px'}}>
            <button onClick={() => handleSelection(index, true, action.id)} className="secondary_button mt_16"
                    style={{paddingLeft: '10px'}}>
              <Image width={12} height={12} src="/images/check.svg" alt="check-icon"/>
              <span className={styles.text_12_n}>Approve</span>
            </button>
            <button onClick={() => handleDeny(index)} className="secondary_button mt_16"
                    style={{background: 'transparent', border: 'none'}}>
              <Image width={16} height={16} src="/images/close.svg" alt="close-icon"/>
              <span className={styles.text_12_n}>Deny</span>
            </button>
          </div>
        )}
      </div>
      <div style={{display: 'flex', alignItems: 'center', paddingLeft: '0', paddingBottom: '0'}}
           className={styles.tab_text}>
        <div>
          <Image width={12} height={12} src="/images/schedule.svg" alt="schedule-icon"/>
        </div>
        <div className={styles.history_info}>{formatTimeDifference(action.time_difference)}</div>
      </div>
    </div>
  );
}

function HistoryBox({action}) {
  return (
    <div key={action.id} className={styles.history_box}
         style={{background: '#272335', padding: '16px', cursor: 'default'}}>
      <div style={{display: 'flex', flexDirection: 'column'}}>
        <div>Permissions for <b>{action.tool_name}</b> was::</div>
        {action.status && action.status === 'APPROVED' ? (
          <button className="history_permission mt_16">
            <Image width={12} height={12} src="/images/check.svg" alt="check-icon"/>
            <span className={styles.text_12_n}>Approved</span>
          </button>
        ) : (
          <button className="history_permission mt_16">
            <Image width={14} height={14} src="/images/close.svg" alt="close-icon"/>
            <span className={styles.text_12_n}>Denied</span>
          </button>
        )}
        {action.user_feedback != null &&
          <div style={{display: 'flex', flexDirection: 'column'}}>
            <div className="mt_16" style={{color: '#888888'}}>FeedBack</div>
            <div className="mt_6 mb_8">{action.user_feedback}</div>
          </div>
        }
        <div style={{display: 'flex', alignItems: 'center', paddingLeft: '0', paddingBottom: '0'}}
             className={styles.tab_text}>
          <div>
            <Image width={12} height={12} src="/images/schedule.svg" alt="schedule-icon"/>
          </div>
          <div className={styles.history_info}>{formatTimeDifference(action.time_difference)}</div>
        </div>
      </div>
    </div>
  )
}

export default function ActionConsole({actions, pendingPermission, setPendingPermissions}) {
  const [hiddenActions, setHiddenActions] = useState([]);
  const [denied, setDenied] = useState([]);
  const [reasons, setReasons] = useState([]);
  const [localActionIds, setLocalActionIds] = useState([]);

  useEffect(() => {
    const updatedActions = actions?.filter((action) => !localActionIds.includes(action.id));

    if (updatedActions && updatedActions.length > 0) {
      setLocalActionIds((prevIds) => [...prevIds, ...updatedActions.map(({id}) => id)]);

      setDenied((prevDenied) => prevDenied.map((value, index) => updatedActions[index] ? false : value));
      setReasons((prevReasons) => prevReasons.map((value, index) => updatedActions[index] ? '' : value));
    }
  }, [actions]);

  const handleDeny = (index) => {
    setDenied((prevDenied) => {
      const newDeniedState = [...prevDenied];
      newDeniedState[index] = !newDeniedState[index];
      return newDeniedState;
    });
  };

  const handleSelection = (index, status, permissionId) => {
    setHiddenActions((prevHiddenActions) => [...prevHiddenActions, index]);

    const data = {
      status: status,
      user_feedback: reasons[index],
    };

    updatePermissions(permissionId, data).then((response) => {
      if (response.status === 200)
        setPendingPermissions(pendingPermission - 1)
    });
  };

  return (
    <>
      {actions && actions.length > 0 ? (
        <div className={styles.detail_body} style={{height: 'auto'}}>
          {actions.map((action, index) => {
            if (action.status === 'PENDING' && !hiddenActions.includes(index)) {
              return (<ActionBox key={action.id} action={action} index={index} denied={denied} setReasons={setReasons}
                                 reasons={reasons} handleDeny={handleDeny} handleSelection={handleSelection}/>);
            } else if (action.status === 'APPROVED' || action.status === 'REJECTED') {
              return (<HistoryBox key={action.id} action={action}/>);
            }
            return null;
          })}
        </div>
      ) : (
        <div style={{display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: '40px'}}>
          <Image width={150} height={60} src="/images/no_permissions.svg" alt="no-permissions"/>
          <span className={styles.feed_title} style={{marginTop: '8px'}}>No Actions to Display!</span>
        </div>
      )}
    </>
  );
}

================================================
FILE: gui/pages/Content/Agents/ActivityFeed.js
================================================
import React, {useEffect, useRef, useState} from 'react';
import styles from './Agents.module.css';
import {getExecutionFeeds, getDateTime} from "@/pages/api/DashboardService";
import Image from "next/image";
import {loadingTextEffect, formatTimeDifference, convertWaitingPeriod, updateDateBasedOnValue} from "@/utils/utils";
import {EventBus} from "@/utils/eventBus";
import {ClipLoader} from 'react-spinners';

export default function ActivityFeed({selectedRunId, selectedView, setFetchedData, agent, selectedRunStatus}) {
  const [loadingText, setLoadingText] = useState("Thinking");
  const [feeds, setFeeds] = useState([]);
  const feedContainerRef = useRef(null);
  const [runStatus, setRunStatus] = useState("CREATED");
  const [prevFeedsLength, setPrevFeedsLength] = useState(0);
  const [scheduleDate, setScheduleDate] = useState(null);
  const [scheduleTime, setScheduleTime] = useState(null);
  const [isLoading, setIsLoading] = useState(true);
  const [waitingPeriod, setWaitingPeriod] = useState(null);
  const [errorMsg, setErrorMsg] = useState('');

  useEffect(() => {
    const interval = window.setInterval(function () {
      if (selectedRunStatus !== "ERROR_PAUSED") {
        fetchFeeds();
      }
    }, 5000);

    return () => clearInterval(interval);
  }, [selectedRunId, selectedRunStatus]);

  function fetchDateTime() {
    getDateTime(agent.id)
      .then((response) => {
        const {start_date, start_time} = response.data;
        setScheduleDate(start_date);
        setScheduleTime(start_time);
      })
      .catch((error) => {
        console.error('Error fetching agent data:', error);
      });
  }

  useEffect(() => {
    loadingTextEffect('Thinking', setLoadingText, 250);

    if (agent?.is_scheduled && !agent?.is_running) {
      fetchDateTime();
    }
  }, []);

  useEffect(() => {
    if (feeds.length !== prevFeedsLength) {
      if (feedContainerRef.current) {
        setTimeout(() => {
          if (feedContainerRef.current !== null) {
            feedContainerRef.current.scrollTo({top: feedContainerRef.current.scrollHeight, behavior: 'smooth'});
            setPrevFeedsLength(feeds.length);
          }
        }, 100);
      }
    }
  }, [feeds]);

  function scrollToTop() {
    if (feedContainerRef.current) {
      setTimeout(() => {
        feedContainerRef.current.scrollTo({top: 0, behavior: 'smooth'});
      }, 100);
    }
  }

  useEffect(() => {
    fetchFeeds();
  }, [selectedRunId])

  useEffect(() => {
    EventBus.emit('reFetchAgents', {});
  }, [runStatus])

  function fetchFeeds() {
    if (selectedRunId !== null) {
      setIsLoading(true);
      getExecutionFeeds(selectedRunId)
        .then((response) => {
          const data = response.data;
          setFeeds(data.feeds);
          setErrorMsg(data.errors)
          setRunStatus(data.status);
          setFetchedData(data.permissions);
          setWaitingPeriod(data.waiting_period ? data.waiting_period : null)
          EventBus.emit('resetRunStatus', {executionId: selectedRunId, status: data.status});
          setIsLoading(false); //add this line
        })
        .catch((error) => {
          console.error('Error fetching execution feeds:', error);
          setIsLoading(false); // and this line
        });
    }
  }

  useEffect(() => {
    const updateRunStatus = (eventData) => {
      if (eventData.selectedRunId === selectedRunId) {
        setRunStatus(eventData.status);
      }
    };
    const refreshDate = () => {
      fetchDateTime();
    };

    EventBus.on('updateRunStatus', updateRunStatus);
    EventBus.on('refreshDate', refreshDate);

    return () => {
      EventBus.off('updateRunStatus', updateRunStatus);
      EventBus.off('refreshDate', refreshDate);
    };
  });

  return (<>
    <div style={{overflowY: "auto", maxHeight: '80vh', position: 'relative'}} ref={feedContainerRef}>
      <div style={{marginBottom: '55px'}}>
        {agent?.is_scheduled && !agent?.is_running && !selectedRunId ?
          <div style={{display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center'}}>
            <Image width={72} height={72} src="/images/eventSchedule.png" alt="github"/>
            <div style={{color: 'white', fontSize: '14px'}}>
              This agent is scheduled to start on {scheduleDate}, at {scheduleTime}
            </div>
          </div> : <div>
            {feeds && feeds.map((f, index) => (<div key={index} className={styles.history_box}
                                                    style={{background: '#272335', padding: '20px', cursor: 'default'}}>
              <div style={{display: 'flex'}}>
                {f.role === 'user' && <div className={styles.feed_icon}>💁</div>}
                {f.role === 'system' && <div className={styles.feed_icon}>🛠️ </div>}
                {f.role === 'assistant' && <div className={styles.feed_icon}>💡</div>}
                <div className={styles.feed_title}>{f?.feed || ''}</div>
              </div>
              <div className={styles.more_details_wrapper}>
                {f.time_difference && <div className={styles.more_details}>
                  <div style={{display: 'flex', alignItems: 'center'}}>
                    <div>
                      <Image width={12} height={12} src="/images/schedule.svg" alt="schedule-icon"/>
                    </div>
                    <div className={styles.history_info}>
                      {formatTimeDifference(f.time_difference)}
                    </div>
                  </div>
                </div>}
              </div>
            </div>))}
            {runStatus === 'WAIT_STEP' &&
                <div className="history_box padding_20 cursor_default bg_secondary">
                  <div style={{display: 'flex'}}>
                    <div className="fs_20 lh_24">⏳</div>
                    <div className={styles.feed_title}>Waiting Block Initiated. The Agent will wait for {convertWaitingPeriod(waitingPeriod) || null}</div>
                  </div>
                </div>}
            {runStatus === 'RUNNING' &&
              <div className="history_box padding_20 cursor_default bg_secondary">
                <div style={{display: 'flex'}}>
                  <div className="fs_20">🧠</div>
                  <div className={styles.feed_title}><i>{loadingText}</i></div>
                </div>
              </div>}
            {runStatus === 'COMPLETED' &&
              <div className="history_box padding_20 cursor_default bg_secondary">
                <div style={{display: 'flex'}}>
                  <div className="fs_20">🏁</div>
                  <div className={styles.feed_title}><i>All goals completed successfully!</i></div>
                </div>
              </div>}
            {runStatus === 'ITERATION_LIMIT_EXCEEDED' &&
              <div className="history_box padding_20 cursor_default bg_secondary">
                <div style={{display: 'flex'}}>
                  <div className="fs_20">⚠️</div>
                  <div className={styles.feed_title}><i>Stopped: Maximum iterations exceeded!</i></div>
                </div>
              </div>}
              {runStatus === 'ERROR_PAUSED' &&
              <div className="history_box padding_20 cursor_default bg_secondary">
                <div style={{display: 'flex'}}>
                  <div className="fs_20">❗</div>
                  <div className={styles.feed_title}>{errorMsg}</div>
                </div>
              </div>}
          </div>
        }
        {feeds.length < 1 && !agent?.is_running && !agent?.is_scheduled &&
             <div style={{
              color: 'white',
              fontSize: '14px',
              display: 'flex',
              flexDirection: 'column',
              alignItems: 'center',
              textAlign: 'center',
              width: '100%'
            }}>The Agent is not scheduled</div>
        }
      </div>
      {feedContainerRef.current && feedContainerRef.current.scrollTop >= 1200 &&
        <div className="back_to_top" onClick={scrollToTop}
             style={selectedView !== '' ? {right: 'calc(39% - 5vw)'} : {right: '39%'}}>
          <Image width={15} height={15} src="/images/backtotop.svg" alt="back-to-top"/>
        </div>}
    </div>
  </>)
}

================================================
FILE: gui/pages/Content/Agents/AgentCreate.js
================================================
import React, {useState, useEffect, useRef} from 'react';
import Image from "next/image";
import {ToastContainer, toast} from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import {
  createAgent,
  editAgentTemplate,
  fetchAgentTemplateConfigLocal,
  getOrganisationConfig,
  getLlmModels,
  updateExecution,
  uploadFile,
  getAgentDetails, addAgentRun, fetchModels,
  getAgentWorkflows, publishTemplateToMarketplace
} from "@/pages/api/DashboardService";
import {formatBytes, openNewTab, removeTab, setLocalStorageValue, setLocalStorageArray, returnResourceIcon, getUserTimezone, createInternalId, preventDefault, excludedToolkits, getUserClick} from "@/utils/utils";
import {EventBus} from "@/utils/eventBus";
import styles from "@/pages/Content/Agents/Agents.module.css";
import styles1 from "@/pages/Content/Knowledge/Knowledge.module.css";
import 'moment-timezone';
import AgentSchedule from "@/pages/Content/Agents/AgentSchedule";

export default function AgentCreate({
                                      sendAgentData,
                                      knowledge,
                                      selectedProjectId,
                                      fetchAgents,
                                      toolkits,
                                      organisationId,
                                      template,
                                      internalId,
                                      sendKnowledgeData,
                                      env,
                                      edit,
                                      editAgentId,
                                      agents
                                    }) {
  const [advancedOptions, setAdvancedOptions] = useState(false);
  const [agentName, setAgentName] = useState("");
  const [agentTemplateId, setAgentTemplateId] = useState(null);
  const [agentDescription, setAgentDescription] = useState("");
  const [longTermMemory, setLongTermMemory] = useState(true);
  const [addResources, setAddResources] = useState(true);
  const [input, setInput] = useState([]);
  const [isDragging, setIsDragging] = useState(false);
  const [createClickable, setCreateClickable] = useState(true);
  const fileInputRef = useRef(null);
  const [maxIterations, setIterations] = useState(25);
  const [toolkitList, setToolkitList] = useState(toolkits)
  const [searchValue, setSearchValue] = useState('');
  const [showButton, setShowButton] = useState(false);
  const [showPlaceholder, setShowPlaceholder] = useState(true);
  const [modelsArray, setModelsArray] = useState(['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k']);

  const constraintsArray = [
    "If you are unsure how you previously did something or want to recall past events, thinking about similar events will help you remember.",
    "Ensure the tool and args are as per current plan and reasoning",
    'Exclusively use the tools listed under "TOOLS"',
    "REMEMBER to format your response as JSON, using double quotes (\"\") around keys and string values, and commas (,) to separate items in arrays and objects. IMPORTANTLY, to use a JSON object as a string in another JSON object, you need to escape the double quotes."
  ];
  const [constraints, setConstraints] = useState(constraintsArray);

  const [goals, setGoals] = useState(['Describe the agent goals here']);
  const [instructions, setInstructions] = useState(['']);

  const models = ['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k']
  const [model, setModel] = useState(models[1]);
  const modelRef = useRef(null);
  const [modelDropdown, setModelDropdown] = useState(false);

  const [agentWorkflows, setAgentWorkflows] = useState('');
  const [agentWorkflow, setAgentWorkflow] = useState(agentWorkflows[0]);

  const agentRef = useRef(null);
  const [agentDropdown, setAgentDropdown] = useState(false);

  const exitCriteria = ["No exit criterion", "System defined", "User defined", "Number of steps/tasks"]
  const [exitCriterion, setExitCriterion] = useState(exitCriteria[0]);
  const exitRef = useRef(null);
  const [exitDropdown, setExitDropdown] = useState(false);

  const [stepTime, setStepTime] = useState(500);

  const rollingRef = useRef(null);
  const [rollingDropdown, setRollingDropdown] = useState(false);

  const [selectedKnowledge, setSelectedKnowledge] = useState('');
  const [selectedKnowledgeId, setSelectedKnowledgeId] = useState(null);
  const knowledgeRef = useRef(null);
  const [knowledgeDropdown, setKnowledgeDropdown] = useState(false);

  const databases = ["Pinecone"]
  const [database, setDatabase] = useState(databases[0]);
  const databaseRef = useRef(null);
  const [databaseDropdown, setDatabaseDropdown] = useState(false);

  const permissions = ["God Mode", "RESTRICTED (Will ask for permission before using any tool)"]
  const [permission, setPermission] = useState(permissions[0]);
  const permissionRef = useRef(null);
  const [permissionDropdown, setPermissionDropdown] = useState(false);

  const [selectedTools, setSelectedTools] = useState([]);
  const [toolNames, setToolNames] = useState(['SearxSearch', 'Read File', 'Write File']);
  const toolkitRef = useRef(null);
  const [toolkitDropdown, setToolkitDropdown] = useState(false);

  const [hasAPIkey, setHasAPIkey] = useState(false);

  const [createDropdown, setCreateDropdown] = useState(false);
  const [createModal, setCreateModal] = useState(false);

  const [scheduleData, setScheduleData] = useState(null);
  const [editModal, setEditModal] = useState(false)
  const [editButtonClicked, setEditButtonClicked] = useState(false);

  const [dropdown, setDropdown] = useState(false);
  const [publishModal, setPublishModal] = useState(false);


  useEffect(() => {
    getOrganisationConfig(organisationId, "model_api_key")
      .then((response) => {
        console.log(response.data['api_key'])
        const apiKey = response.data['api_key']
        setHasAPIkey(!(apiKey === null));
      })
      .catch((error) => {
        console.error('Error fetching project:', error);
      });
  }, [organisationId]);

  const filterToolsByNames = () => {
    if (toolkitList) {
      const selectedToolIds = toolkits
        .flatMap(toolkit => toolkit.tools)
        .filter(tool => toolNames.includes(tool.name))
        .map(tool => tool.id);

      setLocalStorageArray("tool_ids_" + String(internalId), selectedToolIds, setSelectedTools);
    }
  };

  const handleIterationChange = (event) => {
    setLocalStorageValue("agent_iterations_" + String(internalId), parseInt(event.target.value), setIterations);
  };

  useEffect(() => {
    filterToolsByNames();
  }, [toolNames]);

  useEffect(() => {
    fetchModels()
      .then((response) => {
        const models = response.data.map(model => model.name) || [];
        const selected_model = localStorage.getItem("agent_model_" + String(internalId)) || '';
        setModelsArray(models);
        if (models.length > 0 && !selected_model) {
          setLocalStorageValue("agent_model_" + String(internalId), models[0], setModel);
        } else {
          setModel(selected_model);
        }
        console.log(response)
      })
      .catch((error) => {
        console.error('Error fetching models:', error);
      });

    getAgentWorkflows()
      .then((response) => {
        const agentWorkflows = response.data || [];
        const selectedAgentWorkflow = localStorage.getItem("agent_workflow_" + String(internalId)) || '';
        setAgentWorkflows(agentWorkflows);
        if (agentWorkflows.length > 0 && !selectedAgentWorkflow) {
          setLocalStorageValue("agent_workflow_" + String(internalId), agentWorkflows[0], setAgentWorkflow);
        } else {
          setAgentWorkflow(selectedAgentWorkflow);
        }
      })
      .catch((error) => {
        console.error('Error fetching agent workflows:', error);
      });
    if (edit) {
      editingAgent();
    }

    if (template !== null) {
      fillDetails(template)
      setLocalStorageValue("agent_template_id_" + String(internalId), template.id, setAgentTemplateId);

      fetchAgentTemplateConfigLocal(template.id)
        .then((response) => {
          const data = response.data || [];
          fillAdvancedDetails(data)
          setLocalStorageArray("tool_names_" + String(internalId), data.tools, setToolNames);
          setLocalStorageValue("is_agent_template_" + String(internalId), true, setShowButton);
          setShowButton(true);
        })
        .catch((error) => {
          console.error('Error fetching template details:', error);
        });
    }
  }, []);

  useEffect(() => {
    function handleClickOutside(event) {
      if (modelRef.current && !modelRef.current.contains(event.target)) {
        setModelDropdown(false)
      }

      if (agentRef.current && !agentRef.current.contains(event.target)) {
        setAgentDropdown(false)
      }

      if (exitRef.current && !exitRef.current.contains(event.target)) {
        setExitDropdown(false)
      }

      if (rollingRef.current && !rollingRef.current.contains(event.target)) {
        setRollingDropdown(false)
      }

      if (knowledgeRef.current && !knowledgeRef.current.contains(event.target)) {
        setKnowledgeDropdown(false)
      }

      if (databaseRef.current && !databaseRef.current.contains(event.target)) {
        setDatabaseDropdown(false)
      }

      if (permissionRef.current && !permissionRef.current.contains(event.target)) {
        setPermissionDropdown(false)
      }

      if (toolkitRef.current && !toolkitRef.current.contains(event.target)) {
        setToolkitDropdown(false)
      }
    }

    document.addEventListener('mousedown', handleClickOutside);
    return () => {
      document.removeEventListener('mousedown', handleClickOutside);
    };
  }, []);

  const addTool = (tool) => {
    if (!selectedTools.includes(tool.id) && !toolNames.includes(tool.name)) {
      const updatedToolIds = [...selectedTools, tool.id];
      setLocalStorageArray("tool_ids_" + String(internalId), updatedToolIds, setSelectedTools);

      const updatedToolNames = [...toolNames, tool.name];
      setLocalStorageArray("tool_names_" + String(internalId), updatedToolNames, setToolNames);
    }
    setSearchValue('');
  };

  const editingAgent = () => {
    const isLoaded = localStorage.getItem('is_editing_agent_' + String(internalId));
    const agent = agents.find(agent => agent.id === editAgentId);
    if (!isLoaded) {
      fillDetails(agent)
    }
    getAgentDetails(editAgentId, -1)
        .then((response) => {
          const data = response.data || []
          if (!isLoaded) {
            fillAdvancedDetails(data)
            setLocalStorageArray("tool_names_" + String(internalId), data.tools.map(tool => tool.name), setToolNames);
          }
        })
        .catch((error) => {
          console.error('Error fetching agent details:', error);
        });
    localStorage.setItem('is_editing_agent_' + String(internalId), true);
  };

  const fillDetails = (agent) => {
    setLocalStorageValue("agent_name_" + String(internalId), agent.name, setAgentName);
    setLocalStorageValue("agent_description_" + String(internalId), agent.description, setAgentDescription);
    setLocalStorageValue("advanced_options_" + String(internalId), true, setAdvancedOptions);
  }
  const fillAdvancedDetails = (data) => {
    setLocalStorageArray("agent_goals_" + String(internalId), data.goal, setGoals);
    setLocalStorageValue("agent_workflow_" + String(internalId), data.agent_workflow, setAgentWorkflow);
    setLocalStorageArray("agent_constraints_" + String(internalId), data.constraints, setConstraints);
    setLocalStorageValue("agent_iterations_" + String(internalId), data.max_iterations, setIterations);
    setLocalStorageValue("agent_step_time_" + String(internalId), data.iteration_interval, setStepTime);
    setLocalStorageValue("agent_permission_" + String(internalId), data.permission_type, setPermission);
    setLocalStorageArray("agent_instructions_" + String(internalId), data.instruction, setInstructions);
    setLocalStorageValue("agent_database_" + String(internalId), data.LTM_DB, setDatabase);
    setLocalStorageValue("agent_model_" + String(internalId), data.model, setModel);
  }


  const addToolkit = (toolkit) => {
    const updatedToolIds = [...selectedTools];
    const updatedToolNames = [...toolNames];

    toolkit.tools.map((tool) => {
      if (!selectedTools.includes(tool.id) && !toolNames.includes(tool.name)) {
        updatedToolIds.push(tool.id);
        updatedToolNames.push(tool.name);
      }
    });

    setLocalStorageArray("tool_ids_" + String(internalId), updatedToolIds, setSelectedTools);
    setLocalStorageArray("tool_names_" + String(internalId), updatedToolNames, setToolNames);
    setSearchValue('');
  }

  const removeTool = (indexToDelete) => {
    const updatedToolIds = [...selectedTools];
    updatedToolIds.splice(indexToDelete, 1);
    setLocalStorageArray("tool_ids_" + String(internalId), updatedToolIds, setSelectedTools);

    const updatedToolNames = [...toolNames];
    updatedToolNames.splice(indexToDelete, 1);
    setLocalStorageArray("tool_names_" + String(internalId), updatedToolNames, setToolNames);
  };

  const handlePermissionSelect = (index) => {
    setLocalStorageValue("agent_permission_" + String(internalId), permissions[index], setPermission);
    setPermissionDropdown(false);
  };

  const handleDatabaseSelect = (index) => {
    setLocalStorageValue("agent_database_" + String(internalId), databases[index], setDatabase);
    setDatabaseDropdown(false);
  };


  const handleKnowledgeSelect = (index) => {
    setLocalStorageValue("agent_knowledge_" + String(internalId), knowledge[index].name, setSelectedKnowledge);
    setLocalStorageValue("agent_knowledge_id_" + String(internalId), knowledge[index].id, setSelectedKnowledgeId);
    setKnowledgeDropdown(false);
  };

  const handleStepChange = (event) => {
    setLocalStorageValue("agent_step_time_" + String(internalId), event.target.value, setStepTime);
  };

  const handleExitSelect = (index) => {
    setLocalStorageValue("agent_exit_criterion_" + String(internalId), exitCriteria[index], setExitCriterion);
    setExitDropdown(false);
  };

  const handleAgentSelect = (index) => {
    setLocalStorageValue("agent_workflow_" + String(internalId), agentWorkflows[index], setAgentWorkflow);
    setAgentDropdown(false);
  };

  const handleModelSelect = (index) => {
    setLocalStorageValue("agent_model_" + String(internalId), modelsArray[index], setModel);
    if (modelsArray[index] === "google-palm-bison-001" || modelsArray[index] === "replicate-llama13b-v2-chat") {
      setAgentType("Fixed Task Queue")
    }
    setModelDropdown(false);
  };

  const handleGoalChange = (index, newValue) => {
    const updatedGoals = [...goals];
    updatedGoals[index] = newValue;
    setLocalStorageArray("agent_goals_" + String(internalId), updatedGoals, setGoals);
  };

  const handleInstructionChange = (index, newValue) => {
    const updatedInstructions = [...instructions];
    updatedInstructions[index] = newValue;
    setLocalStorageArray("agent_instructions_" + String(internalId), updatedInstructions, setInstructions);
  };

  const handleConstraintChange = (index, newValue) => {
    const updatedConstraints = [...constraints];
    updatedConstraints[index] = newValue;
    setLocalStorageArray("agent_constraints_" + String(internalId), updatedConstraints, setConstraints);
  };

  const handleGoalDelete = (index) => {
    const updatedGoals = [...goals];
    updatedGoals.splice(index, 1);
    setLocalStorageArray("agent_goals_" + String(internalId), updatedGoals, setGoals);
  };

  const handleInstructionDelete = (index) => {
    const updatedInstructions = [...instructions];
    updatedInstructions.splice(index, 1);
    setLocalStorageArray("agent_instructions_" + String(internalId), updatedInstructions, setInstructions);
  };

  const handleConstraintDelete = (index) => {
    const updatedConstraints = [...constraints];
    updatedConstraints.splice(index, 1);
    setLocalStorageArray("agent_constraints_" + String(internalId), updatedConstraints, setConstraints);
  };

  const addGoal = () => {
    setLocalStorageArray("agent_goals_" + String(internalId), [...goals, 'new goal'], setGoals);
  };

  const addInstruction = () => {
    setLocalStorageArray("agent_instructions_" + String(internalId), [...instructions, 'new instructions'], setInstructions);
  };

  const addConstraint = () => {
    setLocalStorageArray("agent_constraints_" + String(internalId), [...constraints, 'new constraint'], setConstraints);
  };

  const handleNameChange = (event) => {
    setLocalStorageValue("agent_name_" + String(internalId), event.target.value, setAgentName);
  };

  const handleDescriptionChange = (event) => {
    setLocalStorageValue("agent_description_" + String(internalId), event.target.value, setAgentDescription);
  };

  const closeCreateModal = () => {
    setCreateModal(false);
    setCreateDropdown(false);
  };

  function uploadResource(agentId, fileData) {
    const formData = new FormData();
    formData.append('file', fileData.file);
    formData.append('name', fileData.name);
    formData.append('size', fileData.size);
    formData.append('type', fileData.type);

    return uploadFile(agentId, formData);
  }

  useEffect(() => {
    const keySet = (eventData) => {
      setHasAPIkey(true);
    };

    const handleAgentScheduling = (item) => {
      setScheduleData(item)
    };

    EventBus.on('keySet', keySet);
    EventBus.on('handleAgentScheduling', handleAgentScheduling);

    return () => {
      EventBus.off('keySet', keySet);
      EventBus.off('handleAgentScheduling', handleAgentScheduling);
    };
  });

  useEffect(() => {
    if (scheduleData) {
      handleAddAgent()
    }
  }, [scheduleData]);

  const validateAgentData = (isNewAgent) => {
    if (isNewAgent && !hasAPIkey) {
      toast.error("Your API key is empty!", {autoClose: 1800});
      openNewTab(-3, "Settings", "Settings", false);
      return false;
    }

    if (agentName?.replace(/\s/g, '') === '') {
      toast.error("Agent name can't be blank", {autoClose: 1800});
      return false;
    }

    if (agentDescription?.replace(/\s/g, '') === '') {
      toast.error("Agent description can't be blank", {autoClose: 1800});
      return false;
    }

    const isEmptyGoal = goals.some((goal) => goal.replace(/\s/g, '') === '');
    if (isEmptyGoal) {
      toast.error("Goal can't be empty", {autoClose: 1800});
      return false;
    }

    if (selectedTools.length <= 0) {
      toast.error("Add atleast one tool", {autoClose: 1800});
      return false;
    }

    if (!modelsArray.includes(model)) {
      toast.error("Your key does not have access to the selected model", {autoClose: 1800});
      return false;
    }

    if (toolNames.includes('Knowledge Search') && !selectedKnowledge) {
      toast.error("Add atleast one knowledge", {autoClose: 1800});
      return;
    }

    return true;
  }

  const handleAddAgent = async () => {
    if (!validateAgentData(true)) {
      return;
    }

    setCreateClickable(false);

    const agentData = setAgentData()

    const scheduleAgentData = {
      "agent_config": agentData,
      "schedule": scheduleData,
    }

    if(edit){
      if (editButtonClicked) return;
      setEditButtonClicked(true);
      agentData.agent_id = editAgentId;
      const name = agentData.name
      const adjustedDate = new Date((new Date()).getTime());
      const formattedDate = `${adjustedDate.getDate()} ${['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][adjustedDate.getMonth()]} ${adjustedDate.getFullYear()} ${adjustedDate.getHours().toString().padStart(2, '0')}:${adjustedDate.getMinutes().toString().padStart(2, '0')}`;
      agentData.name = "Run " + formattedDate
      addAgentRun(agentData)
        .then((response) => {
        if(response){
          fetchAgents();
          uploadResources(editAgentId, name)
        }
      })
    }
    else
      {
        createAgent(createModal ? scheduleAgentData : agentData, createModal)
            .then((response) => {
              const agentId = response.data.id;
              const name = response.data.name;
              const executionId = response.data.execution_id;
              fetchAgents();
              getUserClick('Agent Created Successfully', {'templateName': template?.id ? template.name : ''})
              getUserClick('Agent Run created successfully', {})
              uploadResources(agentId, name, executionId)
            })
            .catch((error) => {
              console.error('Error creating agent:', error);
              setCreateClickable(true);
            });
      }
  };
  const setAgentData= () => {
    let permission_type = permission;
    if (permission.includes("RESTRICTED")) {
      permission_type = "RESTRICTED";
    }

    const agentData = {
      "name": agentName,
      "project_id": selectedProjectId,
      "description": agentDescription,
      "goal": goals,
      "instruction": instructions,
      "agent_workflow": agentWorkflow,
      "constraints": constraints,
      "toolkits": [],
      "tools": selectedTools,
      "exit": exitCriterion,
      "iteration_interval": stepTime,
      "model": model,
      "max_iterations": maxIterations,
      "permission_type": permission_type,
      "LTM_DB": longTermMemory ? database : null,
      "user_timezone": getUserTimezone(),
      "knowledge": toolNames.includes('Knowledge Search') ? selectedKnowledgeId : null,
    };

    return agentData
  }
  const uploadResources = (agentId, name, executionId) => {
    if (addResources && input.length > 0) {
      const uploadPromises = input.map(fileData => {
        return uploadResource(agentId, fileData)
            .catch(error => {
              console.error('Error uploading resource:', error);
              return Promise.reject(error);
            });
      });

      Promise.all(uploadPromises)
          .then(() => {
            runDecision(agentId, name, executionId)
          })
          .catch(error => {
            console.error('Error uploading files:', error);
            setCreateClickable(true);
          });
    } else {
      runDecision(agentId, name, executionId)
    }
  }

  const runDecision = (agentId, name, executionId) => {
    if(edit){
      setEditModal(false)
      sendAgentData({
        id: editAgentId,
        name: name,
        contentType: "Agents",
      });
      removeTab(editAgentId, name, "Agents", internalId)
    }
    else {
      runExecution(agentId, name, executionId, createModal);
    }
  }

  const finaliseAgentCreation = (agentId, name, executionId) => {
    toast.success('Agent created successfully', {autoClose: 1800});
    let timeoutValue = executionId ? 0 : 1500;

    setTimeout(() => {
      sendAgentData({
        id: agentId,
        name: name,
        contentType: "Agents",
        execution_id: executionId,
        internalId: createInternalId()
      });
      setCreateClickable(true);
      setCreateModal(false);
    }, timeoutValue)
  }

  function runExecution(agentId, name, executionId, createModal) {
    if (createModal) {
      finaliseAgentCreation(agentId, name, null);
      return;
    }

    updateExecution(executionId, {"status": 'RUNNING'})
      .then((response) => {
        finaliseAgentCreation(agentId, name, executionId);
      })
      .catch((error) => {
        setCreateClickable(true);
        console.error('Error updating execution:', error);
      });
  }

  const toggleToolkit = (e, id) => {
    e.stopPropagation();
    const toolkitToUpdate = toolkitList.find(toolkit => toolkit.id === id);
    if (toolkitToUpdate) {
      const newOpenValue = !toolkitToUpdate.isOpen;
      setToolkitOpen(id, newOpenValue);
    }
  };

  const setToolkitOpen = (id, isOpen) => {
    const updatedToolkits = toolkitList.map(toolkit =>
      toolkit.id === id ? {...toolkit, isOpen: isOpen} : {...toolkit, isOpen: false}
    );
    setToolkitList(updatedToolkits);
  };

  const clearTools = (e) => {
    e.stopPropagation();
    setLocalStorageArray("tool_names_" + String(internalId), [], setToolNames);
    setLocalStorageArray("tool_ids_" + String(internalId), [], setSelectedTools);
  };

  const handleFileInputChange = (event) => {
    const files = event.target.files;
    setFileData(files);
  };

  const handleDropAreaClick = () => {
    fileInputRef.current.click();
  };

  const handleDragEnter = (event) => {
    event.preventDefault();
    setIsDragging(true);
  };

  const handleDragLeave = () => {
    setIsDragging(false);
  };

  const handleDragOver = (event) => {
    event.preventDefault();
  };

  function updateTemplate() {

    if (!validateAgentData(false)) return;

    let permission_type = permission;
    if (permission.includes("RESTRICTED")) {
      permission_type = "RESTRICTED";
    }

    const agentTemplateConfigData = {
      "goal": goals,
      "instruction": instructions,
      "agent_workflow": agentWorkflow,
      "constraints": constraints,
      "tools": toolNames,
      "exit": exitCriterion,
      "iteration_interval": stepTime,
      "model": model,
      "max_iterations": maxIterations,
      "permission_type": permission_type,
      "LTM_DB": longTermMemory ? database : null,
    }
    const editTemplateData = {
      "name": agentName,
      "description": agentDescription,
      "agent_configs": agentTemplateConfigData
    }

    editAgentTemplate(agentTemplateId, editTemplateData)
      .then((response) => {
        if (response.status === 200) {
          toast.success('Agent template has been updated successfully!', {autoClose: 1800});
        }
      })
      .catch((error) => {
        toast.error("Error updating agent template")
        console.error('Error updating agent template:', error);
      });
  };

  function setFileData(files) {
    if (files.length > 0) {
      const fileData = {
        "file": files[0],
        "name": files[0].name,
        "size": files[0].size,
        "type": files[0].type,
      };
      const updatedFiles = [...input, fileData];
      setLocalStorageArray('agent_files_' + String(internalId), updatedFiles, setInput);
    }
  }

  function checkSelectedToolkit(toolkit) {
    const toolIds = toolkit.tools.map((tool) => tool.id);
    const toolNameList = toolkit.tools.map((tool) => tool.name);
    return toolIds.every((toolId) => selectedTools.includes(toolId)) && toolNameList.every((toolName) => toolNames.includes(toolName));
  }

  const handleDrop = (event) => {
    event.preventDefault();
    setIsDragging(false);
    const files = event.dataTransfer.files;
    setFileData(files);
  };

  const removeFile = (index) => {
    const updatedFiles = input.filter((file) => input.indexOf(file) !== index);
    setLocalStorageArray('agent_files_' + String(internalId), updatedFiles, setInput);
  };

  useEffect(() => {
    if (internalId !== null) {
      const has_resource = localStorage.getItem("has_resource_" + String(internalId)) || 'true';
      if (has_resource) {
        setAddResources(JSON.parse(has_resource));
      }

      const has_LTM = localStorage.getItem("has_LTM_" + String(internalId)) || 'true';
      if (has_LTM) {
        setLongTermMemory(JSON.parse(has_LTM));
      }

      const advanced_options = localStorage.getItem("advanced_options_" + String(internalId)) || 'false';
      if (advanced_options) {
        setAdvancedOptions(JSON.parse(advanced_options));
      }

      const is_agent_template = localStorage.getItem("is_agent_template_" + String(internalId));
      if (is_agent_template) {
        setShowButton(true);
      }

      const agent_name = localStorage.getItem("agent_name_" + String(internalId));
      if (agent_name) {
        setAgentName(agent_name);
      }

      const agent_template_id = localStorage.getItem("agent_template_id_" + String(internalId));
      if (agent_template_id) {
        setAgentTemplateId(agent_template_id)
      }

      const agent_description = localStorage.getItem("agent_description_" + String(internalId));
      if (agent_description) {
        setAgentDescription(agent_description);
      }

      const agent_goals = localStorage.getItem("agent_goals_" + String(internalId));
      if (agent_goals) {
        setGoals(JSON.parse(agent_goals));
      }

      const tool_ids = localStorage.getItem("tool_ids_" + String(internalId));
      if (tool_ids) {
        setSelectedTools(JSON.parse(tool_ids));
      }

      const tool_names = localStorage.getItem("tool_names_" + String(internalId));
      if (tool_names) {
        setToolNames(JSON.parse(tool_names));
      }

      const agent_instructions = localStorage.getItem("agent_instructions_" + String(internalId));
      if (agent_instructions) {
        setInstructions(JSON.parse(agent_instructions));
      }

      const agent_constraints = localStorage.getItem("agent_constraints_" + String(internalId));
      if (agent_constraints) {
        setConstraints(JSON.parse(agent_constraints));
      }

      const agent_model = localStorage.getItem("agent_model_" + String(internalId));
      if (agent_model) {
        setModel(agent_model);
      }

      const agent_workflow = localStorage.getItem("agent_workflow_" + String(internalId));
      if (agent_workflow) {
        setAgentWorkflow(agent_workflow);
      }

      const agent_database = localStorage.getItem("agent_database_" + String(internalId));
      if (agent_database) {
        setDatabase(agent_database);
      }

      const agent_permission = localStorage.getItem("agent_permission_" + String(internalId));
      if (agent_permission) {
        setPermission(agent_permission);
      }

      const exit_criterion = localStorage.getItem("agent_exit_criterion_" + String(internalId));
      if (exit_criterion) {
        setExitCriterion(exit_criterion);
      }

      const iterations = localStorage.getItem("agent_iterations_" + String(internalId));
      if (iterations) {
        setIterations(Number(iterations));
      }

      const step_time = localStorage.getItem("agent_step_time_" + String(internalId));
      if (step_time) {
        setStepTime(Number(step_time));
      }

      const agent_files = localStorage.getItem("agent_files_" + String(internalId));
      if (agent_files) {
        setInput(JSON.parse(agent_files));
      }
    }

    const agent_knowledge = localStorage.getItem("agent_knowledge_" + String(internalId));
    if (agent_knowledge) {
      setSelectedKnowledge(agent_knowledge);
    }
  }, [internalId])

  function openMarketplace() {
    openNewTab(-4, "Marketplace", "Marketplace", false);
    localStorage.setItem('marketplace_tab', 'market_knowledge');
  }

  const checkPermissionValidity = (permit) => {
   if(!(agentWorkflow === 'Fixed Task Workflow' || agentWorkflow === 'Dynamic Task Workflow' || agentWorkflow === 'Goal Based Workflow' ) && permit === 'RESTRICTED (Will ask for permission before using any tool)')
     return true;
   else
     return false;
  }

  const openModelMarket = () => {
    openNewTab(-4, "Marketplace", "Marketplace", false);
    localStorage.setItem('marketplace_tab', 'market_models');
  }

  const handleAddToMarketplace = () => {
    const agentData = setAgentData()
    agentData.agent_template_id = template.id
    publishTemplateToMarketplace(agentData)
      .then((response) => {
        setDropdown(false)
        setPublishModal(true)
      })
      .catch((error) => {
        toast.error("Error Publishing to marketplace")
        console.error('Error Publishing to marketplace:', error);
      });
  }

  return (<>
    <div className="row" style={{overflowY: 'scroll', height: 'calc(100vh - 92px)'}}>
      <div className="col-3"></div>
      <div className="col-6" style={{padding: '25px 20px'}}>
        <div>
          {!edit ? <div className={styles.page_title}>Create new agent</div> : <div className={styles.page_title}>Edit agent</div>}
        </div>
        <div style={{marginTop: '10px'}}>
          <div>
            <label className={styles.form_label}>Name</label>
            <input className="input_medium" type="text" value={agentName} disabled={edit}  onChange={handleNameChange}/>
          </div>
          <div style={{marginTop: '15px'}}>
            <label className={styles.form_label}>Description</label>
            <textarea className="textarea_medium" rows={3} value={agentDescription} disabled={edit} onChange={handleDescriptionChange}/>
          </div>
          <div style={{marginTop: '15px'}}>
            <div><label className={styles.form_label}>Goals</label></div>
            {goals?.map((goal, index) => (<div key={index} style={{
              marginBottom: '10px',
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'space-between'
            }}>
              <div style={{flex: '1'}}><input className="input_medium" type="text" value={goal}
                                              onChange={(event) => handleGoalChange(index, event.target.value)}/></div>
              {goals.length > 1 && <div>
                <button className="secondary_button" style={{marginLeft: '4px', padding: '5px'}}
                        onClick={() => handleGoalDelete(index)}>
                  <Image width={20} height={21} src="/images/close.svg" alt="close-icon"/>
                </button>
              </div>}
            </div>))}
            <div>
              <button className="secondary_button" onClick={addGoal}>+ Add</button>
            </div>
          </div>

          <div style={{marginTop: '15px'}}>
            <div><label className={styles.form_label}>Instructions<span
              style={{fontSize: '9px'}}>&nbsp;(optional)</span></label></div>
            {instructions?.map((goal, index) => (<div key={index} style={{
              marginBottom: '10px',
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'space-between'
            }}>
              <div style={{flex: '1'}}><input className="input_medium" type="text" value={goal}
                                              onChange={(event) => handleInstructionChange(index, event.target.value)}/>
              </div>
              {instructions.length > 1 && <div>
                <button className="secondary_button" style={{marginLeft: '4px', padding: '5px'}}
                        onClick={() => handleInstructionDelete(index)}>
                  <Image width={20} height={21} src="/images/close.svg" alt="close-icon"/>
                </button>
              </div>}
            </div>))}
            <div>
              <button className="secondary_button" onClick={addInstruction}>+ Add</button>
            </div>
          </div>

          <div style={{marginTop: '15px'}}>
            <label className={styles.form_label}>Model</label><br/>
            <div className="dropdown_container_search" style={{width: '100%'}}>
              <div className="custom_select_container" onClick={() => setModelDropdown(!modelDropdown)}
                   style={{width: '100%'}}>
                {model}<Image width={20} height={21}
                              src={!modelDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
                              alt="expand-icon"/>
              </div>
              <div>
                {modelDropdown && (
                    <div className="custom_select_options" ref={modelRef} style={{width: '100%', maxHeight: '300px'}}>
                      <div className="model_options">
                        {modelsArray?.map((model, index) => (
                            <div key={index} className="custom_select_option" onClick={() => handleModelSelect(index)}
                                 style={{padding: '12px 14px', maxWidth: '100%'}}>
                              {model}
                            </div>
                        ))}
                      </div>
                      <div className="vertical_containers sticky_option">
                        <div onClick={() => openModelMarket()} className="custom_select_option horizontal_container mxw_100 padding_12_14 gap_6 bt_white">
                          <Image width={16} height={16} src="/images/marketplace_logo.png" alt="marketplace_logo" />
                          <span>Browse models from marketplace</span>
                        </div>
                        <div onClick={() => openNewTab(-5, "new model", "Add_Model", false)} className="custom_select_option horizontal_container mxw_100 padding_12_14 gap_6 bt_white">
                          <Image width={16} height={16} src="/images/plus.png" alt="plus_image" />
                          <span>Add new custom model</span>
                        </div>
                      </div>
                    </div>
                )}
              </div>
            </div>
          </div>
          <div style={{marginTop: '15px'}}>
            <label className={styles.form_label}>Tools</label>
            <div className="dropdown_container_search" style={{width: '100%'}}>
              <div className="custom_select_container" onClick={() => setToolkitDropdown(!toolkitDropdown)}
                   style={{width: '100%', alignItems: 'flex-start'}}>
                <div style={{display: 'flex', flexWrap: 'wrap', width: '100%', alignItems: 'start'}}>
                  {toolNames && toolNames.length > 0 && toolNames.map((tool, index) => (
                    <div key={index} className="tool_container" style={{margin: '2px'}} onClick={preventDefault}>
                      <div className={styles.tool_text}>{tool}</div>
                      <div><Image width={12} height={12} src='/images/close_light.svg' alt="close-icon"
                                  style={{margin: '-2px -5px 0 2px'}} onClick={() => removeTool(index)}/></div>
                    </div>
                  ))}
                  <input type="text" className="dropdown_search_text" value={searchValue} style={{flexGrow: 1}}
                         onChange={(e) => setSearchValue(e.target.value)}
                         onFocus={() => {
                           setToolkitDropdown(true);
                           setShowPlaceholder(false);
                         }} onBlur={() => {
                    setShowPlaceholder(true);
                  }}
                         onClick={(e) => e.stopPropagation()}/>
                  {toolNames && toolNames.length === 0 && showPlaceholder && searchValue.length === 0 &&
                    <div style={{color: '#666666', position: 'absolute'}}>Select Tools</div>}
                </div>
                <div style={{display: 'inline-flex'}}>
                  <Image width={20} height={21} onClick={(e) => clearTools(e)} src='/images/clear_input.svg'
                         alt="clear-input"/>
                  <Image width={20} height={21}
                         src={!toolkitDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
                         alt="expand-icon"/>
                </div>
              </div>
              <div>
                {toolkitDropdown && <div className="custom_select_options" ref={toolkitRef} style={{width: '100%'}}>
                  {toolkitList && toolkitList.filter((toolkit) => toolkit.tools ? toolkit.tools.some((tool) => tool.name.toLowerCase().includes(searchValue.toLowerCase())) : false).map((toolkit, index) => (
                    <div key={index}>
                      {toolkit.name !== null && !excludedToolkits().includes(toolkit.name) && <div>
                        <div onClick={() => addToolkit(toolkit)} className="custom_select_option" style={{
                          padding: '10px 14px',
                          maxWidth: '100%',
                          display: 'flex',
                          alignItems: 'center',
                          justifyContent: 'space-between'
                        }}>
                          <div style={{display: 'flex', alignItems: 'center', justifyContent: 'flex-start'}}>
                            <div onClick={(e) => toggleToolkit(e, toolkit.id)}
                                 style={{marginLeft: '-8px', marginRight: '8px'}}>
                              <Image src={toolkit.isOpen ? "/images/arrow_down.svg" : "/images/arrow_forward.svg"}
                                     width={11} height={11} alt="expand-arrow"/>
                            </div>
                            <div style={{width: '100%'}}>{toolkit.name}</div>
                          </div>
                          {checkSelectedToolkit(toolkit) && <div style={{order: '1', marginLeft: '10px'}}>
                            <Image src="/images/tick.svg" width={17} height={17} alt="selected-toolkit"/>
                          </div>}
                        </div>
                        {toolkit.isOpen && toolkit.tools.filter((tool) => tool.name ? tool.name.toLowerCase().includes(searchValue.toLowerCase()) : true).map((tool, index) => (
                          <div key={index} className="custom_select_option" onClick={() => addTool(tool)} style={{
                            padding: '10px 14px 10px 40px',
                            maxWidth: '100%',
                            display: 'flex',
                            alignItems: 'center',
                            justifyContent: 'space-between'
                          }}>
                            <div>{tool.name}</div>
                            {(selectedTools.includes(tool.id) || toolNames.includes(tool.name)) &&
                              <div style={{order: '1', marginLeft: '10px'}}>
                                <Image src="/images/tick.svg" width={17} height={17} alt="selected-tool"/>
                              </div>}
                          </div>))}
                      </div>}
                    </div>))}
                </div>}
              </div>
            </div>
          </div>
          {toolNames.includes("Knowledge Search") && <div style={{marginTop: '5px'}}>
            <label className={styles.form_label}>Add knowledge</label>
            <div className="dropdown_container_search" style={{width: '100%'}}>
              <div className="custom_select_container" onClick={() => setKnowledgeDropdown(!knowledgeDropdown)}
                   style={selectedKnowledge ? {width: '100%'} : {width: '100%', color: '#888888'}}>
                {selectedKnowledge || 'Select knowledge'}<Image width={20} height={21}
                                                                src={!knowledgeDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
                                                                alt="expand-icon"/>
              </div>
              <div>
                {knowledgeDropdown && knowledge && knowledge.length > 0 &&
                  <div className="custom_select_options" ref={knowledgeRef} style={{width: '100%'}}>
                    {knowledge.map((item, index) => (
                      <div key={index} className="custom_select_option" onClick={() => handleKnowledgeSelect(index)}
                           style={{padding: '12px 14px', maxWidth: '100%'}}>
                        {item.name}
                      </div>))}
                    <div className={styles1.knowledge_db}
                         style={{maxWidth: '100%', borderTop: '1px solid #3F3A4E'}}>
                      <div className="custom_select_option"
                           style={{padding: '12px 14px', maxWidth: '100%', borderRadius: '0'}}
                           onClick={() => sendKnowledgeData({
                             id: -6,
                             name: "new knowledge",
                             contentType: "Add_Knowledge",
                             internalId: createInternalId()
                           })}>
                        <Image width={15} height={15} src="/images/plus_symbol.svg" alt="add-icon"/>&nbsp;&nbsp;Add
                        new knowledge
                      </div>
                    </div>
                    <div className={styles1.knowledge_db}
                         style={{maxWidth: '100%', borderTop: '1px solid #3F3A4E'}}>
                      <div className="custom_select_option" style={{
                        padding: '12px 14px',
                        maxWidth: '100%',
                        borderTopLeftRadius: '0',
                        borderTopRightRadius: '0'
                      }}
                           onClick={openMarketplace}>
                        <Image width={15} height={15} src="/images/widgets.svg"
                               alt="marketplace"/>&nbsp;&nbsp;Browse knowledge from marketplace
                      </div>
                    </div>
                  </div>}
                {knowledgeDropdown && knowledge && knowledge.length <= 0 &&
                  <div className="custom_select_options" ref={knowledgeRef}
                       style={{width: '100%', maxHeight: '400px'}}>
                    <div style={{
                      display: 'flex',
                      flexDirection: 'column',
                      alignItems: 'center',
                      justifyContent: 'center',
                      marginTop: '30px',
                      marginBottom: '20px',
                      width: '100%'
                    }}>
                      <Image width={150} height={60} src="/images/no_permissions.svg" alt="no-permissions"/>
                      <span className={styles.feed_title} style={{marginTop: '8px'}}>No knowledge found</span>
                    </div>
                    <div className={styles1.knowledge_db}
                         style={{maxWidth: '100%', borderTop: '1px solid #3F3A4E'}}>
                      <div className="custom_select_option"
                           style={{padding: '12px 14px', maxWidth: '100%', borderRadius: '0'}}
                           onClick={() => sendKnowledgeData({
                             id: -6,
                             name: "new knowledge",
                             contentType: "Add_Knowledge",
                             internalId: createInternalId()
                           })}>
                        <Image width={15} height={15} src="/images/plus_symbol.svg" alt="add-icon"/>&nbsp;&nbsp;Add
                        new knowledge
                      </div>
                    </div>
                    <div className={styles1.knowledge_db}
                         style={{maxWidth: '100%', borderTop: '1px solid #3F3A4E'}}>
                      <div className="custom_select_option" style={{
                        padding: '12px 14px',
                        maxWidth: '100%',
                        borderTopLeftRadius: '0',
                        borderTopRightRadius: '0'
                      }}
                           onClick={openMarketplace}>
                        <Image width={15} height={15} src="/images/widgets.svg"
                               alt="marketplace"/>&nbsp;&nbsp;Browse knowledge from marketplace
                      </div>
                    </div>
                  </div>}
              </div>
            </div>
          </div>}
          <div style={{marginTop: '15px'}}>
            <button className="medium_toggle"
                    onClick={() => setLocalStorageValue("advanced_options_" + String(internalId), !advancedOptions, setAdvancedOptions)}
                    style={advancedOptions ? {background: '#494856'} : {}}>
              {advancedOptions ? 'Hide Advanced Options' : 'Show Advanced Options'}{advancedOptions ?
              <Image style={{marginLeft: '10px'}} width={20} height={21} src="/images/dropdown_up.svg"
                     alt="expand-icon"/> :
              <Image style={{marginLeft: '10px'}} width={20} height={21} src="/images/dropdown_down.svg"
                     alt="expand-icon"/>}
            </button>
          </div>
          {advancedOptions &&
            <div>
              <div style={{marginTop: '15px'}}>
                <label className={styles.form_label}>Agent Workflow</label><br/>
                <div className="dropdown_container_search" style={{width: '100%'}}>
                  <div className={`${"custom_select_container"} ${edit ? 'cursor_not_allowed' : ''}`} onClick={() => {setAgentDropdown(!edit ? !agentDropdown : false)}}
                       style={{width: '100%'}}>
                    {agentWorkflow}<Image width={20} height={21}
                                      src={!agentDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
                                      alt="expand-icon"/>
                  </div>
                  <div>
                    {agentDropdown && <div className="custom_select_options" ref={agentRef} style={{width: '100%'}}>
                      {agentWorkflows.map((agent, index) => (
                        <div key={index} className="custom_select_option" onClick={() => handleAgentSelect(index)}
                             style={{padding: '12px 14px', maxWidth: '100%'}}>
                          {agent}
                        </div>))}
                    </div>}
                  </div>
                </div>
              </div>
              <div style={{marginTop: '15px'}}>
                <div style={{display: 'flex'}}>
                  <input className="checkbox" type="checkbox" checked={addResources}
                         onChange={() => setLocalStorageValue("has_resource_" + String(internalId), !addResources, setAddResources)}/>
                  <label className={styles.form_label} style={{marginLeft: '7px', cursor: 'pointer'}}
                         onClick={() => setLocalStorageValue("has_resource_" + String(internalId), !addResources, setAddResources)}>
                    Add Resources
                  </label>
                </div>
              </div>
              <div style={{width: '100%', height: 'auto', marginTop: '10px'}}>
                {addResources && <div style={{paddingBottom: '10px'}}>
                  <div className={`file-drop-area ${isDragging ? 'dragging' : ''}`} onDragEnter={handleDragEnter}
                       onDragLeave={handleDragLeave} onDragOver={handleDragOver} onDrop={handleDrop}
                       onClick={handleDropAreaClick}>
                    <div><p style={{textAlign: 'center', color: 'white', fontSize: '14px'}}>+ Choose or drop a file
                      here</p>
                      <p style={{textAlign: 'center', color: '#888888', fontSize: '12px'}}>Supported file formats are
                        txt, pdf, docx, epub, csv, pptx only</p>
                      <input type="file" ref={fileInputRef} style={{display: 'none'}} onChange={handleFileInputChange}/>
                    </div>
                  </div>
                  <div className={styles.agent_resources}>
                    {input.map((file, index) => (
                      <div key={index} className={styles.history_box}
                           style={{background: '#272335', padding: '0px 10px', width: '100%', cursor: 'default'}}>
                        <div style={{display: 'flex', alignItems: 'center', justifyContent: 'flex-start'}}>
                          <div><Image width={28} height={46} src={returnResourceIcon(file)} alt="pdf-icon"/></div>
                          <div style={{marginLeft: '5px', width: '100%'}}>
                            <div style={{fontSize: '11px'}} className={styles.single_line_block}>{file.name}</div>
                            <div style={{
                              color: '#888888',
                              fontSize: '9px'
                            }}>{file.type.split("/")[1]}{file.size !== '' ? ` • ${formatBytes(file.size)}` : ''}</div>
                          </div>
                          <div style={{cursor: 'pointer'}} onClick={() => removeFile(index)}><Image width={20}
                                                                                                    height={20}
                                                                                                    src='/images/close.svg'
                                                                                                    alt="close-icon"/>
                          </div>
                        </div>
                      </div>
                    ))}
                  </div>
                </div>}
              </div>
              <div style={{marginTop: '15px'}}>
                <div><label className={styles.form_label}>Constraints</label></div>
                {constraints?.map((constraint, index) => (<div key={index} style={{
                  marginBottom: '10px',
                  display: 'flex',
                  alignItems: 'center',
                  justifyContent: 'space-between'
                }}>
                  <div style={{flex: '1'}}><input className="input_medium" type="text" value={constraint}
                                                  onChange={(event) => handleConstraintChange(index, event.target.value)}/>
                  </div>
                  <div>
                    <button className="secondary_button" style={{marginLeft: '4px', padding: '5px'}}
                            onClick={() => handleConstraintDelete(index)}>
                      <Image width={20} height={21} src="/images/close.svg" alt="close-icon"/>
                    </button>
                  </div>
                </div>))}
                <div>
                  <button className="secondary_button" onClick={addConstraint}>+ Add</button>
                </div>
              </div>
              <div style={{marginTop: '15px'}}>
                <label className={styles.form_label}>Max iterations</label>
                <div style={{display: 'flex', alignItems: 'center', justifyContent: 'space-between'}}>
                  <input style={{width: '90%'}} type="range" min={5} max={100} value={maxIterations}
                         onChange={handleIterationChange}/>
                  <input style={{width: '9%', order: '1', textAlign: 'center', paddingLeft: '0', paddingRight: '0'}}
                         disabled={true} className="input_medium" type="text" value={maxIterations}/>
                </div>
              </div>
              {/*<div style={{marginTop: '15px'}}>*/}
              {/*  <label className={styles.form_label}>Exit criterion</label>*/}
              {/*  <div className="dropdown_container_search" style={{width:'100%'}}>*/}
              {/*    <div className="custom_select_container" onClick={() => setExitDropdown(!exitDropdown)} style={{width:'100%'}}>*/}
              {/*      {exitCriterion}<Image width={20} height={21} src={!exitDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'} alt="expand-icon"/>*/}
              {/*    </div>*/}
              {/*    <div>*/}
              {/*      {exitDropdown && <div className="custom_select_options" ref={exitRef} style={{width:'100%'}}>*/}
              {/*        {exitCriteria.map((exit, index) => (<div key={index} className="custom_select_option" onClick={() => handleExitSelect(index)} style={{padding:'12px 14px',maxWidth:'100%'}}>*/}
              {/*          {exit}*/}
              {/*        </div>))}*/}
              {/*      </div>}*/}
              {/*    </div>*/}
              {/*  </div>*/}
              {/*</div>*/}
              {/*<div style={{marginTop: '15px'}}>*/}
              {/*  <label className={styles.form_label}>Time between steps (in milliseconds)</label>*/}
              {/*  <input className="input_medium" type="number" value={stepTime} onChange={handleStepChange}/>*/}
              {/*</div>*/}
              {/*<div style={{marginTop: '15px'}}>*/}
              {/*  <div style={{display:'flex'}}>*/}
              {/*    <input className="checkbox" type="checkbox" checked={longTermMemory} onChange={() => setLocalStorageValue("has_LTM_" + String(internalId), !longTermMemory, setLongTermMemory)} />*/}
              {/*    <label className={styles.form_label} style={{marginLeft:'7px',cursor:'pointer'}} onClick={() => setLocalStorageValue("has_LTM_" + String(internalId), !longTermMemory, setLongTermMemory)}>*/}
              {/*      Long term memory*/}
              {/*    </label>*/}
              {/*  </div>*/}
              {/*</div>*/}
              {/*{longTermMemory === true && <div style={{marginTop: '10px'}}>*/}
              {/*  <label className={styles.form_label}>Choose an LTM database</label>*/}
              {/*  <div className="dropdown_container_search" style={{width:'100%'}}>*/}
              {/*    <div className="custom_select_container" onClick={() => setDatabaseDropdown(!databaseDropdown)} style={{width:'100%'}}>*/}
              {/*      {database}<Image width={20} height={21} src={!databaseDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'} alt="expand-icon"/>*/}
              {/*    </div>*/}
              {/*    <div>*/}
              {/*      {databaseDropdown && <div className="custom_select_options" ref={databaseRef} style={{width:'100%'}}>*/}
              {/*        {databases.map((data, index) => (<div key={index} className="custom_select_option" onClick={() => handleDatabaseSelect(index)} style={{padding:'12px 14px',maxWidth:'100%'}}>*/}
              {/*          {data}*/}
              {/*        </div>))}*/}
              {/*      </div>}*/}
              {/*    </div>*/}
              {/*  </div>*/}
              {/*</div>}*/}
              <div style={{marginTop: '15px'}}>
                <label className={styles.form_label}>Permission Type</label>
                <div className="dropdown_container_search" style={{width: '100%'}}>
                  <div className="custom_select_container" onClick={() => setPermissionDropdown(!permissionDropdown)}
                       style={{width: '100%'}}>
                    {permission}<Image width={20} height={21}
                                       src={!permissionDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
                                       alt="expand-icon"/>
                  </div>
                  <div className="mb_34">
                    {permissionDropdown &&
                      <div className="custom_select_options mb_30" ref={permissionRef} style={{width: '100%'}}>
                        {permissions.map((permit, index) => (<div key={index} className="custom_select_option padding_12_14 mxw_100"
                                                                  onClick={() => handlePermissionSelect(index)}  style={checkPermissionValidity(permit) ? {color: '#888888', textDecoration: 'line-through',pointerEvents: 'none'} : {}}>
                          {permit}
                        </div>))}
                      </div>}
                  </div>
                </div>
              </div>
            </div>
          }

          <div style={{marginTop: '10px', display: 'flex', justifyContent: 'flex-end'}}>
            <div className="display_flex_container position_relative mr_7">
              <div>
                {dropdown && (<div className={styles.dropdown_container_agent} onMouseOver={() => setDropdown(true)} onMouseOut={() => setDropdown(false)}>
                  <ul className="padding_0 margin_0">
                    <li className={`${styles.dropdown_item_agent} ${"dropdown_item"}`} onClick={() => updateTemplate()}>Update template</li>
                    {env === 'PROD' && <li className={`${styles.dropdown_item_agent} ${"dropdown_item"}`} onClick={() => handleAddToMarketplace()}>Publish to Marketplace</li>}
                </ul>
                </div>)}
              </div>
              {showButton && <div>
                  <button className="secondary_button padding_8" onClick={() => setDropdown(true)}>
                    <Image width={20} height={20} src="/images/three_dots.svg" alt="run-icon"/>
                  </button>
                </div>}
              </div>
            <button style={{marginRight: '7px'}} className="secondary_button"
                    onClick={() => removeTab(-1, "new agent", "Create_Agent", internalId)}>Cancel
            </button>
            {!edit ? <div style={{display: 'flex', position: 'relative'}}>
              {createDropdown && (<div className="create_agent_dropdown_options" onClick={() => {
                setCreateModal(true);
                setCreateDropdown(false);
              }}>Create & Schedule Run
              </div>)}
              <div className="primary_button"
                   style={{backgroundColor: 'white', marginBottom: '4px', paddingLeft: '0', paddingRight: '5px'}}>
                <button disabled={!createClickable} className="primary_button" style={{paddingRight: '5px'}}
                        onClick={() => {handleAddAgent();}}>{createClickable ? 'Create and Run' : 'Creating Agent...'}</button>
                <button onClick={() => setCreateDropdown(!createDropdown)}
                        style={{border: 'none', backgroundColor: 'white'}}>
                  <Image width={20} height={21}
                         src={!createDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'}
                         alt="expand-icon"/>
                </button>
              </div>
            </div>: <div className="primary_button" style={{backgroundColor: 'white', marginBottom: '4px', paddingLeft: '0', paddingRight: '5px'}}>
              <button className="primary_button" style={{paddingRight: '5px'}}
                      onClick={() => setEditModal(true)}>Update changes</button> </div>}
          </div>

          {createModal && (
            <AgentSchedule env={env} internalId={internalId} closeCreateModal={closeCreateModal} type="create_agent"/>
          )}

          {editModal && (<div className="modal" onClick={() => setEditModal(!editModal)}>
            <div className="modal-content w_35" onClick={preventDefault}>
              <div className={styles.detail_name}>Update agent</div>
              <div><label className={styles.form_label}>All the new runs of this agent will be updated with the latest changes. Are you sure you want to update changes?</label></div>
              <div className="mt_20 justify_end display_flex">
                <button className="secondary_button mr_10" onClick={() => setEditModal(false)}>
                  Cancel
                </button>
                <button className={`${styles.run_button} h_32p padding_0_15 `} onClick={handleAddAgent}>
                  Update changes
                </button>
              </div>
            </div>
          </div>)}

          {publishModal && <div className="modal" onClick={() => {setPublishModal(false)}}>
            <div className="modal-content w_35" onClick={preventDefault}>
              <div className={styles.detail_name}>Template submitted successfully!</div>
              <div>
                <label className={styles.form_label}>Your template is under review. Please check the marketplace in 2-3 days. If your template is not visible on the marketplace, reach out to us on Discord&nbsp;
                  <a href="https://discord.com/channels/1107593006032355359/1143813784683692093" target="_blank" rel="noopener noreferrer">
                    #agent-templates-submission
                  </a> channel.</label>
              </div>
              <div className={styles.modal_buttons}>
                <button className="primary_button" onClick={() => {setPublishModal(false)}}>
                  Okay
                </button>
              </div>
            </div>
          </div>}

        </div>
      </div>
      <div className="col-3"></div>
    </div>
    <ToastContainer/>
  </>)
}

================================================
FILE: gui/pages/Content/Agents/AgentSchedule.js
================================================
import React, {useState, useEffect, useRef} from 'react';
import {setLocalStorageValue, convertToGMT, preventDefault, getUserClick} from "@/utils/utils";
import styles from "@/pages/Content/Agents/Agents.module.css";
import styles1 from "@/pages/Content/Agents/react-datetime.css";
import Image from "next/image";
import Datetime from "react-datetime";
import {toast} from "react-toastify";
import {agentScheduleComponent, createAndScheduleRun, updateSchedule} from "@/pages/api/DashboardService";
import {EventBus} from "@/utils/eventBus";
import moment from 'moment';

export default function AgentSchedule({
                                        internalId,
                                        closeCreateModal,
                                        type,
                                        agentId,
                                        setCreateModal,
                                        setCreateEditModal,
                                        env,
                                      }) {
  const [isRecurring, setIsRecurring] = useState(false);
  const [timeDropdown, setTimeDropdown] = useState(false);
  const [expiryDropdown, setExpiryDropdown] = useState(false);

  const [startTime, setStartTime] = useState('');

  const timeUnitArray = (env === 'PROD') ? ['Days', 'Hours'] : ['Days', 'Hours', 'Minutes'];
  const [timeUnit, setTimeUnit] = useState(timeUnitArray[1]);
  const [timeValue, setTimeValue] = useState(null);

  const expiryTypeArray = ['Specific Date', 'After certain number of runs', 'No expiry'];
  const [expiryType, setExpiryType] = useState(expiryTypeArray[1]);
  const [expiryRuns, setExpiryRuns] = useState(0);
  const [expiryDate, setExpiryDate] = useState(null);

  const timeRef = useRef(null);
  const expiryRef = useRef(null);

  const [modalHeading, setModalHeading] = useState('Schedule Run')
  const [modalButton, setModalButton] = useState('Create and Schedule Run')
  const [localStartTime, setLocalStartTime] = useState('')

  useEffect(() => {
    function handleClickOutside(event) {
      if (timeRef.current && !timeRef.current.contains(event.target)) {
        setTimeDropdown(false)
      }

      if (expiryRef.current && !expiryRef.current.contains(event.target)) {
        setExpiryDropdown(false);
      }
    }

    document.addEventListener('mousedown', handleClickOutside);
    return () => {
      document.removeEventListener('mousedown', handleClickOutside);
    };
  }, []);

  useEffect(() => {
    if (type === "edit_schedule_agent") {
      setModalHeading('Edit Schedule')
      setModalButton("Update Schedule")
      fetchAgentScheduleComponent();
    }
  }, []);

  useEffect(() => {
    if (internalId !== null) {
      const agent_is_recurring = localStorage.getItem("agent_is_recurring_" + String(internalId));
      if (agent_is_recurring) {
        setIsRecurring(JSON.parse(agent_is_recurring));
      }

      const agent_time_unit = localStorage.getItem("agent_time_unit_" + String(internalId));
      if (agent_time_unit) {
        setTimeUnit(agent_time_unit);
      }

      const agent_time_value = localStorage.getItem("agent_time_value_" + String(internalId));
      if (agent_time_value) {
        setTimeValue(Number(agent_time_value));
      }

      const agent_expiry_type = localStorage.getItem("agent_expiry_type_" + String(internalId));
      if (agent_expiry_type) {
        setExpiryType(agent_expiry_type);
      }

      const agent_expiry_runs = localStorage.getItem("agent_expiry_runs_" + String(internalId));
      if (agent_expiry_runs) {
        setExpiryRuns(Number(agent_expiry_runs));
      }

      const agent_start_time = localStorage.getItem("agent_start_time_" + String(internalId));
      if (agent_start_time) {
        setStartTime(agent_start_time);
      }

      const agent_expiry_date = localStorage.getItem("agent_expiry_date_" + String(internalId));
      if (agent_expiry_date) {
        setExpiryDate(agent_expiry_date);
      }
    }
  }, [internalId])

  const handleDateTimeChange = (momentObj) => {
    const expiryDate = convertToGMT(momentObj);
    setLocalStorageValue("agent_expiry_date_" + String(internalId), expiryDate, setExpiryDate);
  };

  const handleTimeChange = (momentObj) => {
    const startTime = convertToGMT(momentObj);
    setLocalStartTime(typeof momentObj === 'string' ? '' : momentObj.toDate())
    setLocalStorageValue("agent_start_time_" + String(internalId), startTime, setStartTime);
  };

  const toggleRecurring = () => {
    setLocalStorageValue("agent_is_recurring_" + String(internalId), !isRecurring, setIsRecurring);
  };

  const handleTimeSelect = (index) => {
    setLocalStorageValue("agent_time_unit_" + String(internalId), timeUnitArray[index], setTimeUnit);
    setTimeDropdown(false);
  }

  const handleExpirySelect = (index) => {
    setLocalStorageValue("agent_expiry_type_" + String(internalId), expiryTypeArray[index], setExpiryType);
    setExpiryDropdown(false);
  }

  const handleDateChange = (event) => {
    setLocalStorageValue("agent_time_value_" + String(internalId), event.target.value, setTimeValue);
  };

  const handleExpiryRuns = (event) => {
    setLocalStorageValue("agent_expiry_runs_" + String(internalId), event.target.value, setExpiryRuns);
  };

  const addScheduledAgent = () => {
    if ((startTime === '' || (isRecurring === true && (timeValue == null || (expiryType === "After certain number of runs" && (parseInt(expiryRuns, 10) < 1)) || (expiryType === "Specific date" && expiryDate == null))))) {
      toast.error('Please input correct details', {autoClose: 1800});
      return;
    }

    if (type === "create_agent") {
      const scheduleData = {
        "start_time": startTime,
        "recurrence_interval": timeValue ? `${timeValue} ${timeUnit}` : null,
        "expiry_runs": expiryType === 'After certain number of runs' ? parseInt(expiryRuns) : -1,
        "expiry_date": expiryType === 'Specific Date' ? expiryDate : null,
      }
      EventBus.emit('handleAgentScheduling', scheduleData);
      getUserClick('Agent Scheduled', {'Type': 'New Agent'})
    } else {
      if (type === "schedule_agent") {
        const requestData = {
          "agent_id": agentId,
          "start_time": startTime,
          "recurrence_interval": timeValue && isRecurring ? `${timeValue} ${timeUnit}` : null,
          "expiry_runs": expiryType === 'After certain number of runs' && isRecurring ? parseInt(expiryRuns) : -1,
          "expiry_date": expiryType === 'Specific Date' && isRecurring ? expiryDate : null,
        };

        createAndScheduleRun(requestData)
          .then(response => {
            const {schedule_id} = response.data;
            toast.success('Scheduled successfully!', {autoClose: 1800});
            setCreateModal();
            getUserClick('Agent Scheduled', {'Type': 'Existing Agent'})
            EventBus.emit('reFetchAgents', {});
            setTimeout(() => {
                EventBus.emit('refreshDate', {});
            }, 1000)
          })
          .catch(error => {
            console.error('Error:', error);
          });
      } else {
        if (type === "edit_schedule_agent") {
          fetchUpdateSchedule();
        }
      }
    }
  };

  function checkTime() {
    if (expiryDate === null) {
      return true;
    }
    let date1 = expiryDate;
    if (typeof expiryDate === 'string' && expiryDate.includes('/')) {
      date1 = moment(expiryDate, 'DD/MM/YYYY').toDate();
    } else if (typeof expiryDate === 'string') {
      date1 = moment.utc(expiryDate, 'YYYY-MM-DD HH:mm:ss').local().toDate();
    } else
      return
    let date2 = moment.utc(startTime, 'YYYY-MM-DD HH:mm:ss').local().toDate();

    date1.setHours(0, 0, 0, 0);
    date2.setHours(0, 0, 0, 0);

    date1 = convertToGMT(date1);
    date2 = convertToGMT(date2);

    return date1 <= date2;
  }

  function fetchUpdateSchedule() {
    if (expiryType === 'Specific Date' && checkTime()) {
      toast.error('Expiry Date of agent is before Start Date')
      return;
    }
    const requestData = {
      "agent_id": agentId,
      "start_time": startTime,
      "recurrence_interval": timeValue && isRecurring ? `${timeValue} ${timeUnit}` : null,
      "expiry_runs": expiryType === 'After certain number of runs' && isRecurring ? parseInt(expiryRuns) : -1,
      "expiry_date": expiryType === 'Specific Date' && isRecurring ? (expiryDate && expiryDate.includes('/') ? convertToGMT(moment(expiryDate, 'DD/MM/YYYY').toDate()) : expiryDate) : null,
    };

    updateSchedule(requestData)
      .then((response) => {
        if (response.status === 200) {
          toast.success('Schedule updated successfully', {autoClose: 1800});
          EventBus.emit('refreshDate', {});
          setCreateEditModal();
          EventBus.emit('reFetchAgents', {});
        } else {
          toast.error('Error updating agent schedule', {autoClose: 1800});
        }
      })
      .catch((error) => {
        console.error('Error updating agent schedule:', error);
      });
  }

  function fetchAgentScheduleComponent() {
    agentScheduleComponent(agentId)
      .then((response) => {
        const {current_datetime, recurrence_interval, expiry_date, expiry_runs, start_date, start_time} = response.data;
        setExpiryRuns(expiry_runs);
        setExpiryDate(expiry_date);
        if ((expiry_date || expiry_runs !== -1) && recurrence_interval !== null) {
          setTimeValue(parseInt(recurrence_interval.substring(0, 1), 10))
          setTimeUnit(recurrence_interval.substring(2,))
          setIsRecurring(true);
          setExpiryType(expiry_date ? 'Specific Date' : 'After certain number of runs');
        } else {
          setExpiryType('No expiry');
        }
      })
      .catch((error) => {
        console.error('Error
Download .txt
gitextract_6lrw3u4j/

├── .do/
│   ├── app.yaml
│   └── deploy.template.yaml
├── .dockerignore
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   └── 1.BUG_REPORT.yml
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       ├── ci.yml
│       └── codeql.yml
├── .gitignore
├── .pre-commit-config.yaml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Dockerfile
├── Dockerfile-gpu
├── DockerfileCelery
├── DockerfileRedis
├── LICENSE
├── README.MD
├── alembic.ini
├── cli2.py
├── config_template.yaml
├── docker-compose-dev.yaml
├── docker-compose-gpu.yml
├── docker-compose.image.example.yaml
├── docker-compose.yaml
├── entrypoint.sh
├── entrypoint_celery.sh
├── gui/
│   ├── .dockerignore
│   ├── .eslintrc.json
│   ├── Dockerfile
│   ├── DockerfileProd
│   ├── README.md
│   ├── app/
│   │   ├── globals.css
│   │   └── layout.js
│   ├── jsconfig.json
│   ├── next.config.js
│   ├── package.json
│   ├── pages/
│   │   ├── Content/
│   │   │   ├── APM/
│   │   │   │   ├── Apm.module.css
│   │   │   │   ├── ApmDashboard.js
│   │   │   │   └── BarGraph.js
│   │   │   ├── Agents/
│   │   │   │   ├── ActionConsole.js
│   │   │   │   ├── ActivityFeed.js
│   │   │   │   ├── AgentCreate.js
│   │   │   │   ├── AgentSchedule.js
│   │   │   │   ├── AgentTemplatesList.js
│   │   │   │   ├── AgentWorkspace.js
│   │   │   │   ├── Agents.js
│   │   │   │   ├── Agents.module.css
│   │   │   │   ├── Details.js
│   │   │   │   ├── ResourceList.js
│   │   │   │   ├── ResourceManager.js
│   │   │   │   ├── RunHistory.js
│   │   │   │   ├── TaskQueue.js
│   │   │   │   └── react-datetime.css
│   │   │   ├── Knowledge/
│   │   │   │   ├── AddKnowledge.js
│   │   │   │   ├── Knowledge.js
│   │   │   │   ├── Knowledge.module.css
│   │   │   │   ├── KnowledgeDetails.js
│   │   │   │   └── KnowledgeForm.js
│   │   │   ├── Marketplace/
│   │   │   │   ├── AgentTemplate.js
│   │   │   │   ├── KnowledgeTemplate.js
│   │   │   │   ├── Market.js
│   │   │   │   ├── Market.module.css
│   │   │   │   ├── MarketAgent.js
│   │   │   │   ├── MarketKnowledge.js
│   │   │   │   ├── MarketTools.js
│   │   │   │   ├── MarketplacePublic.js
│   │   │   │   └── ToolkitTemplate.js
│   │   │   ├── Models/
│   │   │   │   ├── AddModel.js
│   │   │   │   ├── AddModelMarketPlace.js
│   │   │   │   ├── MarketModels.js
│   │   │   │   ├── ModelDetails.js
│   │   │   │   ├── ModelForm.js
│   │   │   │   ├── ModelInfo.js
│   │   │   │   ├── ModelMetrics.js
│   │   │   │   ├── ModelTemplate.js
│   │   │   │   └── Models.js
│   │   │   └── Toolkits/
│   │   │       ├── AddTool.js
│   │   │       ├── Metrics.js
│   │   │       ├── Tool.module.css
│   │   │       ├── ToolkitWorkspace.js
│   │   │       └── Toolkits.js
│   │   ├── Dashboard/
│   │   │   ├── Content.js
│   │   │   ├── Dashboard.module.css
│   │   │   ├── Settings/
│   │   │   │   ├── AddDatabase.js
│   │   │   │   ├── ApiKeys.js
│   │   │   │   ├── Database.js
│   │   │   │   ├── DatabaseDetails.js
│   │   │   │   ├── Model.js
│   │   │   │   ├── Settings.js
│   │   │   │   └── Webhooks.js
│   │   │   ├── SideBar.js
│   │   │   └── TopBar.js
│   │   ├── _app.css
│   │   ├── _app.js
│   │   └── api/
│   │       ├── DashboardService.js
│   │       └── apiConfig.js
│   └── utils/
│       ├── eventBus.js
│       └── utils.js
├── install_tool_dependencies.sh
├── local-llm
├── local-llm-gpu
├── main.py
├── migrations/
│   ├── README
│   ├── env.py
│   ├── script.py.mako
│   └── versions/
│       ├── 1d54db311055_add_permissions.py
│       ├── 2cc1179834b0_agent_executions_modified.py
│       ├── 2f97c068fab9_resource_modified.py
│       ├── 2fbd6472112c_add_feed_group_id_to_execution_and_feed.py
│       ├── 3356a2f89a33_added_configurations_table.py
│       ├── 35e47f20475b_renamed_tokens_calls.py
│       ├── 3867bb00a495_added_first_login_source.py
│       ├── 40affbf3022b_add_filter_colume_in_webhooks.py
│       ├── 446884dcae58_add_api_key_and_web_hook.py
│       ├── 44b0d6f2d1b3_init_models.py
│       ├── 467e85d5e1cd_updated_resources_added_exec_id.py
│       ├── 516ecc1c723d_adding_marketplace_template_id_to_agent_.py
│       ├── 5184645e9f12_add_question_to_agent_execution_.py
│       ├── 520aa6776347_create_models_config.py
│       ├── 598cfb37292a_adding_agent_templates.py
│       ├── 5d5f801f28e7_create_model_table.py
│       ├── 661ec8a4c32e_open_ai_error_handling.py
│       ├── 71e3980d55f5_knowledge_and_vector_dbs.py
│       ├── 7a3e336c0fba_added_tools_related_models.py
│       ├── 83424de1347e_added_agent_execution_config.py
│       ├── 8962bed0d809_creating_agent_templates.py
│       ├── 9270eb5a8475_local_llms.py
│       ├── 9419b3340af7_create_agent_workflow.py
│       ├── a91808a89623_added_resources.py
│       ├── ba60b12ae109_create_agent_scheduler.py
│       ├── be1d922bf2ad_create_call_logs_table.py
│       ├── c02f3d759bf3_add_summary_to_resource.py
│       ├── c4f2f6ba602a_agent_workflow_wait_step.py
│       ├── c5c19944c90c_create_oauth_tokens.py
│       ├── cac478732572_delete_agent_feature.py
│       ├── d8315244ea43_updated_tool_configs.py
│       ├── d9b3436197eb_renaming_templates.py
│       ├── e39295ec089c_creating_events.py
│       └── fe234ea6e9bc_modify_agent_workflow_tables.py
├── nginx/
│   └── default.conf
├── package.json
├── requirements.txt
├── run.bat
├── run.sh
├── run_gui.py
├── run_gui.sh
├── superagi/
│   ├── __init__.py
│   ├── agent/
│   │   ├── __init__.py
│   │   ├── agent_iteration_step_handler.py
│   │   ├── agent_message_builder.py
│   │   ├── agent_prompt_builder.py
│   │   ├── agent_prompt_template.py
│   │   ├── agent_tool_step_handler.py
│   │   ├── agent_workflow_step_wait_handler.py
│   │   ├── common_types.py
│   │   ├── output_handler.py
│   │   ├── output_parser.py
│   │   ├── prompts/
│   │   │   ├── agent_queue_input.txt
│   │   │   ├── agent_recursive_summary.txt
│   │   │   ├── agent_summary.txt
│   │   │   ├── agent_tool_input.txt
│   │   │   ├── agent_tool_output.txt
│   │   │   ├── analyse_task.txt
│   │   │   ├── create_tasks.txt
│   │   │   ├── initialize_tasks.txt
│   │   │   ├── prioritize_tasks.txt
│   │   │   └── superagi.txt
│   │   ├── queue_step_handler.py
│   │   ├── task_queue.py
│   │   ├── tool_builder.py
│   │   ├── tool_executor.py
│   │   ├── types/
│   │   │   ├── __init__.py
│   │   │   ├── agent_execution_status.py
│   │   │   ├── agent_workflow_step_action_types.py
│   │   │   └── wait_step_status.py
│   │   └── workflow_seed.py
│   ├── apm/
│   │   ├── __init__.py
│   │   ├── analytics_helper.py
│   │   ├── call_log_helper.py
│   │   ├── event_handler.py
│   │   ├── knowledge_handler.py
│   │   └── tools_handler.py
│   ├── config/
│   │   ├── __init__.py
│   │   └── config.py
│   ├── controllers/
│   │   ├── __init__.py
│   │   ├── agent.py
│   │   ├── agent_execution.py
│   │   ├── agent_execution_config.py
│   │   ├── agent_execution_feed.py
│   │   ├── agent_execution_permission.py
│   │   ├── agent_template.py
│   │   ├── agent_workflow.py
│   │   ├── analytics.py
│   │   ├── api/
│   │   │   └── agent.py
│   │   ├── api_key.py
│   │   ├── budget.py
│   │   ├── config.py
│   │   ├── google_oauth.py
│   │   ├── knowledge_configs.py
│   │   ├── knowledges.py
│   │   ├── marketplace_stats.py
│   │   ├── models_controller.py
│   │   ├── organisation.py
│   │   ├── project.py
│   │   ├── resources.py
│   │   ├── tool.py
│   │   ├── tool_config.py
│   │   ├── toolkit.py
│   │   ├── twitter_oauth.py
│   │   ├── types/
│   │   │   ├── agent_execution_config.py
│   │   │   ├── agent_publish_config.py
│   │   │   ├── agent_schedule.py
│   │   │   ├── agent_with_config.py
│   │   │   ├── agent_with_config_schedule.py
│   │   │   └── models_types.py
│   │   ├── user.py
│   │   ├── vector_db_indices.py
│   │   ├── vector_dbs.py
│   │   └── webhook.py
│   ├── helper/
│   │   ├── agent_schedule_helper.py
│   │   ├── auth.py
│   │   ├── calendar_date.py
│   │   ├── encyption_helper.py
│   │   ├── error_handler.py
│   │   ├── feed_parser.py
│   │   ├── github_helper.py
│   │   ├── google_calendar_creds.py
│   │   ├── google_search.py
│   │   ├── google_serp.py
│   │   ├── imap_email.py
│   │   ├── json_cleaner.py
│   │   ├── llm_loader.py
│   │   ├── models_helper.py
│   │   ├── prompt_reader.py
│   │   ├── read_email.py
│   │   ├── resource_helper.py
│   │   ├── s3_helper.py
│   │   ├── time_helper.py
│   │   ├── token_counter.py
│   │   ├── tool_helper.py
│   │   ├── twitter_helper.py
│   │   ├── twitter_tokens.py
│   │   ├── validate_csv.py
│   │   ├── webhook_manager.py
│   │   └── webpage_extractor.py
│   ├── image_llms/
│   │   ├── __init__.py
│   │   ├── base_image_llm.py
│   │   └── openai_dalle.py
│   ├── jobs/
│   │   ├── __init__.py
│   │   ├── agent_executor.py
│   │   └── scheduling_executor.py
│   ├── lib/
│   │   └── logger.py
│   ├── llms/
│   │   ├── __init__.py
│   │   ├── base_llm.py
│   │   ├── google_palm.py
│   │   ├── grammar/
│   │   │   └── json.gbnf
│   │   ├── hugging_face.py
│   │   ├── llm_model_factory.py
│   │   ├── local_llm.py
│   │   ├── openai.py
│   │   ├── replicate.py
│   │   └── utils/
│   │       ├── __init__.py
│   │       └── huggingface_utils/
│   │           ├── __init__.py
│   │           ├── public_endpoints.py
│   │           └── tasks.py
│   ├── models/
│   │   ├── __init__.py
│   │   ├── agent.py
│   │   ├── agent_config.py
│   │   ├── agent_execution.py
│   │   ├── agent_execution_config.py
│   │   ├── agent_execution_feed.py
│   │   ├── agent_execution_permission.py
│   │   ├── agent_schedule.py
│   │   ├── agent_template.py
│   │   ├── agent_template_config.py
│   │   ├── api_key.py
│   │   ├── base_model.py
│   │   ├── budget.py
│   │   ├── call_logs.py
│   │   ├── configuration.py
│   │   ├── db.py
│   │   ├── events.py
│   │   ├── knowledge_configs.py
│   │   ├── knowledges.py
│   │   ├── marketplace_stats.py
│   │   ├── models.py
│   │   ├── models_config.py
│   │   ├── oauth_tokens.py
│   │   ├── organisation.py
│   │   ├── project.py
│   │   ├── resource.py
│   │   ├── tool.py
│   │   ├── tool_config.py
│   │   ├── toolkit.py
│   │   ├── types/
│   │   │   ├── __init__.py
│   │   │   ├── agent_config.py
│   │   │   ├── login_request.py
│   │   │   └── validate_llm_api_key_request.py
│   │   ├── user.py
│   │   ├── vector_db_configs.py
│   │   ├── vector_db_indices.py
│   │   ├── vector_dbs.py
│   │   ├── webhook_events.py
│   │   ├── webhooks.py
│   │   └── workflows/
│   │       ├── __init__.py
│   │       ├── agent_workflow.py
│   │       ├── agent_workflow_step.py
│   │       ├── agent_workflow_step_tool.py
│   │       ├── agent_workflow_step_wait.py
│   │       ├── iteration_workflow.py
│   │       └── iteration_workflow_step.py
│   ├── resource_manager/
│   │   ├── __init__.py
│   │   ├── file_manager.py
│   │   ├── llama_document_summary.py
│   │   ├── llama_vector_store_factory.py
│   │   ├── resource_manager.py
│   │   └── resource_summary.py
│   ├── tool_manager.py
│   ├── tools/
│   │   ├── __init__.py
│   │   ├── apollo/
│   │   │   ├── __init__.py
│   │   │   ├── apollo_search.py
│   │   │   └── apollo_toolkit.py
│   │   ├── base_tool.py
│   │   ├── code/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── coding_toolkit.py
│   │   │   ├── improve_code.py
│   │   │   ├── prompts/
│   │   │   │   ├── generate_logic.txt
│   │   │   │   ├── improve_code.txt
│   │   │   │   ├── write_code.txt
│   │   │   │   ├── write_spec.txt
│   │   │   │   └── write_test.txt
│   │   │   ├── write_code.py
│   │   │   ├── write_spec.py
│   │   │   └── write_test.py
│   │   ├── duck_duck_go/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── duck_duck_go_search.py
│   │   │   └── duck_duck_go_search_toolkit.py
│   │   ├── email/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── email_toolkit.py
│   │   │   ├── read_email.py
│   │   │   ├── send_email.py
│   │   │   └── send_email_attachment.py
│   │   ├── file/
│   │   │   ├── __init__.py
│   │   │   ├── append_file.py
│   │   │   ├── delete_file.py
│   │   │   ├── file_toolkit.py
│   │   │   ├── list_files.py
│   │   │   ├── read_file.py
│   │   │   └── write_file.py
│   │   ├── github/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── add_file.py
│   │   │   ├── delete_file.py
│   │   │   ├── fetch_pull_request.py
│   │   │   ├── github_toolkit.py
│   │   │   ├── prompts/
│   │   │   │   └── code_review.txt
│   │   │   ├── review_pull_request.py
│   │   │   └── search_repo.py
│   │   ├── google_calendar/
│   │   │   ├── README.md
│   │   │   ├── create_calendar_event.py
│   │   │   ├── delete_calendar_event.py
│   │   │   ├── event_details_calendar.py
│   │   │   ├── google_calendar_toolkit.py
│   │   │   └── list_calendar_events.py
│   │   ├── google_search/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── google_search.py
│   │   │   └── google_search_toolkit.py
│   │   ├── google_serp_search/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── google_serp_search.py
│   │   │   └── google_serp_search_toolkit.py
│   │   ├── image_generation/
│   │   │   ├── README.MD
│   │   │   ├── README.STABLE_DIFFUSION.md
│   │   │   ├── __init__.py
│   │   │   ├── dalle_image_gen.py
│   │   │   ├── image_generation_toolkit.py
│   │   │   └── stable_diffusion_image_gen.py
│   │   ├── instagram_tool/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── instagram.py
│   │   │   └── instagram_toolkit.py
│   │   ├── jira/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── create_issue.py
│   │   │   ├── edit_issue.py
│   │   │   ├── get_projects.py
│   │   │   ├── jira_toolkit.py
│   │   │   ├── search_issues.py
│   │   │   └── tool.py
│   │   ├── knowledge_search/
│   │   │   ├── knowledge_search.py
│   │   │   └── knowledge_search_toolkit.py
│   │   ├── resource/
│   │   │   ├── __init__.py
│   │   │   ├── query_resource.py
│   │   │   └── resource_toolkit.py
│   │   ├── searx/
│   │   │   ├── README.MD
│   │   │   ├── __init__.py
│   │   │   ├── search_scraper.py
│   │   │   ├── searx.py
│   │   │   └── searx_toolkit.py
│   │   ├── slack/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── send_message.py
│   │   │   └── slack_toolkit.py
│   │   ├── thinking/
│   │   │   ├── __init__.py
│   │   │   ├── prompts/
│   │   │   │   └── thinking.txt
│   │   │   ├── thinking_toolkit.py
│   │   │   └── tools.py
│   │   ├── tool_response_query_manager.py
│   │   ├── twitter/
│   │   │   ├── README.md
│   │   │   ├── send_tweets.py
│   │   │   └── twitter_toolkit.py
│   │   └── webscaper/
│   │       ├── README.MD
│   │       ├── __init__.py
│   │       ├── tools.py
│   │       └── web_scraper_toolkit.py
│   ├── types/
│   │   ├── __init__.py
│   │   ├── common.py
│   │   ├── key_type.py
│   │   ├── model_source_types.py
│   │   ├── queue_status.py
│   │   ├── storage_types.py
│   │   └── vector_store_types.py
│   ├── vector_embeddings/
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── pinecone.py
│   │   ├── qdrant.py
│   │   ├── vector_embedding_factory.py
│   │   └── weaviate.py
│   ├── vector_store/
│   │   ├── __init__.py
│   │   ├── base.py
│   │   ├── chromadb.py
│   │   ├── document.py
│   │   ├── embedding/
│   │   │   ├── __init__.py
│   │   │   ├── base.py
│   │   │   ├── openai.py
│   │   │   └── palm.py
│   │   ├── pinecone.py
│   │   ├── qdrant.py
│   │   ├── redis.py
│   │   ├── vector_factory.py
│   │   └── weaviate.py
│   └── worker.py
├── test.py
├── test_main.http
├── tests/
│   ├── __init__.py
│   ├── integration_tests/
│   │   ├── __init__.py
│   │   ├── vector_embeddings/
│   │   │   ├── __init__.py
│   │   │   ├── test_pinecone.py
│   │   │   ├── test_qdrant.py
│   │   │   └── test_weaviate.py
│   │   └── vector_store/
│   │       ├── __init__.py
│   │       ├── test_qdrant.py
│   │       └── test_weaviate.py
│   ├── tools/
│   │   └── google_calendar/
│   │       ├── create_event_test.py
│   │       ├── delete_event_test.py
│   │       ├── event_details_test.py
│   │       └── list_events_test.py
│   └── unit_tests/
│       ├── __init__.py
│       ├── agent/
│       │   ├── __init__.py
│       │   ├── test_agent_iteration_step_handler.py
│       │   ├── test_agent_message_builder.py
│       │   ├── test_agent_prompt_builder.py
│       │   ├── test_agent_prompt_template.py
│       │   ├── test_agent_tool_step_handler.py
│       │   ├── test_agent_workflow_step_wait_handler.py
│       │   ├── test_output_handler.py
│       │   ├── test_output_parser.py
│       │   ├── test_queue_step_handler.py
│       │   ├── test_task_queue.py
│       │   ├── test_tool_builder.py
│       │   └── test_tool_executor.py
│       ├── apm/
│       │   ├── __init__.py
│       │   ├── test_analytics_helper.py
│       │   ├── test_call_log_helper.py
│       │   ├── test_event_handler.py
│       │   ├── test_knowledge_handler.py
│       │   └── test_tools_handler.py
│       ├── controllers/
│       │   ├── __init__.py
│       │   ├── api/
│       │   │   ├── __init__.py
│       │   │   └── test_agent.py
│       │   ├── test_agent.py
│       │   ├── test_agent_execution.py
│       │   ├── test_agent_execution_config.py
│       │   ├── test_agent_execution_feeds.py
│       │   ├── test_agent_template.py
│       │   ├── test_analytics.py
│       │   ├── test_models_controller.py
│       │   ├── test_publish_agent.py
│       │   ├── test_tool.py
│       │   ├── test_tool_config.py
│       │   ├── test_toolkit.py
│       │   ├── test_update_agent_config_table.py
│       │   └── test_user.py
│       ├── helper/
│       │   ├── __init__.py
│       │   ├── test_agent_schedule_helper.py
│       │   ├── test_calendar_date.py
│       │   ├── test_error_handling.py
│       │   ├── test_feed_parser.py
│       │   ├── test_github_helper.py
│       │   ├── test_json_cleaner.py
│       │   ├── test_resource_helper.py
│       │   ├── test_s3_helper.py
│       │   ├── test_time_helper.py
│       │   ├── test_token_counter.py
│       │   ├── test_tool_helper.py
│       │   ├── test_twitter_helper.py
│       │   ├── test_twitter_tokens.py
│       │   └── test_webhooks.py
│       ├── jobs/
│       │   ├── __init__.py
│       │   ├── conftest.py
│       │   ├── test_resource_summary.py
│       │   └── test_scheduling_executor.py
│       ├── llms/
│       │   ├── __init__.py
│       │   ├── test_google_palm.py
│       │   ├── test_hugging_face.py
│       │   ├── test_model_factory.py
│       │   ├── test_open_ai.py
│       │   └── test_replicate.py
│       ├── models/
│       │   ├── __init__.py
│       │   ├── test_agent.py
│       │   ├── test_agent_execution.py
│       │   ├── test_agent_execution_config.py
│       │   ├── test_agent_execution_feed.py
│       │   ├── test_agent_schedule.py
│       │   ├── test_agent_template.py
│       │   ├── test_agent_workflow.py
│       │   ├── test_agent_workflow_step.py
│       │   ├── test_agent_workflow_step_tool.py
│       │   ├── test_api_key.py
│       │   ├── test_call_logs.py
│       │   ├── test_configuration.py
│       │   ├── test_events.py
│       │   ├── test_iteration_workflow.py
│       │   ├── test_iteration_workflow_step.py
│       │   ├── test_knowledge_configs.py
│       │   ├── test_marketplace_stats.py
│       │   ├── test_models.py
│       │   ├── test_models_config.py
│       │   ├── test_project.py
│       │   ├── test_tool.py
│       │   ├── test_tool_config.py
│       │   ├── test_toolkit.py
│       │   ├── test_vector_db_configs.py
│       │   ├── test_vector_db_indices.py
│       │   └── test_vector_dbs.py
│       ├── resource_manager/
│       │   ├── __init__.py
│       │   ├── test_file_manager.py
│       │   ├── test_llama_document_creation.py
│       │   ├── test_llama_vector_store_factory.py
│       │   └── test_save_document_to_vector_store.py
│       ├── test_migrations_multiheads.py
│       ├── test_tool_manager.py
│       ├── tools/
│       │   ├── __init__.py
│       │   ├── code/
│       │   │   ├── __init__.py
│       │   │   ├── test_improve_code.py
│       │   │   ├── test_write_code.py
│       │   │   ├── test_write_spec.py
│       │   │   └── test_write_test.py
│       │   ├── duck_duck_go/
│       │   │   ├── __init__.py
│       │   │   ├── test_duckduckgo_results.py
│       │   │   └── test_duckduckgo_toolkit.py
│       │   ├── email/
│       │   │   ├── __init__.py
│       │   │   ├── test_read_email.py
│       │   │   ├── test_send_email.py
│       │   │   └── test_send_email_attachment.py
│       │   ├── file/
│       │   │   ├── __init__.py
│       │   │   ├── test_list_files.py
│       │   │   └── test_read_file.py
│       │   ├── github/
│       │   │   ├── __init__.py
│       │   │   ├── test_add_file.py
│       │   │   ├── test_fetch_pull_request.py
│       │   │   ├── test_github_delete.py
│       │   │   └── test_review_pull_request.py
│       │   ├── image_generation/
│       │   │   ├── __init__.py
│       │   │   ├── test_dalle_image_gen.py
│       │   │   └── test_stable_diffusion_image_gen.py
│       │   ├── instagram_tool/
│       │   │   ├── __init__.py
│       │   │   ├── test_instagram_tool.py
│       │   │   └── test_instagram_toolkit.py
│       │   ├── jira/
│       │   │   ├── __init__.py
│       │   │   ├── test_create_issue.py
│       │   │   ├── test_edit_issue.py
│       │   │   ├── test_get_projects.py
│       │   │   └── test_search_issues.py
│       │   ├── knowledge_tool/
│       │   │   ├── __init__.py
│       │   │   └── test_knowledge_search.py
│       │   ├── searx/
│       │   │   ├── __init__.py
│       │   │   └── test_searx_toolkit.py
│       │   ├── test_search_repo.py
│       │   └── twitter/
│       │       └── test_send_tweets.py
│       ├── types/
│       │   ├── __init__.py
│       │   └── test_model_source_types.py
│       ├── vector_embeddings/
│       │   ├── __init__.py
│       │   └── test_vector_embedding_factory.py
│       └── vector_store/
│           ├── __init__.py
│           ├── test_chromadb.py
│           ├── test_redis.py
│           └── test_vector_factory.py
├── tgwui/
│   ├── DockerfileTGWUI
│   ├── config/
│   │   ├── loras/
│   │   │   └── place-your-loras-here.txt
│   │   ├── presets/
│   │   │   ├── Debug-deterministic.yaml
│   │   │   ├── Kobold-Godlike.yaml
│   │   │   ├── Kobold-Liminal Drift.yaml
│   │   │   ├── LLaMA-Precise.yaml
│   │   │   ├── Naive.yaml
│   │   │   ├── NovelAI-Best Guess.yaml
│   │   │   ├── NovelAI-Decadence.yaml
│   │   │   ├── NovelAI-Genesis.yaml
│   │   │   ├── NovelAI-Lycaenidae.yaml
│   │   │   ├── NovelAI-Ouroboros.yaml
│   │   │   ├── NovelAI-Pleasing Results.yaml
│   │   │   ├── NovelAI-Sphinx Moth.yaml
│   │   │   ├── NovelAI-Storywriter.yaml
│   │   │   ├── Special-Contrastive Search.yaml
│   │   │   └── Special-Eta Sampling.yaml
│   │   ├── prompts/
│   │   │   ├── Alpaca-with-Input.txt
│   │   │   ├── GPT-4chan.txt
│   │   │   └── QA.txt
│   │   └── training/
│   │       ├── datasets/
│   │       │   └── put-trainer-datasets-here.txt
│   │       └── formats/
│   │           ├── alpaca-chatbot-format.json
│   │           └── alpaca-format.json
│   └── scripts/
│       ├── build_extensions.sh
│       └── docker-entrypoint.sh
├── ui.py
└── wait-for-it.sh
Download .txt
SYMBOL INDEX (2048 symbols across 445 files)

FILE: cli2.py
  function check_command (line 11) | def check_command(command, message):
  function run_npm_commands (line 17) | def run_npm_commands(shell=False):
  function run_server (line 27) | def run_server(shell=False,a_name=None,a_description=None,goals=None):
  function cleanup (line 39) | def cleanup(api_process, ui_process, celery_process):

FILE: gui/app/layout.js
  function RootLayout (line 8) | function RootLayout({ children }) {

FILE: gui/pages/Content/APM/ApmDashboard.js
  function ApmDashboard (line 15) | function ApmDashboard() {

FILE: gui/pages/Content/Agents/ActionConsole.js
  function ActionBox (line 7) | function ActionBox({action, index, denied, reasons, handleDeny, handleSe...
  function HistoryBox (line 66) | function HistoryBox({action}) {
  function ActionConsole (line 101) | function ActionConsole({actions, pendingPermission, setPendingPermission...

FILE: gui/pages/Content/Agents/ActivityFeed.js
  function ActivityFeed (line 9) | function ActivityFeed({selectedRunId, selectedView, setFetchedData, agen...

FILE: gui/pages/Content/Agents/AgentCreate.js
  function AgentCreate (line 23) | function AgentCreate({

FILE: gui/pages/Content/Agents/AgentSchedule.js
  function AgentSchedule (line 12) | function AgentSchedule({

FILE: gui/pages/Content/Agents/AgentTemplatesList.js
  function AgentTemplatesList (line 8) | function AgentTemplatesList({

FILE: gui/pages/Content/Agents/AgentWorkspace.js
  function AgentWorkspace (line 28) | function AgentWorkspace({env, agentId, agentName, selectedView, agents, ...

FILE: gui/pages/Content/Agents/Agents.js
  function Agents (line 7) | function Agents({sendAgentData, agents}) {

FILE: gui/pages/Content/Agents/Details.js
  function Details (line 7) | function Details({agentDetails1, runCount, agentScheduleDetails, agent}) {

FILE: gui/pages/Content/Agents/ResourceList.js
  function ResourceList (line 6) | function ResourceList({files, channel, runs}) {

FILE: gui/pages/Content/Agents/ResourceManager.js
  function ResourceManager (line 10) | function ResourceManager({agentId, runs}) {

FILE: gui/pages/Content/Agents/RunHistory.js
  function RunHistory (line 7) | function RunHistory({runs, setHistory, selectedRunId, setSelectedRun, se...

FILE: gui/pages/Content/Agents/TaskQueue.js
  function TaskQueue (line 7) | function TaskQueue({selectedRunId}) {

FILE: gui/pages/Content/Knowledge/AddKnowledge.js
  function AddKnowledge (line 4) | function AddKnowledge({internalId, sendKnowledgeData}) {

FILE: gui/pages/Content/Knowledge/Knowledge.js
  function Knowledge (line 7) | function Knowledge({sendKnowledgeData, knowledge}) {

FILE: gui/pages/Content/Knowledge/KnowledgeDetails.js
  function KnowledgeDetails (line 12) | function KnowledgeDetails({internalId, knowledgeId}) {

FILE: gui/pages/Content/Knowledge/KnowledgeForm.js
  function KnowledgeForm (line 10) | function KnowledgeForm({

FILE: gui/pages/Content/Marketplace/AgentTemplate.js
  function AgentTemplate (line 13) | function AgentTemplate({template, env}) {

FILE: gui/pages/Content/Marketplace/KnowledgeTemplate.js
  function KnowledgeTemplate (line 19) | function KnowledgeTemplate({template, env}) {

FILE: gui/pages/Content/Marketplace/Market.js
  function Market (line 15) | function Market({env, getModels, sendModelData}) {

FILE: gui/pages/Content/Marketplace/MarketAgent.js
  function MarketAgent (line 8) | function MarketAgent() {

FILE: gui/pages/Content/Marketplace/MarketKnowledge.js
  function MarketKnowledge (line 10) | function MarketKnowledge() {

FILE: gui/pages/Content/Marketplace/MarketTools.js
  function MarketTools (line 8) | function MarketTools() {

FILE: gui/pages/Content/Marketplace/MarketplacePublic.js
  function MarketplacePublic (line 6) | function MarketplacePublic({env}) {

FILE: gui/pages/Content/Marketplace/ToolkitTemplate.js
  function ToolkitTemplate (line 19) | function ToolkitTemplate({template, env}) {

FILE: gui/pages/Content/Models/AddModel.js
  function AddModel (line 4) | function AddModel({internalId, getModels, sendModelData, env}){

FILE: gui/pages/Content/Models/AddModelMarketPlace.js
  function AddModelMarketPlace (line 7) | function AddModelMarketPlace({ template, getModels, sendModelData }){

FILE: gui/pages/Content/Models/MarketModels.js
  function MarketModels (line 9) | function MarketModels(){

FILE: gui/pages/Content/Models/ModelDetails.js
  function ModelDetails (line 8) | function ModelDetails({modelId, modelName}){

FILE: gui/pages/Content/Models/ModelForm.js
  function ModelForm (line 8) | function ModelForm({internalId, getModels, sendModelData, env}){

FILE: gui/pages/Content/Models/ModelInfo.js
  function ModelInfo (line 4) | function ModelInfo(modelDetails){

FILE: gui/pages/Content/Models/ModelMetrics.js
  function ModelMetrics (line 6) | function ModelMetrics(modelDetails) {

FILE: gui/pages/Content/Models/ModelTemplate.js
  function ModelTemplate (line 6) | function ModelTemplate({env, template, getModels, sendModelData}){

FILE: gui/pages/Content/Models/Models.js
  function Models (line 5) | function Models({sendModelData, models}){

FILE: gui/pages/Content/Toolkits/AddTool.js
  function AddTool (line 6) | function AddTool({internalId}) {

FILE: gui/pages/Content/Toolkits/Metrics.js
  function Metrics (line 11) | function Metrics({toolName, knowledgeName}) {

FILE: gui/pages/Content/Toolkits/ToolkitWorkspace.js
  function ToolkitWorkspace (line 14) | function ToolkitWorkspace({env, toolkitDetails, internalId}) {

FILE: gui/pages/Content/Toolkits/Toolkits.js
  function Toolkits (line 5) | function Toolkits({sendToolkitData, toolkits, env}) {

FILE: gui/pages/Dashboard/Content.js
  function Content (line 37) | function Content({env, selectedView, selectedProjectId, organisationId}) {

FILE: gui/pages/Dashboard/Settings/AddDatabase.js
  function AddDatabase (line 18) | function AddDatabase({internalId, sendDatabaseDetailsData}) {

FILE: gui/pages/Dashboard/Settings/ApiKeys.js
  function ApiKeys (line 15) | function ApiKeys() {

FILE: gui/pages/Dashboard/Settings/Database.js
  function Database (line 11) | function Database({sendDatabaseData}) {

FILE: gui/pages/Dashboard/Settings/DatabaseDetails.js
  function DatabaseDetails (line 11) | function DatabaseDetails({internalId, databaseId}) {

FILE: gui/pages/Dashboard/Settings/Model.js
  function Model (line 10) | function Model({organisationId}) {

FILE: gui/pages/Dashboard/Settings/Settings.js
  function Settings (line 10) | function Settings({organisationId, sendDatabaseData}) {

FILE: gui/pages/Dashboard/Settings/Webhooks.js
  function Webhooks (line 11) | function Webhooks() {

FILE: gui/pages/Dashboard/SideBar.js
  function SideBar (line 6) | function SideBar({onSelectEvent, env}) {

FILE: gui/pages/Dashboard/TopBar.js
  function TopBar (line 10) | function TopBar({selectedProject, userName, env}) {

FILE: gui/pages/_app.js
  function App (line 31) | function App() {

FILE: gui/pages/api/apiConfig.js
  constant GITHUB_CLIENT_ID (line 4) | const GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID;
  constant API_BASE_URL (line 5) | const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://loc...
  constant GOOGLE_ANALYTICS_MEASUREMENT_ID (line 6) | const GOOGLE_ANALYTICS_MEASUREMENT_ID =  process.env.GOOGLE_ANALYTICS_ME...
  constant GOOGLE_ANALYTICS_API_SECRET (line 7) | const GOOGLE_ANALYTICS_API_SECRET =  process.env.GOOGLE_ANALYTICS_API_SE...
  constant MIXPANEL_AUTH_ID (line 8) | const MIXPANEL_AUTH_ID = process.env.NEXT_PUBLIC_MIXPANEL_AUTH_ID

FILE: main.py
  class Settings (line 141) | class Settings(BaseModel):
  function create_access_token (line 146) | def create_access_token(email, Authorize: AuthJWT = Depends()):
  function get_config (line 159) | def get_config():
  function authjwt_exception_handler (line 166) | def authjwt_exception_handler(request: Request, exc: AuthJWTException):
  function replace_old_iteration_workflows (line 173) | def replace_old_iteration_workflows(session):
  function startup_event (line 195) | async def startup_event():
  function login (line 251) | def login(request: LoginRequest, Authorize: AuthJWT = Depends()):
  function github_login (line 270) | def github_login():
  function github_auth_handler (line 278) | def github_auth_handler(code: str = Query(...), Authorize: AuthJWT = Dep...
  function user (line 329) | def user(Authorize: AuthJWT = Depends()):
  function root (line 338) | async def root(Authorize: AuthJWT = Depends()):
  function validate_llm_api_key (line 351) | async def validate_llm_api_key(request: ValidateAPIKeyRequest, Authorize...
  function root (line 364) | async def root(open_ai_key: str, Authorize: AuthJWT = Depends()):
  function say_hello (line 376) | async def say_hello(name: str, Authorize: AuthJWT = Depends()):
  function github_client_id (line 381) | def github_client_id():

FILE: migrations/env.py
  function run_migrations_offline (line 37) | def run_migrations_offline() -> None:
  function run_migrations_online (line 74) | def run_migrations_online() -> None:

FILE: migrations/versions/1d54db311055_add_permissions.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 41) | def downgrade() -> None:

FILE: migrations/versions/2cc1179834b0_agent_executions_modified.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 26) | def downgrade() -> None:

FILE: migrations/versions/2f97c068fab9_resource_modified.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 26) | def downgrade() -> None:

FILE: migrations/versions/2fbd6472112c_add_feed_group_id_to_execution_and_feed.py
  function upgrade (line 18) | def upgrade() -> None:
  function downgrade (line 24) | def downgrade() -> None:

FILE: migrations/versions/3356a2f89a33_added_configurations_table.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 37) | def downgrade() -> None:

FILE: migrations/versions/35e47f20475b_renamed_tokens_calls.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 28) | def downgrade() -> None:

FILE: migrations/versions/3867bb00a495_added_first_login_source.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 25) | def downgrade() -> None:

FILE: migrations/versions/40affbf3022b_add_filter_colume_in_webhooks.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 25) | def downgrade() -> None:

FILE: migrations/versions/446884dcae58_add_api_key_and_web_hook.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 58) | def downgrade() -> None:

FILE: migrations/versions/44b0d6f2d1b3_init_models.py
  function upgrade (line 24) | def upgrade() -> None:
  function downgrade (line 132) | def downgrade() -> None:

FILE: migrations/versions/467e85d5e1cd_updated_resources_added_exec_id.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 25) | def downgrade() -> None:

FILE: migrations/versions/516ecc1c723d_adding_marketplace_template_id_to_agent_.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 23) | def downgrade() -> None:

FILE: migrations/versions/5184645e9f12_add_question_to_agent_execution_.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 23) | def downgrade() -> None:

FILE: migrations/versions/520aa6776347_create_models_config.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 33) | def downgrade() -> None:

FILE: migrations/versions/598cfb37292a_adding_agent_templates.py
  function upgrade (line 18) | def upgrade() -> None:
  function downgrade (line 55) | def downgrade() -> None:

FILE: migrations/versions/5d5f801f28e7_create_model_table.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 39) | def downgrade() -> None:

FILE: migrations/versions/661ec8a4c32e_open_ai_error_handling.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 26) | def downgrade() -> None:

FILE: migrations/versions/71e3980d55f5_knowledge_and_vector_dbs.py
  function upgrade (line 18) | def upgrade() -> None:
  function downgrade (line 81) | def downgrade() -> None:

FILE: migrations/versions/7a3e336c0fba_added_tools_related_models.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 41) | def downgrade() -> None:

FILE: migrations/versions/83424de1347e_added_agent_execution_config.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 33) | def downgrade() -> None:

FILE: migrations/versions/8962bed0d809_creating_agent_templates.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 46) | def downgrade() -> None:

FILE: migrations/versions/9270eb5a8475_local_llms.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 25) | def downgrade() -> None:

FILE: migrations/versions/9419b3340af7_create_agent_workflow.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 56) | def downgrade() -> None:

FILE: migrations/versions/a91808a89623_added_resources.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 39) | def downgrade() -> None:

FILE: migrations/versions/ba60b12ae109_create_agent_scheduler.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 41) | def downgrade() -> None:

FILE: migrations/versions/be1d922bf2ad_create_call_logs_table.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 36) | def downgrade() -> None:

FILE: migrations/versions/c02f3d759bf3_add_summary_to_resource.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 25) | def downgrade() -> None:

FILE: migrations/versions/c4f2f6ba602a_agent_workflow_wait_step.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 36) | def downgrade() -> None:

FILE: migrations/versions/c5c19944c90c_create_oauth_tokens.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 40) | def downgrade() -> None:

FILE: migrations/versions/cac478732572_delete_agent_feature.py
  function upgrade (line 18) | def upgrade() -> None:
  function downgrade (line 22) | def downgrade() -> None:

FILE: migrations/versions/d8315244ea43_updated_tool_configs.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 27) | def downgrade() -> None:

FILE: migrations/versions/d9b3436197eb_renaming_templates.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 28) | def downgrade() -> None:

FILE: migrations/versions/e39295ec089c_creating_events.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 37) | def downgrade() -> None:

FILE: migrations/versions/fe234ea6e9bc_modify_agent_workflow_tables.py
  function upgrade (line 19) | def upgrade() -> None:
  function downgrade (line 35) | def downgrade() -> None:

FILE: run_gui.py
  function check_command (line 8) | def check_command(command, message):
  function run_npm_commands (line 13) | def run_npm_commands():
  function run_server (line 22) | def run_server():
  function cleanup (line 29) | def cleanup(api_process, ui_process):

FILE: superagi/agent/agent_iteration_step_handler.py
  class AgentIterationStepHandler (line 35) | class AgentIterationStepHandler:
    method __init__ (line 37) | def __init__(self, session, llm, agent_id: int, agent_execution_id: in...
    method execute_step (line 46) | def execute_step(self):
    method _update_agent_execution_next_step (line 123) | def _update_agent_execution_next_step(self, execution, next_step_id, s...
    method _build_agent_prompt (line 135) | def _build_agent_prompt(self, iteration_workflow: IterationWorkflow, a...
    method _build_tools (line 153) | def _build_tools(self, agent_config: dict, agent_execution_config: dict):
    method _handle_wait_for_permission (line 170) | def _handle_wait_for_permission(self, agent_execution, agent_config: d...

FILE: superagi/agent/agent_message_builder.py
  class AgentLlmMessageBuilder (line 16) | class AgentLlmMessageBuilder:
    method __init__ (line 18) | def __init__(self, session, llm, llm_model: str, agent_id: int, agent_...
    method build_agent_messages (line 26) | def build_agent_messages(self, prompt: str, agent_feeds: list, history...
    method _split_history (line 59) | def _split_history(self, history: List, pending_token_limit: int) -> T...
    method _add_initial_feeds (line 72) | def _add_initial_feeds(self, agent_feeds: list, messages: list):
    method _add_or_update_last_agent_feed_ltm_summary_id (line 84) | def _add_or_update_last_agent_feed_ltm_summary_id(self, last_agent_fee...
    method _build_ltm_summary (line 91) | def _build_ltm_summary(self, past_messages, output_token_limit) -> str:
    method _build_prompt_for_ltm_summary (line 136) | def _build_prompt_for_ltm_summary(self, past_messages: List[BaseMessag...
    method _build_prompt_for_recursive_ltm_summary_using_previous_ltm_summary (line 148) | def _build_prompt_for_recursive_ltm_summary_using_previous_ltm_summary...

FILE: superagi/agent/agent_prompt_builder.py
  class AgentPromptBuilder (line 12) | class AgentPromptBuilder:
    method add_list_items_to_string (line 16) | def add_list_items_to_string(items: List[str]) -> str:
    method add_tools_to_prompt (line 24) | def add_tools_to_prompt(cls, tools: List[BaseTool], add_finish: bool =...
    method _generate_tool_string (line 54) | def _generate_tool_string(cls, tool: BaseTool) -> str:
    method clean_prompt (line 61) | def clean_prompt(cls, prompt):
    method replace_main_variables (line 66) | def replace_main_variables(cls, super_agi_prompt: str, goals: List[str...
    method replace_task_based_variables (line 96) | def replace_task_based_variables(cls, super_agi_prompt: str, current_t...

FILE: superagi/agent/agent_prompt_template.py
  class AgentPromptTemplate (line 10) | class AgentPromptTemplate:
    method add_list_items_to_string (line 13) | def add_list_items_to_string(items: List[str]) -> str:
    method clean_prompt (line 20) | def clean_prompt(cls, prompt):
    method get_super_agi_single_prompt (line 25) | def get_super_agi_single_prompt(cls):
    method start_task_based (line 31) | def start_task_based(cls):
    method analyse_task (line 38) | def analyse_task(cls):
    method create_tasks (line 48) | def create_tasks(cls):
    method prioritize_tasks (line 55) | def prioritize_tasks(cls):

FILE: superagi/agent/agent_tool_step_handler.py
  class AgentToolStepHandler (line 28) | class AgentToolStepHandler:
    method __init__ (line 30) | def __init__(self, session, llm, agent_id: int, agent_execution_id: in...
    method execute_step (line 39) | def execute_step(self):
    method _create_permission_request (line 74) | def _create_permission_request(self, execution, step_tool: AgentWorkfl...
    method _handle_next_step (line 89) | def _handle_next_step(self, next_step):
    method _process_input_instruction (line 98) | def _process_input_instruction(self, agent_config, agent_execution_con...
    method _build_tool_obj (line 120) | def _build_tool_obj(self, agent_config, agent_execution_config, tool_n...
    method _process_output_instruction (line 137) | def _process_output_instruction(self, final_response: str, step_tool: ...
    method _build_tool_input_prompt (line 156) | def _build_tool_input_prompt(self, step_tool: AgentWorkflowStepTool, t...
    method _get_step_responses (line 167) | def _get_step_responses(self, workflow_step: AgentWorkflowStep):
    method _build_tool_output_prompt (line 170) | def _build_tool_output_prompt(self, step_tool: AgentWorkflowStepTool, ...
    method _handle_wait_for_permission (line 183) | def _handle_wait_for_permission(self, agent_execution, workflow_step: ...

FILE: superagi/agent/agent_workflow_step_wait_handler.py
  class AgentWaitStepHandler (line 10) | class AgentWaitStepHandler:
    method __init__ (line 13) | def __init__(self, session, agent_id, agent_execution_id):
    method execute_step (line 18) | def execute_step(self):
    method handle_next_step (line 32) | def handle_next_step(self):

FILE: superagi/agent/common_types.py
  class ToolExecutorResponse (line 4) | class ToolExecutorResponse(BaseModel):
  class TaskExecutorResponse (line 12) | class TaskExecutorResponse(BaseModel):

FILE: superagi/agent/output_handler.py
  class ToolOutputHandler (line 18) | class ToolOutputHandler:
    method __init__ (line 20) | def __init__(self,
    method handle (line 33) | def handle(self, session, assistant_reply):
    method add_text_to_memory (line 68) | def add_text_to_memory(self, assistant_reply,tool_response_result):
    method handle_tool_response (line 98) | def handle_tool_response(self, session, assistant_reply):
    method _check_permission_in_restricted_mode (line 106) | def _check_permission_in_restricted_mode(self, session, assistant_repl...
    method _check_for_completion (line 127) | def _check_for_completion(self, tool_response):
  class TaskOutputHandler (line 137) | class TaskOutputHandler:
    method __init__ (line 142) | def __init__(self, agent_execution_id: int, agent_config: dict):
    method handle (line 147) | def handle(self, session, assistant_reply):
  class ReplaceTaskOutputHandler (line 168) | class ReplaceTaskOutputHandler:
    method __init__ (line 173) | def __init__(self, agent_execution_id: int, agent_config: dict):
    method handle (line 178) | def handle(self, session, assistant_reply):
  function get_output_handler (line 191) | def get_output_handler(output_type: str, agent_execution_id: int, agent_...

FILE: superagi/agent/output_parser.py
  class AgentGPTAction (line 11) | class AgentGPTAction(NamedTuple):
  class AgentTasks (line 16) | class AgentTasks(NamedTuple):
  class BaseOutputParser (line 21) | class BaseOutputParser(ABC):
    method parse (line 23) | def parse(self, text: str) -> AgentGPTAction:
  class AgentSchemaOutputParser (line 27) | class AgentSchemaOutputParser(BaseOutputParser):
    method parse (line 29) | def parse(self, response: str) -> AgentGPTAction:
  class AgentSchemaToolOutputParser (line 50) | class AgentSchemaToolOutputParser(BaseOutputParser):
    method parse (line 52) | def parse(self, response: str) -> AgentGPTAction:

FILE: superagi/agent/queue_step_handler.py
  class QueueStepHandler (line 20) | class QueueStepHandler:
    method __init__ (line 22) | def __init__(self, session, llm, agent_id: int, agent_execution_id: int):
    method _queue_identifier (line 29) | def _queue_identifier(self, step_tool):
    method _build_task_queue (line 32) | def _build_task_queue(self, step_tool):
    method execute_step (line 35) | def execute_step(self):
    method _add_to_queue (line 55) | def _add_to_queue(self, task_queue: TaskQueue, step_tool: AgentWorkflo...
    method _consume_from_queue (line 59) | def _consume_from_queue(self, task_queue: TaskQueue):
    method _process_reply (line 76) | def _process_reply(self, task_queue: TaskQueue, assistant_reply: str):
    method _process_input_instruction (line 84) | def _process_input_instruction(self, step_tool):
    method _build_queue_input_prompt (line 105) | def _build_queue_input_prompt(self, step_tool: AgentWorkflowStepTool):

FILE: superagi/agent/task_queue.py
  class TaskQueue (line 9) | class TaskQueue:
    method __init__ (line 10) | def __init__(self, queue_name: str):
    method add_task (line 15) | def add_task(self, task: str):
    method complete_task (line 19) | def complete_task(self, response):
    method get_first_task (line 25) | def get_first_task(self):
    method get_tasks (line 28) | def get_tasks(self):
    method get_completed_tasks (line 31) | def get_completed_tasks(self):
    method clear_tasks (line 35) | def clear_tasks(self):
    method get_last_task_details (line 38) | def get_last_task_details(self):
    method set_status (line 45) | def set_status(self, status):
    method get_status (line 48) | def get_status(self):

FILE: superagi/agent/tool_builder.py
  class DBToolkitConfiguration (line 13) | class DBToolkitConfiguration(BaseToolkitConfiguration):
    method __init__ (line 17) | def __init__(self, session=None, toolkit_id=None):
    method get_tool_config (line 21) | def get_tool_config(self, key: str):
  class ToolBuilder (line 30) | class ToolBuilder:
    method __init__ (line 31) | def __init__(self, session, agent_id: int, agent_execution_id: int = N...
    method __validate_filename (line 36) | def __validate_filename(self, filename):
    method build_tool (line 50) | def build_tool(self, tool: Tool):
    method set_default_params_tool (line 84) | def set_default_params_tool(self, tool, agent_config, agent_execution_...

FILE: superagi/agent/tool_executor.py
  class ToolExecutor (line 8) | class ToolExecutor:
    method __init__ (line 12) | def __init__(self, organisation_id: int, agent_id: int, tools: list, a...
    method execute (line 18) | def execute(self, session, tool_name, tool_args):
    method clean_tool_args (line 67) | def clean_tool_args(self, args):

FILE: superagi/agent/types/agent_execution_status.py
  class AgentExecutionStatus (line 4) | class AgentExecutionStatus(Enum):
    method get_agent_execution_status (line 12) | def get_agent_execution_status(cls, store):

FILE: superagi/agent/types/agent_workflow_step_action_types.py
  class AgentWorkflowStepAction (line 4) | class AgentWorkflowStepAction(Enum):
    method get_agent_workflow_action_type (line 11) | def get_agent_workflow_action_type(cls, store):

FILE: superagi/agent/types/wait_step_status.py
  class AgentWorkflowStepWaitStatus (line 4) | class AgentWorkflowStepWaitStatus(Enum):
    method get_agent_workflow_step_wait_status (line 10) | def get_agent_workflow_step_wait_status(cls, store):

FILE: superagi/agent/workflow_seed.py
  class AgentWorkflowSeed (line 29) | class AgentWorkflowSeed:
    method build_sales_workflow (line 31) | def build_sales_workflow(cls, session):
    method build_recruitment_workflow (line 109) | def build_recruitment_workflow(cls, session):
    method build_coding_workflow (line 151) | def build_coding_workflow(cls, session):
    method build_goal_based_agent (line 183) | def build_goal_based_agent(cls, session):
    method build_task_based_agent (line 192) | def build_task_based_agent(cls, session):
    method build_fixed_task_based_agent (line 205) | def build_fixed_task_based_agent(cls, session):
  class IterationWorkflowSeed (line 218) | class IterationWorkflowSeed:
    method build_single_step_agent (line 220) | def build_single_step_agent(cls, session):
    method build_task_based_agents (line 230) | def build_task_based_agents(cls, session):
    method build_initialize_task_workflow (line 255) | def build_initialize_task_workflow(cls, session):
    method build_action_based_agents (line 264) | def build_action_based_agents(cls, session):

FILE: superagi/apm/analytics_helper.py
  class AnalyticsHelper (line 8) | class AnalyticsHelper:
    method __init__ (line 10) | def __init__(self, session: Session, organisation_id: int):
    method calculate_run_completed_metrics (line 14) | def calculate_run_completed_metrics(self) -> Dict[str, Dict[str, Union...
    method fetch_agent_data (line 57) | def fetch_agent_data(self) -> Dict[str, List[Dict[str, Any]]]:
    method fetch_agent_runs (line 123) | def fetch_agent_runs(self, agent_id: int) -> List[Dict[str, int]]:
    method get_active_runs (line 159) | def get_active_runs(self) -> List[Dict[str, str]]:

FILE: superagi/apm/call_log_helper.py
  class CallLogHelper (line 11) | class CallLogHelper:
    method __init__ (line 13) | def __init__(self, session: Session, organisation_id: int):
    method create_call_log (line 17) | def create_call_log(self, agent_execution_name: str, agent_id: int, to...
    method fetch_data (line 34) | def fetch_data(self, model: str):

FILE: superagi/apm/event_handler.py
  class EventHandler (line 8) | class EventHandler:
    method __init__ (line 10) | def __init__(self, session: Session):
    method create_event (line 13) | def create_event(self, event_name: str, event_property: Dict, agent_id...

FILE: superagi/apm/knowledge_handler.py
  class KnowledgeHandler (line 15) | class KnowledgeHandler:
    method __init__ (line 16) | def __init__(self, session: Session, organisation_id: int):
    method get_knowledge_usage_by_name (line 21) | def get_knowledge_usage_by_name(self, knowledge_name: str) -> Dict[str...
    method get_knowledge_events_by_name (line 61) | def get_knowledge_events_by_name(self, knowledge_name: str) -> List[Di...

FILE: superagi/apm/tools_handler.py
  class ToolsHandler (line 16) | class ToolsHandler:
    method __init__ (line 17) | def __init__(self, session: Session, organisation_id: int):
    method get_tool_and_toolkit (line 21) | def get_tool_and_toolkit(self):
    method calculate_tool_usage (line 28) | def calculate_tool_usage(self) -> List[Dict[str, int]]:
    method get_tool_usage_by_name (line 66) | def get_tool_usage_by_name(self, tool_name: str) -> Dict[str, Dict[str...
    method get_tool_events_by_name (line 100) | def get_tool_events_by_name(self, tool_name: str) -> List[Dict[str, Un...

FILE: superagi/config/config.py
  class Config (line 10) | class Config(BaseSettings):
    class Config (line 11) | class Config:
    method load_config (line 16) | def load_config(cls, config_file: str) -> dict:
    method __init__ (line 38) | def __init__(self, config_file: str, **kwargs):
    method get_config (line 42) | def get_config(self, key: str, default: str = None) -> str:
  function get_config (line 50) | def get_config(key: str, default: str = None) -> str:

FILE: superagi/controllers/agent.py
  class AgentOut (line 39) | class AgentOut(BaseModel):
    class Config (line 47) | class Config:
  class AgentIn (line 51) | class AgentIn(BaseModel):
    class Config (line 56) | class Config:
  function create_agent_with_config (line 61) | def create_agent_with_config(agent_with_config: AgentConfigInput,
  function create_and_schedule_agent (line 168) | def create_and_schedule_agent(agent_config_schedule: AgentConfigSchedule,
  function stop_schedule (line 239) | def stop_schedule(agent_id: int, Authorize: AuthJWT = Depends(check_auth)):
  function edit_schedule (line 260) | def edit_schedule(schedule: AgentScheduleInput,
  function get_schedule_data (line 290) | def get_schedule_data(agent_id: int, Authorize: AuthJWT = Depends(check_...
  function get_agents_by_project_id (line 333) | def get_agents_by_project_id(project_id: int,
  function delete_agent (line 384) | def delete_agent(agent_id: int, Authorize: AuthJWT = Depends(check_auth)):

FILE: superagi/controllers/agent_execution.py
  class AgentExecutionOut (line 32) | class AgentExecutionOut(BaseModel):
    class Config (line 45) | class Config:
  class AgentExecutionIn (line 48) | class AgentExecutionIn(BaseModel):
    class config (line 60) | class config:
  function create_agent_execution (line 66) | def create_agent_execution(agent_execution: AgentExecutionIn,
  function create_agent_run (line 153) | def create_agent_run(agent_execution: AgentRunIn, Authorize: AuthJWT = D...
  function schedule_existing_agent (line 235) | def schedule_existing_agent(agent_schedule: AgentScheduleInput,
  function get_agent_execution (line 297) | def get_agent_execution(agent_execution_id: int,
  function update_agent_execution (line 323) | def update_agent_execution(agent_execution_id: int,
  function agent_list_by_status (line 360) | def agent_list_by_status(status: str,
  function list_running_agents (line 371) | def list_running_agents(agent_id: str,
  function get_agent_by_latest_execution (line 383) | def get_agent_by_latest_execution(project_id: int,

FILE: superagi/controllers/agent_execution_config.py
  function get_agent_execution_configuration (line 24) | def get_agent_execution_configuration(agent_id : Union[int, None, str],

FILE: superagi/controllers/agent_execution_feed.py
  class AgentExecutionFeedOut (line 32) | class AgentExecutionFeedOut(BaseModel):
    class Config (line 42) | class Config:
  class AgentExecutionFeedIn (line 46) | class AgentExecutionFeedIn(BaseModel):
    class Config (line 54) | class Config:
  function create_agent_execution_feed (line 59) | def create_agent_execution_feed(agent_execution_feed: AgentExecutionFeedIn,
  function get_agent_execution_feed (line 89) | def get_agent_execution_feed(agent_execution_feed_id: int,
  function update_agent_execution_feed (line 112) | def update_agent_execution_feed(agent_execution_feed_id: int,
  function get_agent_execution_feed (line 152) | def get_agent_execution_feed(agent_execution_id: int,
  function get_execution_tasks (line 222) | def get_execution_tasks(agent_execution_id: int,

FILE: superagi/controllers/agent_execution_permission.py
  class AgentExecutionPermissionOut (line 20) | class AgentExecutionPermissionOut(BaseModel):
    class Config (line 31) | class Config:
  class AgentExecutionPermissionIn (line 35) | class AgentExecutionPermissionIn(BaseModel):
    class Config (line 43) | class Config:
  function get_agent_execution_permission (line 48) | def get_agent_execution_permission(agent_execution_permission_id: int,
  function create_agent_execution_permission (line 71) | def create_agent_execution_permission(
  function update_agent_execution_permission (line 92) | def update_agent_execution_permission(agent_execution_permission_id: int,
  function update_agent_execution_permission_status (line 125) | def update_agent_execution_permission_status(agent_execution_permission_...

FILE: superagi/controllers/agent_template.py
  class AgentTemplateOut (line 27) | class AgentTemplateOut(BaseModel):
    class Config (line 37) | class Config:
  class AgentTemplateIn (line 41) | class AgentTemplateIn(BaseModel):
    class Config (line 48) | class Config:
  function get_agent_template (line 53) | def get_agent_template(template_source, agent_template_id: int, organisa...
  function edit_agent_template (line 90) | def edit_agent_template(agent_template_id: int,
  function save_agent_as_template (line 199) | def save_agent_as_template(agent_execution_id: str,
  function list_agent_templates (line 261) | def list_agent_templates(template_source="local", search_str="", page=0,...
  function list_marketplace_templates (line 298) | def list_marketplace_templates(page=0):
  function marketplace_template_detail (line 322) | def marketplace_template_detail(agent_template_id):
  function download_template (line 357) | def download_template(agent_template_id: int,
  function fetch_agent_config_from_template (line 374) | def fetch_agent_config_from_template(agent_template_id: int,
  function publish_template (line 421) | def publish_template(agent_execution_id: str, organisation=Depends(get_u...
  function handle_publish_template (line 482) | def handle_publish_template(updated_details: AgentPublish, organisation=...

FILE: superagi/controllers/agent_workflow.py
  function list_workflows (line 12) | def list_workflows(organisation=Depends(get_user_organisation)):

FILE: superagi/controllers/analytics.py
  function get_metrics (line 14) | def get_metrics(organisation=Depends(get_user_organisation)):
  function get_agents (line 30) | def get_agents(organisation=Depends(get_user_organisation)):
  function get_agent_runs (line 39) | def get_agent_runs(agent_id: int, organisation=Depends(get_user_organisa...
  function get_active_runs (line 48) | def get_active_runs(organisation=Depends(get_user_organisation)):
  function get_tools_used (line 57) | def get_tools_used(organisation=Depends(get_user_organisation)):
  function get_tool_usage (line 66) | def get_tool_usage(tool_name: str, organisation=Depends(get_user_organis...
  function get_knowledge_usage (line 77) | def get_knowledge_usage(knowledge_name:str, organisation=Depends(get_use...
  function get_tool_logs (line 88) | def get_tool_logs(tool_name: str, organisation=Depends(get_user_organisa...
  function get_knowledge_logs (line 99) | def get_knowledge_logs(knowledge_name: str, organisation=Depends(get_use...

FILE: superagi/controllers/api/agent.py
  class AgentExecutionIn (line 29) | class AgentExecutionIn(BaseModel):
    class Config (line 34) | class Config:
  class RunFilterConfigIn (line 37) | class RunFilterConfigIn(BaseModel):
    class Config (line 41) | class Config:
  class ExecutionStateChangeConfigIn (line 44) | class ExecutionStateChangeConfigIn(BaseModel):
    class Config (line 47) | class Config:
  class RunIDConfig (line 50) | class RunIDConfig(BaseModel):
    class Config (line 53) | class Config:
  function create_agent_with_config (line 57) | def create_agent_with_config(agent_with_config: AgentConfigExtInput,
  function create_run (line 121) | def create_run(agent_id:int,agent_execution: AgentExecutionIn,api_key: s...
  function update_agent (line 183) | def update_agent(agent_id: int, agent_with_config: AgentConfigUpdateExtI...
  function get_agent_runs (line 257) | def get_agent_runs(agent_id:int,filter_config:RunFilterConfigIn,api_key:...
  function pause_agent_runs (line 280) | def pause_agent_runs(agent_id:int,execution_state_change_input:Execution...
  function resume_agent_runs (line 311) | def resume_agent_runs(agent_id:int,execution_state_change_input:Executio...
  function get_run_resources (line 344) | def get_run_resources(run_id_config:RunIDConfig,api_key: str = Security(...

FILE: superagi/controllers/api_key.py
  class ApiKeyIn (line 16) | class ApiKeyIn(BaseModel):
    class Config (line 20) | class Config:
  class ApiKeyDeleteIn (line 24) | class ApiKeyDeleteIn(BaseModel):
    class Config (line 27) | class Config:
  function create_api_key (line 32) | def create_api_key(name: Annotated[str, Body(embed=True)], Authorize: Au...
  function validate_api_key (line 43) | def validate_api_key(api_key: str = Depends(validate_api_key)):
  function get_all (line 48) | def get_all(Authorize: AuthJWT = Depends(check_auth), organisation=Depen...
  function delete_api_key (line 54) | def delete_api_key(api_key_id: int, Authorize: AuthJWT = Depends(check_a...
  function edit_api_key (line 63) | def edit_api_key(api_key_in: ApiKeyIn, Authorize: AuthJWT = Depends(chec...

FILE: superagi/controllers/budget.py
  class BudgetOut (line 14) | class BudgetOut(BaseModel):
    class Config (line 19) | class Config:
  class BudgetIn (line 23) | class BudgetIn(BaseModel):
    class Config (line 27) | class Config:
  function create_budget (line 31) | def create_budget(budget: BudgetIn,
  function get_budget (line 55) | def get_budget(budget_id: int,
  function update_budget (line 75) | def update_budget(budget_id: int, budget: BudgetIn,

FILE: superagi/controllers/config.py
  class ConfigurationOut (line 22) | class ConfigurationOut(BaseModel):
    class Config (line 30) | class Config:
  class ConfigurationIn (line 34) | class ConfigurationIn(BaseModel):
    class Config (line 39) | class Config:
  function create_config (line 45) | def create_config(config: ConfigurationIn, organisation_id: int,
  function get_config_by_organisation_id_and_key (line 91) | def get_config_by_organisation_id_and_key(organisation_id: int, key: str,
  function get_config_by_organisation_id (line 126) | def get_config_by_organisation_id(organisation_id: int,
  function current_env (line 156) | def current_env():

FILE: superagi/controllers/google_oauth.py
  function google_auth_calendar (line 25) | async def google_auth_calendar(code: str = Query(...), state: str = Quer...
  function send_google_calendar_configs (line 67) | def send_google_calendar_configs(google_creds: dict, toolkit_id: int, Au...
  function get_google_calendar_tool_configs (line 85) | def get_google_calendar_tool_configs(toolkit_id: int):

FILE: superagi/controllers/knowledge_configs.py
  function get_marketplace_knowledge_configs (line 12) | def get_marketplace_knowledge_configs(knowledge_id: int):

FILE: superagi/controllers/knowledges.py
  function get_knowledge_list (line 21) | def get_knowledge_list(
  function get_marketplace_knowledge_list (line 44) | def get_marketplace_knowledge_list(page: int = 0):
  function get_user_knowledge_list (line 59) | def get_user_knowledge_list(organisation = Depends(get_user_organisation)):
  function get_knowledge_details (line 70) | def get_knowledge_details(knowledge_name: str):
  function get_marketplace_knowledge_details (line 81) | def get_marketplace_knowledge_details(knowledge_name: str):
  function get_user_knowledge_details (line 87) | def get_user_knowledge_details(knowledge_id: int):
  function add_update_user_knowledge (line 106) | def add_update_user_knowledge(knowledge_data: dict, organisation = Depen...
  function delete_user_knowledge (line 116) | def delete_user_knowledge(knowledge_id: int):
  function install_selected_knowledge (line 123) | def install_selected_knowledge(knowledge_name: str, vector_db_index_id: ...
  function uninstall_selected_knowledge (line 154) | def uninstall_selected_knowledge(knowledge_name: str, organisation = Dep...

FILE: superagi/controllers/marketplace_stats.py
  function count_knowledge_downloads (line 11) | def count_knowledge_downloads(knowledge_id: int):

FILE: superagi/controllers/models_controller.py
  class ValidateAPIKeyRequest (line 19) | class ValidateAPIKeyRequest(BaseModel):
  class StoreModelRequest (line 24) | class StoreModelRequest(BaseModel):
  class ModelName (line 34) | class ModelName (BaseModel):
  function store_api_keys (line 38) | async def store_api_keys(request: ValidateAPIKeyRequest, organisation=De...
  function get_api_keys (line 47) | async def get_api_keys(organisation=Depends(get_user_organisation)):
  function get_api_key (line 56) | async def get_api_key(model_provider: str = None, organisation=Depends(g...
  function verify_end_point (line 65) | async def verify_end_point(model_api_key: str = None, end_point: str = N...
  function store_model (line 74) | async def store_model(request: StoreModelRequest, organisation=Depends(g...
  function fetch_models (line 88) | async def fetch_models(organisation=Depends(get_user_organisation)):
  function fetch_model_details (line 97) | async def fetch_model_details(model_id: int, organisation=Depends(get_us...
  function fetch_data (line 106) | async def fetch_data(request: ModelName, organisation=Depends(get_user_o...
  function get_models_list (line 115) | def get_models_list(page: int = 0, organisation=Depends(get_user_organis...
  function get_marketplace_models_list (line 134) | def get_marketplace_models_list(page: int = 0):
  function get_models_details (line 156) | def get_models_details(page: int = 0):
  function test_local_llm (line 179) | def test_local_llm():

FILE: superagi/controllers/organisation.py
  class OrganisationOut (line 28) | class OrganisationOut(BaseModel):
    class Config (line 35) | class Config:
  class OrganisationIn (line 39) | class OrganisationIn(BaseModel):
    class Config (line 43) | class Config:
  function create_organisation (line 49) | def create_organisation(organisation: OrganisationIn,
  function get_organisation (line 79) | def get_organisation(organisation_id: int, Authorize: AuthJWT = Depends(...
  function update_organisation (line 101) | def update_organisation(organisation_id: int, organisation: OrganisationIn,
  function get_organisations_by_user (line 130) | def get_organisations_by_user(user_id: int):
  function get_llm_models (line 156) | def get_llm_models(organisation=Depends(get_user_organisation)):
  function agent_workflows (line 181) | def agent_workflows(organisation=Depends(get_user_organisation)):

FILE: superagi/controllers/project.py
  class ProjectOut (line 16) | class ProjectOut(BaseModel):
    class Config (line 22) | class Config:
  class ProjectIn (line 26) | class ProjectIn(BaseModel):
    class Config (line 31) | class Config:
  function create_project (line 36) | def create_project(project: ProjectIn,
  function get_project (line 71) | def get_project(project_id: int, Authorize: AuthJWT = Depends(check_auth)):
  function update_project (line 93) | def update_project(project_id: int, project: ProjectIn,
  function get_projects_organisation (line 128) | def get_projects_organisation(organisation_id: int,

FILE: superagi/controllers/resources.py
  function upload (line 33) | async def upload(agent_id: int, file: UploadFile = File(...), name=Form(...
  function get_all_resources (line 101) | def get_all_resources(agent_id: int,
  function download_file_by_id (line 119) | def download_file_by_id(resource_id: int,

FILE: superagi/controllers/tool.py
  class ToolOut (line 17) | class ToolOut(BaseModel):
    class Config (line 26) | class Config:
  class ToolIn (line 30) | class ToolIn(BaseModel):
    class Config (line 36) | class Config:
  function create_tool (line 41) | def create_tool(
  function get_tool (line 71) | def get_tool(
  function get_tools (line 96) | def get_tools(
  function update_tool (line 108) | def update_tool(

FILE: superagi/controllers/tool_config.py
  class ToolConfigOut (line 18) | class ToolConfigOut(BaseModel):
    class Config (line 24) | class Config:
  function update_tool_config (line 28) | def update_tool_config(toolkit_name: str, configs: list, organisation: O...
  function create_or_update_tool_config (line 77) | def create_or_update_tool_config(toolkit_name: str, tool_configs,
  function get_all_tool_configs (line 121) | def get_all_tool_configs(toolkit_name: str, organisation: Organisation =...
  function get_tool_config (line 155) | def get_tool_config(toolkit_name: str, key: str, organisation: Organisat...

FILE: superagi/controllers/toolkit.py
  function get_marketplace_toolkits (line 29) | def get_marketplace_toolkits(
  function get_marketplace_toolkit_detail (line 61) | def get_marketplace_toolkit_detail(toolkit_name: str):
  function get_marketplace_toolkit_readme (line 86) | def get_marketplace_toolkit_readme(toolkit_name: str):
  function get_marketplace_toolkit_tools (line 111) | def get_marketplace_toolkit_tools(toolkit_name: str):
  function install_toolkit_from_marketplace (line 136) | def install_toolkit_from_marketplace(toolkit_name: str,
  function get_installed_toolkit_details (line 166) | def get_installed_toolkit_details(toolkit_name: str,
  function download_and_install_tool (line 200) | def download_and_install_tool(github_link_request: GitHubLinkRequest = B...
  function get_installed_toolkit_readme (line 226) | def get_installed_toolkit_readme(toolkit_name: str, organisation: Organi...
  function handle_marketplace_operations (line 252) | def handle_marketplace_operations(
  function handle_marketplace_operations_list (line 272) | def handle_marketplace_operations_list(
  function get_installed_toolkit_list (line 294) | def get_installed_toolkit_list(organisation: Organisation = Depends(get_...
  function check_toolkit_update (line 315) | def check_toolkit_update(toolkit_name: str, organisation: Organisation =...
  function update_toolkit (line 345) | def update_toolkit(toolkit_name: str, organisation: Organisation = Depen...

FILE: superagi/controllers/twitter_oauth.py
  function twitter_oauth (line 21) | async def twitter_oauth(oauth_token: str = Query(...),oauth_verifier: st...
  function send_twitter_tool_configs (line 32) | def send_twitter_tool_configs(twitter_creds: str, Authorize: AuthJWT = D...
  function get_twitter_tool_configs (line 59) | def get_twitter_tool_configs(toolkit_id: int):

FILE: superagi/controllers/types/agent_execution_config.py
  class AgentRunIn (line 7) | class AgentRunIn(BaseModel):
    class Config (line 31) | class Config:

FILE: superagi/controllers/types/agent_publish_config.py
  class AgentPublish (line 4) | class AgentPublish(BaseModel):
    class Config (line 22) | class Config:

FILE: superagi/controllers/types/agent_schedule.py
  class AgentScheduleInput (line 5) | class AgentScheduleInput(BaseModel):

FILE: superagi/controllers/types/agent_with_config.py
  class AgentConfigInput (line 5) | class AgentConfigInput(BaseModel):
  class AgentConfigExtInput (line 26) | class AgentConfigExtInput(BaseModel):
  class AgentConfigUpdateExtInput (line 45) | class AgentConfigUpdateExtInput(BaseModel):

FILE: superagi/controllers/types/agent_with_config_schedule.py
  class AgentConfigSchedule (line 6) | class AgentConfigSchedule(BaseModel):

FILE: superagi/controllers/types/models_types.py
  class ModelsTypes (line 3) | class ModelsTypes(Enum):
    method get_models_types (line 8) | def get_models_types(cls, model_type):

FILE: superagi/controllers/user.py
  class UserBase (line 24) | class UserBase(BaseModel):
    class Config (line 29) | class Config:
  class UserOut (line 33) | class UserOut(UserBase):
    class Config (line 39) | class Config:
  class UserIn (line 43) | class UserIn(UserBase):
    class Config (line 46) | class Config:
  function create_user (line 52) | def create_user(user: UserIn, Authorize: AuthJWT = Depends(check_auth)):
  function get_user (line 93) | def get_user(user_id: int,
  function update_user (line 117) | def update_user(user_id: int,
  function update_first_login_source (line 148) | def update_first_login_source(source: str, Authorize: AuthJWT = Depends(...

FILE: superagi/controllers/vector_db_indices.py
  function get_marketplace_valid_indices (line 13) | def get_marketplace_valid_indices(knowledge_name: str, organisation = De...
  function get_user_valid_indices (line 36) | def get_user_valid_indices(organisation = Depends(get_user_organisation)):

FILE: superagi/controllers/vector_dbs.py
  function get_vector_db_list (line 17) | def get_vector_db_list():
  function get_marketplace_vectordb_list (line 22) | def get_marketplace_vectordb_list():
  function get_user_connected_vector_db_list (line 28) | def get_user_connected_vector_db_list(organisation = Depends(get_user_or...
  function get_vector_db_details (line 36) | def get_vector_db_details(vector_db_id: int):
  function delete_vector_db (line 53) | def delete_vector_db(vector_db_id: int):
  function connect_pinecone_vector_db (line 65) | def connect_pinecone_vector_db(data: dict, organisation = Depends(get_us...
  function connect_qdrant_vector_db (line 84) | def connect_qdrant_vector_db(data: dict, organisation = Depends(get_user...
  function connect_weaviate_vector_db (line 105) | def connect_weaviate_vector_db(data: dict, organisation = Depends(get_us...
  function update_vector_db (line 125) | def update_vector_db(new_indices: list, vector_db_id: int):

FILE: superagi/controllers/webhook.py
  class WebHookIn (line 16) | class WebHookIn(BaseModel):
    class Config (line 22) | class Config:
  class WebHookOut (line 26) | class WebHookOut(BaseModel):
    class Config (line 37) | class Config:
  class WebHookEdit (line 40) | class WebHookEdit(BaseModel):
    class Config (line 44) | class Config:
  function create_webhook (line 51) | def create_webhook(webhook: WebHookIn, Authorize: AuthJWT = Depends(chec...
  function get_all_webhooks (line 72) | def get_all_webhooks(
  function edit_webhook (line 88) | def edit_webhook(

FILE: superagi/helper/agent_schedule_helper.py
  class AgentScheduleHelper (line 13) | class AgentScheduleHelper:
    method run_scheduled_agents (line 16) | def run_scheduled_agents(self):
    method update_next_scheduled_time (line 48) | def update_next_scheduled_time(self):
    method __create_execution_name_for_scheduling (line 74) | def __create_execution_name_for_scheduling(self, agent_id) -> str:
    method __should_execute_agent (line 96) | def __should_execute_agent(self, agent, interval):
    method __can_remove_agent (line 127) | def __can_remove_agent(self, agent, interval):
    method __execute_schedule (line 164) | def __execute_schedule(self, should_execute_agent, interval_in_seconds...

FILE: superagi/helper/auth.py
  function check_auth (line 14) | def check_auth(Authorize: AuthJWT = Depends()):
  function get_user_organisation (line 30) | def get_user_organisation(Authorize: AuthJWT = Depends(check_auth)):
  function get_current_user (line 47) | def get_current_user(Authorize: AuthJWT = Depends(check_auth), request: ...
  function validate_api_key (line 72) | def validate_api_key(api_key: str = Security(api_key_header)) -> str:
  function get_organisation_from_api_key (line 84) | def get_organisation_from_api_key(api_key: str = Security(api_key_header...

FILE: superagi/helper/calendar_date.py
  class CalendarDate (line 6) | class CalendarDate:
    method create_event_dates (line 7) | def create_event_dates(self, service, start_date, start_time, end_date...
    method get_date_utc (line 17) | def get_date_utc(self, start_date, end_date, start_time, end_time, ser...
    method _get_time_zone (line 26) | def _get_time_zone(self, service):
    method _convert_to_utc (line 31) | def _convert_to_utc(self, date_time, local_tz):
    method _string_to_datetime (line 36) | def _string_to_datetime(self, date_str, date_format):
    method _localize_daterange (line 39) | def _localize_daterange(self, start_date, end_date, start_time, end_ti...
    method _datetime_to_string (line 58) | def _datetime_to_string(self, date_time, date_format):

FILE: superagi/helper/encyption_helper.py
  function encrypt_data (line 28) | def encrypt_data(data):
  function decrypt_data (line 42) | def decrypt_data(encrypted_data):
  function is_encrypted (line 56) | def is_encrypted(value):

FILE: superagi/helper/error_handler.py
  class ErrorHandler (line 4) | class ErrorHandler:
    method handle_openai_errors (line 6) | def handle_openai_errors(session, agent_id, agent_execution_id, error_...

FILE: superagi/helper/feed_parser.py
  function parse_feed (line 8) | def parse_feed(feed):

FILE: superagi/helper/github_helper.py
  class GithubHelper (line 15) | class GithubHelper:
    method __init__ (line 16) | def __init__(self, github_access_token, github_username):
    method get_file_path (line 27) | def get_file_path(self, file_name, folder_path):
    method check_repository_visibility (line 44) | def check_repository_visibility(self, repository_owner, repository_name):
    method search_repo (line 69) | def search_repo(self, repository_owner, repository_name, file_name, fo...
    method sync_branch (line 94) | def sync_branch(self, repository_owner, repository_name, base_branch, ...
    method make_fork (line 124) | def make_fork(self, repository_owner, repository_name, base_branch, he...
    method create_branch (line 147) | def create_branch(self, repository_name, base_branch, head_branch, hea...
    method delete_file (line 177) | def delete_file(self, repository_name, file_name, folder_path, commit_...
    method add_file (line 207) | def add_file(self, repository_owner, repository_name, file_name, folde...
    method create_pull_request (line 243) | def create_pull_request(self, repository_owner, repository_name, head_...
    method get_sha (line 276) | def get_sha(self, repository_owner, repository_name, file_name, folder...
    method get_content_in_file (line 292) | def get_content_in_file(self, repository_owner, repository_name, file_...
    method validate_github_link (line 314) | def validate_github_link(cls, link: str) -> bool:
    method _get_file_contents (line 328) | def _get_file_contents(self, file_name, agent_id, agent_execution_id, ...
    method get_pull_request_content (line 342) | def get_pull_request_content(self, repository_owner, repository_name, ...
    method get_latest_commit_id_of_pull_request (line 374) | def get_latest_commit_id_of_pull_request(self, repository_owner, repos...
    method add_line_comment_to_pull_request (line 399) | def add_line_comment_to_pull_request(self, repository_owner, repositor...
    method get_pull_requests_created_in_last_x_seconds (line 435) | def get_pull_requests_created_in_last_x_seconds(self, repository_owner...

FILE: superagi/helper/google_calendar_creds.py
  class GoogleCalendarCreds (line 20) | class GoogleCalendarCreds:
    method __init__ (line 22) | def __init__(self, session: Session):
    method get_credentials (line 25) | def get_credentials(self, toolkit_id):
    method fix_refresh_token (line 64) | def fix_refresh_token(self, refresh_token):

FILE: superagi/helper/google_search.py
  class GoogleSearchWrap (line 9) | class GoogleSearchWrap:
    method __init__ (line 11) | def __init__(self, api_key, search_engine_id, num_results=3, num_pages...
    method search_run (line 30) | def search_run(self, query):
    method get_result (line 69) | def get_result(self, query):

FILE: superagi/helper/google_serp.py
  class GoogleSerpApiWrap (line 10) | class GoogleSerpApiWrap:
    method __init__ (line 11) | def __init__(self, api_key, num_results=10, num_pages=1, num_extracts=3):
    method search_run (line 27) | def search_run(self, query):
    method fetch_serper_results (line 41) | async def fetch_serper_results(self,
    method process_response (line 67) | def process_response(self, results) -> str:

FILE: superagi/helper/imap_email.py
  class ImapEmail (line 4) | class ImapEmail:
    method imap_open (line 6) | def imap_open(self, imap_folder, email_sender, email_password, imap_se...
    method adjust_imap_folder (line 23) | def adjust_imap_folder(self, imap_folder, email_sender) -> str:

FILE: superagi/helper/json_cleaner.py
  class JsonCleaner (line 8) | class JsonCleaner:
    method clean_boolean (line 11) | def clean_boolean(cls, input_str: str = ""):
    method extract_json_section (line 27) | def extract_json_section(cls, input_str: str = ""):
    method extract_json_array_section (line 48) | def extract_json_array_section(cls, input_str: str = ""):
    method remove_escape_sequences (line 69) | def remove_escape_sequences(cls, string):
    method balance_braces (line 82) | def balance_braces(cls, json_string: str) -> str:

FILE: superagi/helper/llm_loader.py
  class LLMLoader (line 7) | class LLMLoader:
    method __new__ (line 12) | def __new__(cls, *args, **kwargs):
    method __init__ (line 17) | def __init__(self, context_length):
    method model (line 21) | def model(self):
    method grammar (line 31) | def grammar(self):

FILE: superagi/helper/models_helper.py
  class ModelsHelper (line 3) | class ModelsHelper:
    method validate_end_point (line 5) | def validate_end_point(model_api_key, end_point, model_provider):

FILE: superagi/helper/prompt_reader.py
  class PromptReader (line 4) | class PromptReader:
    method read_tools_prompt (line 6) | def read_tools_prompt(current_file: str, prompt_file: str) -> str:
    method read_agent_prompt (line 18) | def read_agent_prompt(current_file: str, prompt_file: str) -> str:

FILE: superagi/helper/read_email.py
  class ReadEmail (line 8) | class ReadEmail:
    method clean_email_body (line 9) | def clean_email_body(self, email_body):
    method clean (line 29) | def clean(self, text):
    method obtain_header (line 41) | def obtain_header(self, msg):
    method download_attachment (line 69) | def download_attachment(self, part, subject):

FILE: superagi/helper/resource_helper.py
  class ResourceHelper (line 12) | class ResourceHelper:
    method make_written_file_resource (line 14) | def make_written_file_resource(cls, file_name: str, agent: Agent, agen...
    method get_formatted_agent_level_path (line 83) | def get_formatted_agent_level_path(cls, agent: Agent, path) -> object:
    method get_formatted_agent_execution_level_path (line 88) | def get_formatted_agent_execution_level_path(cls, agent_execution: Age...
    method get_resource_path (line 93) | def get_resource_path(cls, file_name: str):
    method get_root_output_dir (line 102) | def get_root_output_dir(cls):
    method get_root_input_dir (line 115) | def get_root_input_dir(cls):
    method get_agent_write_resource_path (line 128) | def get_agent_write_resource_path(cls, file_name: str, agent: Agent, a...
    method __check_file_path_exists (line 147) | def __check_file_path_exists(path):
    method get_agent_read_resource_path (line 156) | def get_agent_read_resource_path(cls, file_name, agent: Agent, agent_e...

FILE: superagi/helper/s3_helper.py
  class S3Helper (line 12) | class S3Helper:
    method __init__ (line 13) | def __init__(self, bucket_name=get_config("BUCKET_NAME")):
    method __get_s3_client (line 22) | def __get_s3_client(cls):
    method upload_file (line 35) | def upload_file(self, file, path):
    method check_file_exists_in_s3 (line 55) | def check_file_exists_in_s3(self, file_path):
    method read_from_s3 (line 59) | def read_from_s3(self, file_path):
    method read_binary_from_s3 (line 67) | def read_binary_from_s3(self, file_path):
    method get_json_file (line 75) | def get_json_file(self, path):
    method delete_file (line 92) | def delete_file(self, path):
    method upload_file_content (line 112) | def upload_file_content(self, content, file_path):
    method get_download_url_of_resources (line 118) | def get_download_url_of_resources(self, db_resources_arr):
    method list_files_from_s3 (line 141) | def list_files_from_s3(self, file_path):

FILE: superagi/helper/time_helper.py
  function get_time_difference (line 4) | def get_time_difference(timestamp1, timestamp2):
  function parse_interval_to_seconds (line 36) | def parse_interval_to_seconds(interval: str) -> int:

FILE: superagi/helper/token_counter.py
  class TokenCounter (line 11) | class TokenCounter:
    method __init__ (line 13) | def __init__(self, session:Session=None, organisation_id: int=None):
    method token_limit (line 17) | def token_limit(self, model: str = "gpt-3.5-turbo-0301") -> int:
    method count_message_tokens (line 38) | def count_message_tokens(messages: List[BaseMessage], model: str = "gp...
    method count_text_tokens (line 86) | def count_text_tokens(message: str) -> int:

FILE: superagi/helper/tool_helper.py
  function parse_github_url (line 20) | def parse_github_url(github_url):
  function download_tool (line 28) | def download_tool(tool_url, target_folder):
  function get_classes_in_file (line 71) | def get_classes_in_file(file_path, clazz):
  function get_tool_info (line 93) | def get_tool_info(class_dict, classes, obj):
  function get_toolkit_info (line 102) | def get_toolkit_info(class_dict, classes, obj):
  function load_module_from_file (line 113) | def load_module_from_file(file_path):
  function init_tools (line 121) | def init_tools(folder_paths, session, tool_name_to_toolkit):
  function update_base_tool_class_info (line 141) | def update_base_tool_class_info(classes, file_name, folder_name, session...
  function init_toolkits (line 154) | def init_toolkits(code_link, existing_toolkits, folder_paths, organisati...
  function delete_extra_toolkit (line 181) | def delete_extra_toolkit(existing_toolkits, new_toolkits, session):
  function update_base_toolkit_info (line 191) | def update_base_toolkit_info(classes, code_link, folder_name, new_toolki...
  function process_files (line 232) | def process_files(folder_paths, session, organisation, code_link=None):
  function get_readme_content_from_code_link (line 239) | def get_readme_content_from_code_link(tool_code_link):
  function register_toolkits (line 259) | def register_toolkits(session, organisation):
  function register_marketplace_toolkits (line 267) | def register_marketplace_toolkits(session, organisation):
  function extract_repo_name (line 273) | def extract_repo_name(repo_link):
  function add_tool_to_json (line 281) | def add_tool_to_json(repo_link):
  function handle_tools_import (line 297) | def handle_tools_import():
  function compare_tools (line 308) | def compare_tools(tool1, tool2):
  function compare_configs (line 313) | def compare_configs(config1, config2):
  function compare_toolkit (line 318) | def compare_toolkit(toolkit1, toolkit2):

FILE: superagi/helper/twitter_helper.py
  class TwitterHelper (line 15) | class TwitterHelper:
    method get_media_ids (line 17) | def get_media_ids(self, session, media_files, creds, agent_id, agent_e...
    method get_file_path (line 36) | def get_file_path(self, session, file_name, agent_id, agent_execution_...
    method _get_image_data (line 43) | def _get_image_data(self, file_path):
    method send_tweets (line 51) | def send_tweets(self, params, creds):
    method _get_image_data (line 61) | def _get_image_data(self, file_path):

FILE: superagi/helper/twitter_tokens.py
  class Creds (line 14) | class Creds:
    method __init__ (line 16) | def __init__(self,api_key, api_key_secret, oauth_token, oauth_token_se...
  class TwitterTokens (line 22) | class TwitterTokens:
    method __init__ (line 24) | def __init__(self, session: Session):
    method get_request_token (line 27) | def get_request_token(self,api_data):
    method percent_encode (line 70) | def percent_encode(self, val):
    method gen_nonce (line 73) | def gen_nonce(self):
    method get_twitter_creds (line 77) | def get_twitter_creds(self, toolkit_id):

FILE: superagi/helper/validate_csv.py
  function correct_csv_encoding (line 6) | def correct_csv_encoding(file_path):

FILE: superagi/helper/webhook_manager.py
  class WebHookManager (line 9) | class WebHookManager:
    method __init__ (line 10) | def __init__(self,session):
    method agent_status_change_callback (line 13) | def agent_status_change_callback(self, agent_execution_id, curr_status...

FILE: superagi/helper/webpage_extractor.py
  class WebpageExtractor (line 30) | class WebpageExtractor:
    method __init__ (line 32) | def __init__(self, num_extracts=3):
    method extract_with_3k (line 38) | def extract_with_3k(self, url):
    method extract_with_bs4 (line 86) | def extract_with_bs4(self, url):
    method extract_with_lxml (line 128) | def extract_with_lxml(self, url):

FILE: superagi/image_llms/base_image_llm.py
  class BaseImageLlm (line 4) | class BaseImageLlm(ABC):
    method get_image_model (line 6) | def get_image_model(self):
    method generate_image (line 10) | def generate_image(self, prompt: str, size: int = 512, num: int = 2):

FILE: superagi/image_llms/openai_dalle.py
  class OpenAiDalle (line 7) | class OpenAiDalle(BaseImageLlm):
    method __init__ (line 8) | def __init__(self, api_key, image_model=None, number_of_results=1):
    method get_image_model (line 21) | def get_image_model(self):
    method generate_image (line 28) | def generate_image(self, prompt: str, size: int = 512):

FILE: superagi/jobs/agent_executor.py
  class AgentExecutor (line 37) | class AgentExecutor:
    method execute_next_step (line 39) | def execute_next_step(self, agent_execution_id):
    method __execute_workflow_step (line 105) | def __execute_workflow_step(self, agent, agent_config, agent_execution...
    method get_embedding (line 130) | def get_embedding(cls, model_source, model_api_key):
    method _check_for_max_iterations (line 143) | def _check_for_max_iterations(self, session, organisation_id, agent_co...
    method execute_waiting_workflows (line 159) | def execute_waiting_workflows(self):

FILE: superagi/jobs/scheduling_executor.py
  class ScheduledAgentExecutor (line 23) | class ScheduledAgentExecutor:
    method execute_scheduled_agent (line 25) | def execute_scheduled_agent(self, agent_id: int, name: str):

FILE: superagi/lib/logger.py
  class CustomLogRecord (line 5) | class CustomLogRecord(logging.LogRecord):
    method __init__ (line 6) | def __init__(self, *args, **kwargs):
  class SingletonMeta (line 23) | class SingletonMeta(type):
    method __call__ (line 26) | def __call__(cls, *args, **kwargs):
  class Logger (line 33) | class Logger(metaclass=SingletonMeta):
    method __init__ (line 34) | def __init__(self, logger_name='Super AGI', log_level=logging.DEBUG):
    method _make_custom_log_record (line 50) | def _make_custom_log_record(self, name, level, fn, lno, msg, args, exc...
    method debug (line 53) | def debug(self, message, *args):
    method info (line 58) | def info(self, message, *args):
    method warning (line 63) | def warning(self, message, *args):
    method error (line 68) | def error(self, message, *args):
    method critical (line 73) | def critical(self, message, *args):

FILE: superagi/llms/base_llm.py
  class BaseLlm (line 4) | class BaseLlm(ABC):
    method chat_completion (line 6) | def chat_completion(self, prompt):
    method get_source (line 10) | def get_source(self):
    method get_api_key (line 14) | def get_api_key(self):
    method get_model (line 18) | def get_model(self):
    method get_models (line 22) | def get_models(self):
    method verify_access_key (line 26) | def verify_access_key(self):

FILE: superagi/llms/google_palm.py
  class GooglePalm (line 8) | class GooglePalm(BaseLlm):
    method __init__ (line 9) | def __init__(self, api_key, model='models/chat-bison-001', temperature...
    method get_source (line 28) | def get_source(self):
    method get_api_key (line 31) | def get_api_key(self):
    method get_model (line 38) | def get_model(self):
    method chat_completion (line 45) | def chat_completion(self, messages, max_tokens=get_config("MAX_MODEL_T...
    method verify_access_key (line 80) | def verify_access_key(self):
    method get_models (line 94) | def get_models(self):

FILE: superagi/llms/hugging_face.py
  class HuggingFace (line 10) | class HuggingFace(BaseLlm):
    method __init__ (line 11) | def __init__(
    method get_source (line 29) | def get_source(self):
    method get_api_key (line 32) | def get_api_key(self):
    method get_model (line 39) | def get_model(self):
    method get_models (line 49) | def get_models(self):
    method verify_access_key (line 56) | def verify_access_key(self):
    method chat_completion (line 70) | def chat_completion(self, messages, max_tokens=get_config("MAX_MODEL_T...
    method verify_end_point (line 107) | def verify_end_point(self):

FILE: superagi/llms/llm_model_factory.py
  function get_model (line 12) | def get_model(organisation_id, api_key, model="gpt-3.5-turbo", **kwargs):
  function build_model_with_api_key (line 43) | def build_model_with_api_key(provider_name, api_key):

FILE: superagi/llms/local_llm.py
  class LocalLLM (line 7) | class LocalLLM(BaseLlm):
    method __init__ (line 8) | def __init__(self, temperature=0.6, max_tokens=get_config("MAX_MODEL_T...
    method chat_completion (line 35) | def chat_completion(self, messages, max_tokens=get_config("MAX_MODEL_T...
    method get_source (line 61) | def get_source(self):
    method get_api_key (line 70) | def get_api_key(self):
    method get_model (line 77) | def get_model(self):
    method get_models (line 84) | def get_models(self):
    method verify_access_key (line 91) | def verify_access_key(self, api_key):

FILE: superagi/llms/openai.py
  function custom_retry_error_callback (line 14) | def custom_retry_error_callback(retry_state):
  class OpenAi (line 19) | class OpenAi(BaseLlm):
    method __init__ (line 20) | def __init__(self, api_key, model="gpt-4", temperature=0.6, max_tokens...
    method get_source (line 45) | def get_source(self):
    method get_api_key (line 48) | def get_api_key(self):
    method get_model (line 55) | def get_model(self):
    method chat_completion (line 73) | def chat_completion(self, messages, max_tokens=get_config("MAX_MODEL_T...
    method verify_access_key (line 117) | def verify_access_key(self):
    method get_models (line 131) | def get_models(self):

FILE: superagi/llms/replicate.py
  class Replicate (line 8) | class Replicate(BaseLlm):
    method __init__ (line 9) | def __init__(self, api_key, model: str = None, version: str = None, ma...
    method get_source (line 30) | def get_source(self):
    method get_api_key (line 33) | def get_api_key(self):
    method get_model (line 40) | def get_model(self):
    method get_models (line 47) | def get_models(self):
    method chat_completion (line 54) | def chat_completion(self, messages, max_tokens=get_config("MAX_MODEL_T...
    method verify_access_key (line 98) | def verify_access_key(self):

FILE: superagi/llms/utils/huggingface_utils/tasks.py
  class Tasks (line 7) | class Tasks(Enum):
  class TaskParameters (line 11) | class TaskParameters:
    method __init__ (line 12) | def __init__(self) -> None:
    method get_params (line 16) | def get_params(self, task, **kwargs) -> Dict[str, Union[int, float, bo...
    method _generate_params (line 26) | def _generate_params(self):
    method _validate_params (line 31) | def _validate_params(self):
  class TextGenerationParameters (line 44) | class TextGenerationParameters():

FILE: superagi/models/agent.py
  class Agent (line 20) | class Agent(DBBaseModel):
    method __repr__ (line 42) | def __repr__(self):
    method fetch_configuration (line 55) | def fetch_configuration(cls, session, agent_id: int):
    method eval_agent_config (line 97) | def eval_agent_config(cls, key, value):
    method create_agent_with_config (line 121) | def create_agent_with_config(cls, db, agent_with_config):
    method create_agent_with_template_id (line 185) | def create_agent_with_template_id(cls, db, project_id, agent_template):
    method create_agent_with_marketplace_template_id (line 221) | def create_agent_with_marketplace_template_id(cls, db, project_id, age...
    method get_agent_organisation (line 253) | def get_agent_organisation(self, session):
    method get_agent_from_id (line 268) | def get_agent_from_id(cls, session, agent_id):
    method find_org_by_agent_id (line 282) | def find_org_by_agent_id(cls, session: object, agent_id: int):
    method get_active_agent_by_id (line 299) | def get_active_agent_by_id(cls, session, agent_id: int):

FILE: superagi/models/agent_config.py
  class AgentConfiguration (line 15) | class AgentConfiguration(DBBaseModel):
    method __repr__ (line 33) | def __repr__(self):
    method update_agent_configurations_table (line 44) | def update_agent_configurations_table(cls, session, agent_id: Union[in...
    method get_model_api_key (line 93) | def get_model_api_key(cls, session, agent_id: int, model: str):
    method get_agent_config_by_key_and_agent_id (line 121) | def get_agent_config_by_key_and_agent_id(cls, session, key: str, agent...

FILE: superagi/models/agent_execution.py
  class AgentExecution (line 11) | class AgentExecution(DBBaseModel):
    method __repr__ (line 42) | def __repr__(self):
    method to_dict (line 57) | def to_dict(self):
    method to_json (line 78) | def to_json(self):
    method from_json (line 89) | def from_json(cls, json_data):
    method get_agent_execution_from_id (line 116) | def get_agent_execution_from_id(cls, session, agent_execution_id):
    method find_by_id (line 130) | def find_by_id(cls, session, execution_id: int):
    method update_tokens (line 145) | def update_tokens(self, session, agent_execution_id: int, total_tokens...
    method assign_next_step_id (line 154) | def assign_next_step_id(cls, session, agent_execution_id: int, next_st...
    method get_execution_by_agent_id_and_status (line 171) | def get_execution_by_agent_id_and_status(cls, session, agent_id: int, ...
    method get_all_executions_by_status_and_agent_id (line 177) | def get_all_executions_by_status_and_agent_id(cls, session, agent_id, ...
    method get_all_executions_by_filter_config (line 186) | def get_all_executions_by_filter_config(cls, session, agent_id: int, f...
    method validate_run_ids (line 200) | def validate_run_ids(cls, session, run_ids: list, organisation_id: int):

FILE: superagi/models/agent_execution_config.py
  class AgentExecutionConfiguration (line 13) | class AgentExecutionConfiguration(DBBaseModel):
    method __repr__ (line 31) | def __repr__(self):
    method add_or_update_agent_execution_config (line 43) | def add_or_update_agent_execution_config(cls, session, execution, agen...
    method fetch_configuration (line 70) | def fetch_configuration(cls, session, execution_id):
    method eval_agent_config (line 96) | def eval_agent_config(cls, key, value):
    method build_agent_execution_config (line 113) | def build_agent_execution_config(cls, session, agent, results_agent, r...
    method build_scheduled_agent_execution_config (line 156) | def build_scheduled_agent_execution_config(cls, session, agent, result...
    method fetch_value (line 194) | def fetch_value(cls, session, execution_id: int, key: str):

FILE: superagi/models/agent_execution_feed.py
  class AgentExecutionFeed (line 8) | class AgentExecutionFeed(DBBaseModel):
    method __repr__ (line 32) | def __repr__(self):
    method get_last_tool_response (line 45) | def get_last_tool_response(cls, session: Session, agent_execution_id: ...
    method fetch_agent_execution_feeds (line 58) | def fetch_agent_execution_feeds(cls, session, agent_execution_id: int):

FILE: superagi/models/agent_execution_permission.py
  class AgentExecutionPermission (line 7) | class AgentExecutionPermission(DBBaseModel):
    method __repr__ (line 34) | def __repr__(self):

FILE: superagi/models/agent_schedule.py
  class AgentSchedule (line 5) | class AgentSchedule(DBBaseModel):
    method __repr__ (line 36) | def __repr__(self):
    method save_schedule_from_config (line 51) | def save_schedule_from_config(cls, session, db_agent, schedule_config:...
    method find_by_agent_id (line 69) | def find_by_agent_id(cls, session, agent_id: int):

FILE: superagi/models/agent_template.py
  class AgentTemplate (line 16) | class AgentTemplate(DBBaseModel):
    method __repr__ (line 38) | def __repr__(self):
    method to_dict (line 49) | def to_dict(self):
    method to_json (line 63) | def to_json(self):
    method from_json (line 74) | def from_json(cls, json_data):
    method main_keys (line 93) | def main_keys(cls):
    method fetch_marketplace_list (line 106) | def fetch_marketplace_list(cls, search_str, page):
    method fetch_marketplace_detail (line 128) | def fetch_marketplace_detail(cls, agent_template_id):
    method clone_agent_template_from_marketplace (line 149) | def clone_agent_template_from_marketplace(cls, db, organisation_id: in...
    method fetch_iteration_agent_template_mapping (line 190) | def fetch_iteration_agent_template_mapping(cls, session, name):
    method eval_agent_config (line 204) | def eval_agent_config(cls, key, value):

FILE: superagi/models/agent_template_config.py
  class AgentTemplateConfig (line 8) | class AgentTemplateConfig(DBBaseModel):
    method __repr__ (line 26) | def __repr__(self):
    method to_dict (line 37) | def to_dict(self):
    method to_json (line 52) | def to_json(self):
    method from_json (line 63) | def from_json(cls, json_data):

FILE: superagi/models/api_key.py
  class ApiKey (line 5) | class ApiKey(DBBaseModel):
    method get_by_org_id (line 22) | def get_by_org_id(cls, session, org_id: int):
    method get_by_id (line 27) | def get_by_id(cls, session, id: int):
    method delete_by_id (line 32) | def delete_by_id(cls, session,id: int):
    method update_api_key (line 39) | def update_api_key(cls, session, id: int, name: str):

FILE: superagi/models/base_model.py
  class DBBaseModel (line 10) | class DBBaseModel(Base):
    method to_dict (line 30) | def to_dict(self):
    method to_json (line 39) | def to_json(self):
    method from_json (line 49) | def from_json(cls, json_data):
    method __repr__ (line 61) | def __repr__(self):

FILE: superagi/models/budget.py
  class Budget (line 5) | class Budget(DBBaseModel):
    method __repr__ (line 21) | def __repr__(self):

FILE: superagi/models/call_logs.py
  class CallLogs (line 4) | class CallLogs(DBBaseModel):
    method __repr__ (line 28) | def __repr__(self):

FILE: superagi/models/configuration.py
  class Configuration (line 12) | class Configuration(DBBaseModel):
    method __repr__ (line 30) | def __repr__(self):
    method fetch_configuration (line 42) | def fetch_configuration(cls, session, organisation_id: int, key: str, ...
    method fetch_configurations (line 64) | def fetch_configurations(cls, session, organisation_id: int, key: str,...
    method fetch_value_by_agent_id (line 89) | def fetch_value_by_agent_id(cls, session, agent_id: int, key: str):

FILE: superagi/models/db.py
  function connect_db (line 9) | def connect_db():

FILE: superagi/models/events.py
  class Event (line 8) | class Event(DBBaseModel):
    method __repr__ (line 29) | def __repr__(self):

FILE: superagi/models/knowledge_configs.py
  class KnowledgeConfigs (line 8) | class KnowledgeConfigs(DBBaseModel):
    method __repr__ (line 25) | def __repr__(self):
    method fetch_knowledge_config_details_marketplace (line 34) | def fetch_knowledge_config_details_marketplace(cls, knowledge_id: int):
    method add_update_knowledge_config (line 49) | def add_update_knowledge_config(cls, session, knowledge_id, knowledge_...
    method get_knowledge_config_from_knowledge_id (line 56) | def get_knowledge_config_from_knowledge_id(cls, session, knowledge_id):
    method delete_knowledge_config (line 64) | def delete_knowledge_config(cls, session, knowledge_id):
    method get_knowledge_config_from_knowledge_id (line 69) | def get_knowledge_config_from_knowledge_id(cls, session, knowledge_id):

FILE: superagi/models/knowledges.py
  class Knowledges (line 12) | class Knowledges(DBBaseModel):
    method __repr__ (line 34) | def __repr__(self):
    method fetch_marketplace_list (line 46) | def fetch_marketplace_list(cls, page):
    method get_knowledge_install_details (line 57) | def get_knowledge_install_details(cls, session, marketplace_knowledges...
    method get_organisation_knowledges (line 67) | def get_organisation_knowledges(cls, session, organisation):
    method fetch_knowledge_details_marketplace (line 80) | def fetch_knowledge_details_marketplace(cls, knowledge_name):
    method get_knowledge_from_id (line 91) | def get_knowledge_from_id(cls, session, knowledge_id):
    method add_update_knowledge (line 96) | def add_update_knowledge(cls, session, knowledge_data):
    method delete_knowledge (line 109) | def delete_knowledge(cls, session, knowledge_id):
    method delete_knowledge_from_vector_index (line 114) | def delete_knowledge_from_vector_index(cls, session, vector_db_index_id):

FILE: superagi/models/marketplace_stats.py
  class MarketPlaceStats (line 11) | class MarketPlaceStats(DBBaseModel):
    method __repr__ (line 30) | def __repr__(self):
    method get_knowledge_installation_number (line 38) | def get_knowledge_installation_number(cls, knowledge_id: int):
    method update_knowledge_install_number (line 49) | def update_knowledge_install_number(cls, session, knowledge_id, instal...

FILE: superagi/models/models.py
  class Models (line 15) | class Models(DBBaseModel):
    method __repr__ (line 46) | def __repr__(self):
    method fetch_marketplace_list (line 59) | def fetch_marketplace_list(cls, page):
    method get_model_install_details (line 70) | def get_model_install_details(cls, session, marketplace_models, organi...
    method fetch_model_tokens (line 91) | def fetch_model_tokens(cls, session, organisation_id) -> Dict[str, int]:
    method store_model_details (line 109) | def store_model_details(cls, session, organisation_id, model_name, des...
    method api_key_from_configurations (line 165) | def api_key_from_configurations(cls, session, organisation_id):
    method fetch_models (line 186) | def fetch_models(cls, session, organisation_id) -> Union[Dict[str, str...
    method fetch_model_details (line 211) | def fetch_model_details(cls, session, organisation_id, model_id: int) ...

FILE: superagi/models/models_config.py
  class ModelsConfig (line 12) | class ModelsConfig(DBBaseModel):
    method __repr__ (line 30) | def __repr__(self):
    method fetch_value_by_agent_id (line 38) | def fetch_value_by_agent_id(cls, session, agent_id: int, model: str):
    method store_api_key (line 79) | def store_api_key(cls, session, organisation_id, model_provider, model...
    method storeGptModels (line 102) | def storeGptModels(cls, session, organisation_id, model_provider_id, m...
    method fetch_api_keys (line 112) | def fetch_api_keys(cls, session, organisation_id):
    method fetch_api_key (line 125) | def fetch_api_key(cls, session, organisation_id, model_provider):
    method fetch_model_by_id (line 142) | def fetch_model_by_id(cls, session, organisation_id, model_provider_id):
    method fetch_model_by_id_marketplace (line 151) | def fetch_model_by_id_marketplace(cls, session, model_provider_id):
    method add_llm_config (line 159) | def add_llm_config(cls, session, organisation_id):

FILE: superagi/models/oauth_tokens.py
  class OauthTokens (line 10) | class OauthTokens(DBBaseModel):
    method __repr__ (line 31) | def __repr__(self):
    method add_or_update (line 42) | def add_or_update(self, session: Session, toolkit_id: int, user_id: in...

FILE: superagi/models/organisation.py
  class Organisation (line 7) | class Organisation(DBBaseModel):
    method __repr__ (line 23) | def __repr__(self):
    method find_or_create_organisation (line 34) | def find_or_create_organisation(cls, session, user):

FILE: superagi/models/project.py
  class Project (line 5) | class Project(DBBaseModel):
    method __repr__ (line 23) | def __repr__(self):
    method find_or_create_default_project (line 34) | def find_or_create_default_project(cls, session, organisation_id):
    method find_by_org_id (line 60) | def find_by_org_id(cls, session, org_id: int):
    method find_by_id (line 65) | def find_by_id(cls, session, project_id: int):

FILE: superagi/models/resource.py
  class Resource (line 6) | class Resource(DBBaseModel):
    method __repr__ (line 35) | def __repr__(self):
    method validate_resource_type (line 46) | def validate_resource_type(storage_type):
    method find_by_run_ids (line 63) | def find_by_run_ids(cls, session, run_ids: list):
  class InvalidResourceType (line 67) | class InvalidResourceType(Exception):

FILE: superagi/models/tool.py
  class Tool (line 8) | class Tool(DBBaseModel):
    method __repr__ (line 30) | def __repr__(self):
    method to_dict (line 41) | def to_dict(self):
    method add_or_update (line 58) | def add_or_update(session, tool_name: str, description: str, folder_na...
    method delete_tool (line 81) | def delete_tool(session, tool_name):
    method convert_tool_names_to_ids (line 89) | def convert_tool_names_to_ids(cls, db, tool_names):
    method convert_tool_ids_to_names (line 105) | def convert_tool_ids_to_names(cls, db, tool_ids):
    method get_invalid_tools (line 121) | def get_invalid_tools(cls, tool_ids, session):
    method get_toolkit_tools (line 130) | def get_toolkit_tools(cls, session, toolkit_id : int):

FILE: superagi/models/tool_config.py
  class ToolConfig (line 10) | class ToolConfig(DBBaseModel):
    method __repr__ (line 34) | def __repr__(self):
    method to_dict (line 37) | def to_dict(self):
    method to_json (line 48) | def to_json(self):
    method from_json (line 52) | def from_json(cls, json_data):
    method add_or_update (line 65) | def add_or_update(session: Session, toolkit_id: int, key: str, value: ...
    method get_toolkit_tool_config (line 105) | def get_toolkit_tool_config(cls, session: Session, toolkit_id: int):

FILE: superagi/models/toolkit.py
  class Toolkit (line 13) | class Toolkit(DBBaseModel):
    method __repr__ (line 33) | def __repr__(self):
    method to_dict (line 38) | def to_dict(self):
    method to_json (line 47) | def to_json(self):
    method from_json (line 51) | def from_json(cls, json_data):
    method add_or_update (line 62) | def add_or_update(session, name, description, show_toolkit, organisati...
    method fetch_marketplace_list (line 91) | def fetch_marketplace_list(cls, page):
    method fetch_marketplace_detail (line 102) | def fetch_marketplace_detail(cls, search_str, toolkit_name):
    method get_toolkit_from_name (line 115) | def get_toolkit_from_name(session, toolkit_name, organisation):
    method get_toolkit_installed_details (line 122) | def get_toolkit_installed_details(cls, session, marketplace_toolkits, ...
    method fetch_tool_ids_from_toolkit (line 132) | def fetch_tool_ids_from_toolkit(cls, session, toolkit_ids):
    method get_tool_and_toolkit_arr (line 143) | def get_tool_and_toolkit_arr(cls, session, organisation_id :int,agent_...

FILE: superagi/models/types/agent_config.py
  class AgentConfig (line 4) | class AgentConfig(BaseModel):
    method __repr__ (line 9) | def __repr__(self):

FILE: superagi/models/types/login_request.py
  class LoginRequest (line 4) | class LoginRequest(BaseModel):

FILE: superagi/models/types/validate_llm_api_key_request.py
  class ValidateAPIKeyRequest (line 4) | class ValidateAPIKeyRequest(BaseModel):

FILE: superagi/models/user.py
  class User (line 8) | class User(DBBaseModel):
    method __repr__ (line 29) | def __repr__(self):

FILE: superagi/models/vector_db_configs.py
  class VectordbConfigs (line 6) | class VectordbConfigs(DBBaseModel):
    method __repr__ (line 23) | def __repr__(self):
    method get_vector_db_config_from_db_id (line 32) | def get_vector_db_config_from_db_id(cls, session, vector_db_id):
    method add_vector_db_config (line 40) | def add_vector_db_config(cls, session, vector_db_id, db_creds):
    method delete_vector_db_configs (line 47) | def delete_vector_db_configs(cls, session, vector_db_id):

FILE: superagi/models/vector_db_indices.py
  class VectordbIndices (line 9) | class VectordbIndices(DBBaseModel):
    method __repr__ (line 26) | def __repr__(self):
    method get_vector_index_from_id (line 35) | def get_vector_index_from_id(cls, session, vector_db_index_id):
    method get_vector_indices_from_vectordb (line 40) | def get_vector_indices_from_vectordb(cls, session, vector_db_id):
    method delete_vector_db_index (line 45) | def delete_vector_db_index(cls, session, vector_index_id):
    method add_vector_index (line 50) | def add_vector_index(cls, session, index_name, vector_db_id, state, di...
    method update_vector_index_state (line 56) | def update_vector_index_state(cls, session, index_id, state):

FILE: superagi/models/vector_dbs.py
  class Vectordbs (line 12) | class Vectordbs(DBBaseModel):
    method __repr__ (line 29) | def __repr__(self):
    method get_vector_db_from_id (line 38) | def get_vector_db_from_id(cls, session, vector_db_id):
    method fetch_marketplace_list (line 43) | def fetch_marketplace_list(cls):
    method get_vector_db_from_organisation (line 54) | def get_vector_db_from_organisation(cls, session, organisation):
    method add_vector_db (line 59) | def add_vector_db(cls, session, name, db_type, organisation):
    method delete_vector_db (line 66) | def delete_vector_db(cls, session, vector_db_id):

FILE: superagi/models/webhook_events.py
  class WebhookEvents (line 7) | class WebhookEvents(DBBaseModel):

FILE: superagi/models/webhooks.py
  class Webhooks (line 7) | class Webhooks(DBBaseModel):

FILE: superagi/models/workflows/agent_workflow.py
  class AgentWorkflow (line 9) | class AgentWorkflow(DBBaseModel):
    method __repr__ (line 25) | def __repr__(self):
    method to_dict (line 36) | def to_dict(self):
    method to_json (line 50) | def to_json(self):
    method from_json (line 61) | def from_json(cls, json_data):
    method fetch_trigger_step_id (line 80) | def fetch_trigger_step_id(cls, session, workflow_id):
    method find_by_id (line 97) | def find_by_id(cls, session, id: int):
    method find_by_name (line 103) | def find_by_name(cls, session, name: str):
    method find_or_create_by_name (line 108) | def find_or_create_by_name(cls, session, name: str, description: str):

FILE: superagi/models/workflows/agent_workflow_step.py
  class AgentWorkflowStep (line 13) | class AgentWorkflowStep(DBBaseModel):
    method __repr__ (line 37) | def __repr__(self):
    method to_dict (line 49) | def to_dict(self):
    method to_json (line 67) | def to_json(self):
    method from_json (line 78) | def from_json(cls, json_data):
    method find_by_unique_id (line 101) | def find_by_unique_id(cls, session, unique_id: str):
    method find_by_id (line 106) | def find_by_id(cls, session, step_id: int):
    method find_or_create_tool_workflow_step (line 111) | def find_or_create_tool_workflow_step(cls, session, agent_workflow_id:...
    method find_or_create_wait_workflow_step (line 154) | def find_or_create_wait_workflow_step(cls, session, agent_workflow_id:...
    method find_or_create_iteration_workflow_step (line 177) | def find_or_create_iteration_workflow_step(cls, session, agent_workflo...
    method add_next_workflow_step (line 210) | def add_next_workflow_step(cls, session, current_agent_step_id: int, n...
    method fetch_default_next_step (line 238) | def fetch_default_next_step(cls, session, current_agent_step_id: int):
    method fetch_next_step (line 253) | def fetch_next_step(cls, session, current_agent_step_id: int, step_res...

FILE: superagi/models/workflows/agent_workflow_step_tool.py
  class AgentWorkflowStepTool (line 9) | class AgentWorkflowStepTool(DBBaseModel):
    method __repr__ (line 32) | def __repr__(self):
    method to_dict (line 43) | def to_dict(self):
    method to_json (line 60) | def to_json(self):
    method from_json (line 71) | def from_json(cls, json_data):
    method find_by_id (line 93) | def find_by_id(cls, session, step_id: int):
    method find_or_create_tool (line 97) | def find_or_create_tool(cls, session, step_unique_id: str, tool_name: ...

FILE: superagi/models/workflows/agent_workflow_step_wait.py
  class AgentWorkflowStepWait (line 8) | class AgentWorkflowStepWait(DBBaseModel):
    method __repr__ (line 30) | def __repr__(self):
    method to_dict (line 41) | def to_dict(self):
    method to_json (line 56) | def to_json(self):
    method find_by_id (line 67) | def find_by_id(cls, session, step_id: int):
    method find_or_create_wait (line 71) | def find_or_create_wait(cls, session, step_unique_id: str, description...

FILE: superagi/models/workflows/iteration_workflow.py
  class IterationWorkflow (line 9) | class IterationWorkflow(DBBaseModel):
    method __repr__ (line 26) | def __repr__(self):
    method to_dict (line 37) | def to_dict(self):
    method to_json (line 51) | def to_json(self):
    method from_json (line 62) | def from_json(cls, json_data):
    method fetch_trigger_step_id (line 81) | def fetch_trigger_step_id(cls, session, workflow_id):
    method find_workflow_by_name (line 100) | def find_workflow_by_name(cls, session, name: str):
    method find_or_create_by_name (line 114) | def find_or_create_by_name(cls, session, name: str, description: str, ...
    method find_by_id (line 134) | def find_by_id(cls, session, id: int):

FILE: superagi/models/workflows/iteration_workflow_step.py
  class IterationWorkflowStep (line 9) | class IterationWorkflowStep(DBBaseModel):
    method __repr__ (line 39) | def __repr__(self):
    method to_dict (line 50) | def to_dict(self):
    method to_json (line 65) | def to_json(self):
    method from_json (line 76) | def from_json(cls, json_data):
    method find_by_id (line 96) | def find_by_id(cls, session, step_id: int):
    method find_or_create_step (line 100) | def find_or_create_step(self, session, iteration_workflow_id: int, uni...

FILE: superagi/resource_manager/file_manager.py
  class FileManager (line 11) | class FileManager:
    method __init__ (line 12) | def __init__(self, session: Session, agent_id: int = None, agent_execu...
    method write_binary_file (line 16) | def write_binary_file(self, file_name: str, data):
    method write_to_s3 (line 35) | def write_to_s3(self, file_name, final_path):
    method write_file (line 48) | def write_file(self, file_name: str, content):
    method write_csv_file (line 67) | def write_csv_file(self, file_name: str, csv_data):
    method get_agent_resource_path (line 88) | def get_agent_resource_path(self, file_name: str):
    method read_file (line 94) | def read_file(self, file_name: str):
    method get_files (line 107) | def get_files(self):

FILE: superagi/resource_manager/llama_document_summary.py
  class LlamaDocumentSummary (line 9) | class LlamaDocumentSummary:
    method __init__ (line 10) | def __init__(self, model_name=get_config("RESOURCES_SUMMARY_MODEL_NAME...
    method generate_summary_of_document (line 15) | def generate_summary_of_document(self, documents: list[Document]):
    method generate_summary_of_texts (line 37) | def generate_summary_of_texts(self, texts: list[str]):
    method _build_llm (line 50) | def _build_llm(self):

FILE: superagi/resource_manager/llama_vector_store_factory.py
  class LlamaVectorStoreFactory (line 7) | class LlamaVectorStoreFactory:
    method __init__ (line 16) | def __init__(self, vector_store_name: VectorStoreType, index_name: str):
    method get_vector_store (line 20) | def get_vector_store(self) -> VectorStore:

FILE: superagi/resource_manager/resource_manager.py
  class ResourceManager (line 15) | class ResourceManager:
    method __init__ (line 22) | def __init__(self, agent_id: str = None):
    method create_llama_document (line 25) | def create_llama_document(self, file_path: str):
    method create_llama_document_s3 (line 38) | def create_llama_document_s3(self, file_path: str):
    method save_document_to_vector_store (line 72) | def save_document_to_vector_store(self, documents: list, resource_id: ...

FILE: superagi/resource_manager/resource_summary.py
  class ResourceSummarizer (line 13) | class ResourceSummarizer:
    method __init__ (line 16) | def __init__(self, session, agent_id: int, model: str):
    method __get_organisation_id (line 22) | def __get_organisation_id(self):
    method __get_model_api_key (line 27) | def __get_model_api_key(self):
    method __get_model_source (line 30) | def __get_model_source(self):
    method add_to_vector_store_and_create_summary (line 33) | def add_to_vector_store_and_create_summary(self, resource_id: int, doc...
    method generate_agent_summary (line 50) | def generate_agent_summary(self, generate_all: bool = False) -> str:
    method fetch_or_create_agent_resource_summary (line 80) | def fetch_or_create_agent_resource_summary(self, default_summary: str):

FILE: superagi/tool_manager.py
  function parse_github_url (line 9) | def parse_github_url(github_url):
  function download_tool (line 17) | def download_tool(tool_url, target_folder):
  function download_marketplace_tool (line 53) | def download_marketplace_tool(tool_url, target_folder):
  function get_marketplace_tool_links (line 76) | def get_marketplace_tool_links(repo_url):
  function update_tools_json (line 91) | def update_tools_json(existing_tools_json_path, folder_links):
  function load_tools_config (line 101) | def load_tools_config():
  function load_marketplace_tools (line 108) | def load_marketplace_tools():
  function is_marketplace_url (line 118) | def is_marketplace_url(url):
  function download_and_extract_tools (line 121) | def download_and_extract_tools():

FILE: superagi/tools/apollo/apollo_search.py
  class ApolloSearchSchema (line 11) | class ApolloSearchSchema(BaseModel):
  class ApolloSearchTool (line 38) | class ApolloSearchTool(BaseTool):
    class Config (line 54) | class Config:
    method _execute (line 57) | def _execute(self, person_titles: list[str], page: int = 1, per_page: ...
    method apollo_search_results (line 89) | def apollo_search_results(self, page, per_page, person_titles, num_of_...

FILE: superagi/tools/apollo/apollo_toolkit.py
  class ApolloToolkit (line 9) | class ApolloToolkit(BaseToolkit, ABC):
    method get_tools (line 13) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 16) | def get_env_keys(self) -> List[str]:

FILE: superagi/tools/base_tool.py
  class SchemaSettings (line 16) | class SchemaSettings:
  function extract_valid_parameters (line 22) | def extract_valid_parameters(
  function _construct_model_subset (line 32) | def _construct_model_subset(
  function create_function_schema (line 47) | def create_function_schema(
  class BaseToolkitConfiguration (line 62) | class BaseToolkitConfiguration:
    method __init__ (line 64) | def __init__(self):
    method get_tool_config (line 67) | def get_tool_config(self, key: str):
  class BaseTool (line 76) | class BaseTool(BaseModel):
    class Config (line 83) | class Config:
    method args (line 87) | def args(self):
    method _execute (line 96) | def _execute(self, *args: Any, **kwargs: Any):
    method max_token_limit (line 100) | def max_token_limit(self):
    method _parse_input (line 103) | def _parse_input(
    method _to_args_and_kwargs (line 120) | def _to_args_and_kwargs(self, tool_input: Union[str, Dict]) -> Tuple[T...
    method execute (line 128) | def execute(
    method from_function (line 146) | def from_function(cls, func: Callable, args_schema: Type[BaseModel] = ...
    method get_tool_config (line 152) | def get_tool_config(self, key):
  class FunctionalTool (line 156) | class FunctionalTool(BaseTool):
    method args (line 163) | def args(self):
    method _execute (line 171) | def _execute(self, *args: Any, **kwargs: Any):
    method from_function (line 175) | def from_function(cls, func: Callable, args_schema: Type[BaseModel] = ...
    method registerTool (line 181) | def registerTool(cls):
  function tool (line 186) | def tool(*args: Union[str, Callable], return_direct: bool = False,
  class ToolConfiguration (line 207) | class ToolConfiguration:
    method __init__ (line 209) | def __init__(self, key: str, key_type: str = None, is_required: bool =...
  class BaseToolkit (line 232) | class BaseToolkit(BaseModel):
    method get_tools (line 237) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 242) | def get_env_keys(self) -> List[str]:

FILE: superagi/tools/code/coding_toolkit.py
  class CodingToolkit (line 11) | class CodingToolkit(BaseToolkit, ABC):
    method get_tools (line 15) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 18) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/code/improve_code.py
  class ImproveCodeSchema (line 19) | class ImproveCodeSchema(BaseModel):
  class ImproveCodeTool (line 23) | class ImproveCodeTool(BaseTool):
    class Config (line 45) | class Config:
    method _execute (line 48) | def _execute(self) -> str:

FILE: superagi/tools/code/write_code.py
  class CodingSchema (line 19) | class CodingSchema(BaseModel):
  class CodingTool (line 26) | class CodingTool(BaseTool):
    class Config (line 54) | class Config:
    method _execute (line 57) | def _execute(self, code_description: str) -> str:

FILE: superagi/tools/code/write_spec.py
  class WriteSpecSchema (line 17) | class WriteSpecSchema(BaseModel):
  class WriteSpecTool (line 29) | class WriteSpecTool(BaseTool):
    class Config (line 52) | class Config:
    method _execute (line 55) | def _execute(self, task_description: str, spec_file_name: str) -> str:

FILE: superagi/tools/code/write_test.py
  class WriteTestSchema (line 19) | class WriteTestSchema(BaseModel):
  class WriteTestTool (line 30) | class WriteTestTool(BaseTool):
    class Config (line 57) | class Config:
    method _execute (line 60) | def _execute(self, test_description: str, test_file_name: str) -> str:

FILE: superagi/tools/duck_duck_go/duck_duck_go_search.py
  class DuckDuckGoSearchSchema (line 22) | class DuckDuckGoSearchSchema(BaseModel):
  class DuckDuckGoSearchTool (line 28) | class DuckDuckGoSearchTool(BaseTool):
    class Config (line 47) | class Config:
    method _execute (line 50) | def _execute(self, query: str) -> tuple:
    method get_formatted_webpages (line 81) | def get_formatted_webpages(self,search_results,webpages):
    method get_content_from_url (line 103) | def get_content_from_url(self,links):
    method get_raw_duckduckgo_results (line 130) | def get_raw_duckduckgo_results(self,query):
    method summarise_result (line 156) | def summarise_result(self, query, snippets):

FILE: superagi/tools/duck_duck_go/duck_duck_go_search_toolkit.py
  class DuckDuckGoToolkit (line 8) | class DuckDuckGoToolkit(BaseToolkit, ABC):
    method get_tools (line 12) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 15) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/email/email_toolkit.py
  class EmailToolkit (line 10) | class EmailToolkit(BaseToolkit, ABC):
    method get_tools (line 14) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 17) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/email/read_email.py
  class ReadEmailInput (line 13) | class ReadEmailInput(BaseModel):
  class ReadEmailTool (line 20) | class ReadEmailTool(BaseTool):
    method _execute (line 33) | def _execute(self, imap_folder: str = "INBOX", page: int = 0, limit: i...
    method _process_message (line 71) | def _process_message(self, email_msg, response):

FILE: superagi/tools/email/send_email.py
  class SendEmailInput (line 12) | class SendEmailInput(BaseModel):
  class SendEmailTool (line 18) | class SendEmailTool(BaseTool):
    method _execute (line 31) | def _execute(self, to: str, subject: str, body: str) -> str:

FILE: superagi/tools/email/send_email_attachment.py
  class SendEmailAttachmentInput (line 25) | class SendEmailAttachmentInput(BaseModel):
  class SendEmailAttachmentTool (line 32) | class SendEmailAttachmentTool(BaseTool):
    method _execute (line 47) | def _execute(self, to: str, subject: str, body: str, filename: str) ->...
    method send_email_with_attachment (line 84) | def send_email_with_attachment(self, to, subject, body, attachment) ->...

FILE: superagi/tools/file/append_file.py
  class AppendFileInput (line 15) | class AppendFileInput(BaseModel):
  class AppendFileTool (line 21) | class AppendFileTool(BaseTool):
    method _execute (line 38) | def _execute(self, file_name: str, content: str):
    method get_previous_content (line 76) | def get_previous_content(self, final_path):

FILE: superagi/tools/file/delete_file.py
  class DeleteFileInput (line 15) | class DeleteFileInput(BaseModel):
  class DeleteFileTool (line 20) | class DeleteFileTool(BaseTool):
    method _execute (line 36) | def _execute(self, file_name: str):

FILE: superagi/tools/file/file_toolkit.py
  class FileToolkit (line 13) | class FileToolkit(BaseToolkit, ABC):
    method get_tools (line 17) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 20) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/file/list_files.py
  class ListFileInput (line 14) | class ListFileInput(BaseModel):
  class ListFileTool (line 18) | class ListFileTool(BaseTool):
    method _execute (line 33) | def _execute(self):
    method list_files (line 57) | def list_files(self, directory):

FILE: superagi/tools/file/read_file.py
  class ReadFileSchema (line 22) | class ReadFileSchema(BaseModel):
  class ReadFileTool (line 27) | class ReadFileTool(BaseTool):
    method _execute (line 43) | def _execute(self, file_name: str):

FILE: superagi/tools/file/write_file.py
  class WriteFileInput (line 13) | class WriteFileInput(BaseModel):
  class WriteFileTool (line 19) | class WriteFileTool(BaseTool):
    class Config (line 36) | class Config:
    method _execute (line 39) | def _execute(self, file_name: str, content: str):

FILE: superagi/tools/github/add_file.py
  class GithubAddFileSchema (line 9) | class GithubAddFileSchema(BaseModel):
  class GithubAddFileTool (line 37) | class GithubAddFileTool(BaseTool):
    method _execute (line 52) | def _execute(self, repository_name: str, base_branch: str, commit_mess...

FILE: superagi/tools/github/delete_file.py
  class GithubDeleteFileSchema (line 9) | class GithubDeleteFileSchema(BaseModel):
  class GithubDeleteFileTool (line 37) | class GithubDeleteFileTool(BaseTool):
    method _execute (line 50) | def _execute(self, repository_name: str, base_branch: str, file_name: ...

FILE: superagi/tools/github/fetch_pull_request.py
  class GithubFetchPullRequestSchema (line 10) | class GithubFetchPullRequestSchema(BaseModel):
  class GithubFetchPullRequest (line 25) | class GithubFetchPullRequest(BaseTool):
    method _execute (line 43) | def _execute(self, repository_name: str, repository_owner: str, time_i...

FILE: superagi/tools/github/github_toolkit.py
  class GitHubToolkit (line 12) | class GitHubToolkit(BaseToolkit, ABC):
    method get_tools (line 16) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 20) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/github/review_pull_request.py
  class GithubReviewPullRequestSchema (line 18) | class GithubReviewPullRequestSchema(BaseModel):
  class GithubReviewPullRequest (line 33) | class GithubReviewPullRequest(BaseTool):
    method _execute (line 49) | def _execute(self, repository_name: str, repository_owner: str, pull_r...
    method run_code_review (line 84) | def run_code_review(self, github_helper, content, latest_commit_id, or...
    method split_pull_request_content_into_multiple_parts (line 109) | def split_pull_request_content_into_multiple_parts(self, model_token_l...
    method get_exact_line_number (line 126) | def get_exact_line_number(self, diff_content, file_path, line_number):
    method find_position_in_diff (line 131) | def find_position_in_diff(self, diff_content, target_line):

FILE: superagi/tools/github/search_repo.py
  class GithubSearchRepoSchema (line 8) | class GithubSearchRepoSchema(BaseModel):
  class GithubRepoSearchTool (line 27) | class GithubRepoSearchTool(BaseTool):
    method _execute (line 42) | def _execute(self, repository_owner: str, repository_name: str, file_n...

FILE: superagi/tools/google_calendar/create_calendar_event.py
  class CreateEventCalendarInput (line 9) | class CreateEventCalendarInput(BaseModel):
  class CreateEventCalendarTool (line 19) | class CreateEventCalendarTool(BaseTool):
    method _execute (line 24) | def _execute(self, event_name: str, description: str, attendees: list,...

FILE: superagi/tools/google_calendar/delete_calendar_event.py
  class DeleteCalendarEventInput (line 9) | class DeleteCalendarEventInput(BaseModel):
  class DeleteCalendarEventTool (line 12) | class DeleteCalendarEventTool(BaseTool):
    method _execute (line 19) | def _execute(self, event_id: str):

FILE: superagi/tools/google_calendar/event_details_calendar.py
  class EventDetailsCalendarInput (line 9) | class EventDetailsCalendarInput(BaseModel):
  class EventDetailsCalendarTool (line 12) | class EventDetailsCalendarTool(BaseTool):
    method _execute (line 17) | def _execute(self, event_id: str):

FILE: superagi/tools/google_calendar/google_calendar_toolkit.py
  class GoogleCalendarToolKit (line 10) | class GoogleCalendarToolKit(BaseToolkit, ABC):
    method get_tools (line 14) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 17) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/google_calendar/list_calendar_events.py
  class ListCalendarEventsInput (line 18) | class ListCalendarEventsInput(BaseModel):
  class ListCalendarEventsTool (line 25) | class ListCalendarEventsTool(BaseTool):
    method _execute (line 32) | def _execute(self, start_time: str = 'None', start_date: str = 'None',...
    method get_google_calendar_service (line 48) | def get_google_calendar_service(self):
    method get_event_results (line 51) | def get_event_results(self, service, date_utc):
    method generate_csv_data (line 62) | def generate_csv_data(self, event_results):
    method parse_event_data (line 69) | def parse_event_data(self, item):
    method create_output_file (line 81) | def create_output_file(self):

FILE: superagi/tools/google_search/google_search.py
  class GoogleSearchSchema (line 14) | class GoogleSearchSchema(BaseModel):
  class GoogleSearchTool (line 20) | class GoogleSearchTool(BaseTool):
    class Config (line 39) | class Config:
    method _execute (line 42) | def _execute(self, query: str) -> tuple:
    method summarise_result (line 74) | def summarise_result(self, query, snippets):

FILE: superagi/tools/google_search/google_search_toolkit.py
  class GoogleSearchToolkit (line 9) | class GoogleSearchToolkit(BaseToolkit, ABC):
    method get_tools (line 13) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 16) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/google_serp_search/google_serp_search.py
  class GoogleSerpSchema (line 15) | class GoogleSerpSchema(BaseModel):
  class GoogleSerpTool (line 23) | class GoogleSerpTool(BaseTool):
    class Config (line 42) | class Config:
    method _execute (line 45) | def _execute(self, query: str) -> tuple:
    method summarise_result (line 63) | def summarise_result(self, query, snippets):

FILE: superagi/tools/google_serp_search/google_serp_search_toolkit.py
  class GoogleSerpToolkit (line 8) | class GoogleSerpToolkit(BaseToolkit, ABC):
    method get_tools (line 12) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 15) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/image_generation/dalle_image_gen.py
  class DalleImageGenInput (line 13) | class DalleImageGenInput(BaseModel):
  class DalleImageGenTool (line 20) | class DalleImageGenTool(BaseTool):
    method _execute (line 41) | def _execute(self, prompt: str, image_names: list, size: int = 512, nu...

FILE: superagi/tools/image_generation/image_generation_toolkit.py
  class ImageGenToolkit (line 9) | class ImageGenToolkit(BaseToolkit, ABC):
    method get_tools (line 13) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 16) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/image_generation/stable_diffusion_image_gen.py
  class StableDiffusionImageGenInput (line 15) | class StableDiffusionImageGenInput(BaseModel):
  class StableDiffusionImageGenTool (line 25) | class StableDiffusionImageGenTool(BaseTool):
    class Config (line 43) | class Config:
    method _execute (line 46) | def _execute(self, prompt: str, image_names: list, width: int = 512, h...
    method call_stable_diffusion (line 76) | def call_stable_diffusion(self, api_key, width, height, num, prompt, s...

FILE: superagi/tools/instagram_tool/instagram.py
  class InstagramSchema (line 23) | class InstagramSchema(BaseModel):
  class InstagramTool (line 31) | class InstagramTool(BaseTool):
    class Config (line 50) | class Config:
    method _execute (line 53) | def _execute(self, photo_description: str, filename: str) -> str:
    method create_caption (line 102) | def create_caption(self, photo_description: str) -> str:
    method get_file_path (line 127) | def get_file_path(self, session, file_name, agent_id, agent_execution_...
    method get_img_public_url (line 144) | def get_img_public_url(self,filename,content):
    method get_img_url_and_encoded_caption (line 162) | def get_img_url_and_encoded_caption(self,photo_description,file_path,f...
    method get_req_insta_id (line 175) | def get_req_insta_id(self,root_api_url,facebook_page_id,meta_user_acce...
    method post_media_container_id (line 183) | def post_media_container_id(self,root_api_url,insta_business_account_i...
    method post_media (line 191) | def post_media(self,root_api_url,insta_business_account_id,container_I...
    method _get_image_content (line 199) | def _get_image_content(self, file_path):

FILE: superagi/tools/instagram_tool/instagram_toolkit.py
  class InstagramToolkit (line 7) | class InstagramToolkit(BaseToolkit, ABC):
    method get_tools (line 11) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 14) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/jira/create_issue.py
  class CreateIssueSchema (line 8) | class CreateIssueSchema(BaseModel):
  class CreateIssueTool (line 15) | class CreateIssueTool(JiraTool):
    method _execute (line 28) | def _execute(self, fields: dict):

FILE: superagi/tools/jira/edit_issue.py
  class EditIssueSchema (line 8) | class EditIssueSchema(BaseModel):
  class EditIssueTool (line 19) | class EditIssueTool(JiraTool):
    method _execute (line 32) | def _execute(self, key: str, fields: dict):

FILE: superagi/tools/jira/get_projects.py
  class GetProjectsSchema (line 7) | class GetProjectsSchema(BaseModel):
  class GetProjectsTool (line 11) | class GetProjectsTool(JiraTool):
    method parse_projects (line 24) | def parse_projects(self, projects: List[dict]) -> List[dict]:
    method _execute (line 30) | def _execute(self) -> str:

FILE: superagi/tools/jira/jira_toolkit.py
  class JiraToolkit (line 12) | class JiraToolkit(BaseToolkit, ABC):
    method get_tools (line 16) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 24) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/jira/search_issues.py
  class SearchIssueSchema (line 10) | class SearchIssueSchema(BaseModel):
  class SearchJiraTool (line 17) | class SearchJiraTool(JiraTool):
    method _execute (line 30) | def _execute(self, query: str) -> str:
    method parse_issues (line 51) | def parse_issues(self, issues: List) -> List[dict]:

FILE: superagi/tools/jira/tool.py
  class JiraIssueSchema (line 11) | class JiraIssueSchema(BaseModel):
  class JiraTool (line 22) | class JiraTool(BaseTool):
    method build_jira_instance (line 31) | def build_jira_instance(self) -> dict:

FILE: superagi/tools/knowledge_search/knowledge_search.py
  class KnowledgeSearchSchema (line 20) | class KnowledgeSearchSchema(BaseModel):
  class KnowledgeSearchTool (line 24) | class KnowledgeSearchTool(BaseTool):
    method _execute (line 36) | def _execute(self, query: str):

FILE: superagi/tools/knowledge_search/knowledge_search_toolkit.py
  class KnowledgeSearchToolkit (line 7) | class KnowledgeSearchToolkit(BaseToolkit, ABC):
    method get_tools (line 11) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 14) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/resource/query_resource.py
  class QueryResource (line 20) | class QueryResource(BaseModel):
  class QueryResourceTool (line 25) | class QueryResourceTool(BaseTool):
    method _execute (line 42) | def _execute(self, query: str):

FILE: superagi/tools/resource/resource_toolkit.py
  class JiraToolkit (line 8) | class JiraToolkit(BaseToolkit, ABC):
    method get_tools (line 12) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 17) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/searx/search_scraper.py
  class SearchResult (line 11) | class SearchResult(BaseModel):
    method __str__ (line 28) | def __str__(self):
  function search (line 32) | def search(query):
  function clean_whitespace (line 50) | def clean_whitespace(s: str):
  function scrape_results (line 63) | def scrape_results(html):
  function search_results (line 108) | def search_results(query):

FILE: superagi/tools/searx/searx.py
  class SearxSearchSchema (line 11) | class SearxSearchSchema(BaseModel):
  class SearxSearchTool (line 17) | class SearxSearchTool(BaseTool):
    class Config (line 36) | class Config:
    method _execute (line 39) | def _execute(self, query: str) -> tuple:
    method summarise_result (line 54) | def summarise_result(self, query, snippets):

FILE: superagi/tools/searx/searx_toolkit.py
  class SearxSearchToolkit (line 8) | class SearxSearchToolkit(BaseToolkit, ABC):
    method get_tools (line 13) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 16) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/slack/send_message.py
  class SlackMessageSchema (line 10) | class SlackMessageSchema(BaseModel):
  class SlackMessageTool (line 21) | class SlackMessageTool(BaseTool):
    method _execute (line 38) | def _execute(self, channel: str, message: str):
    method build_slack_web_client (line 57) | def build_slack_web_client(self):

FILE: superagi/tools/slack/slack_toolkit.py
  class SlackToolkit (line 8) | class SlackToolkit(BaseToolkit, ABC):
    method get_tools (line 12) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 17) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/thinking/thinking_toolkit.py
  class ThinkingToolkit (line 8) | class ThinkingToolkit(BaseToolkit, ABC):
    method get_tools (line 12) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 17) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/thinking/tools.py
  class ThinkingSchema (line 16) | class ThinkingSchema(BaseModel):
  class ThinkingTool (line 22) | class ThinkingTool(BaseTool):
    class Config (line 44) | class Config:
    method _execute (line 48) | def _execute(self, task_description: str):

FILE: superagi/tools/tool_response_query_manager.py
  class ToolResponseQueryManager (line 6) | class ToolResponseQueryManager:
    method __init__ (line 7) | def __init__(self, session: Session, agent_execution_id: int,memory:Ve...
    method get_last_response (line 12) | def get_last_response(self, tool_name: str = None):
    method get_relevant_response (line 15) | def get_relevant_response(self, query: str,metadata:dict, top_k: int =...

FILE: superagi/tools/twitter/send_tweets.py
  class SendTweetsInput (line 10) | class SendTweetsInput(BaseModel):
  class SendTweetsTool (line 17) | class SendTweetsTool(BaseTool):
    method _execute (line 24) | def _execute(self, is_media: bool, tweet_text: str = 'None', media_fil...

FILE: superagi/tools/twitter/twitter_toolkit.py
  class TwitterToolkit (line 7) | class TwitterToolkit(BaseToolkit, ABC):
    method get_tools (line 11) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 14) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/tools/webscaper/tools.py
  class WebScraperSchema (line 10) | class WebScraperSchema(BaseModel):
  class WebScraperTool (line 17) | class WebScraperTool(BaseTool):
    class Config (line 33) | class Config:
    method _execute (line 36) | def _execute(self, website_url: str) -> tuple:

FILE: superagi/tools/webscaper/web_scraper_toolkit.py
  class WebScrapperToolkit (line 7) | class WebScrapperToolkit(BaseToolkit, ABC):
    method get_tools (line 11) | def get_tools(self) -> List[BaseTool]:
    method get_env_keys (line 16) | def get_env_keys(self) -> List[ToolConfiguration]:

FILE: superagi/types/common.py
  class BaseMessage (line 5) | class BaseMessage(BaseModel):
    method type (line 13) | def type(self) -> str:
  class HumanMessage (line 17) | class HumanMessage(BaseMessage):
    method type (line 23) | def type(self) -> str:
  class AIMessage (line 27) | class AIMessage(BaseMessage):
    method type (line 33) | def type(self) -> str:
  class SystemMessage (line 37) | class SystemMessage(BaseMessage):
    method type (line 41) | def type(self) -> str:
  class GitHubLinkRequest (line 45) | class GitHubLinkRequest(BaseModel):

FILE: superagi/types/key_type.py
  class ToolConfigKeyType (line 3) | class ToolConfigKeyType(Enum):
    method get_key_type (line 9) | def get_key_type(cls, store):
    method __str__ (line 15) | def __str__(self):

FILE: superagi/types/model_source_types.py
  class ModelSourceType (line 4) | class ModelSourceType(Enum):
    method get_model_source_type (line 12) | def get_model_source_type(cls, name):
    method get_model_source_from_model (line 20) | def get_model_source_from_model(cls, model_name: str):
    method __str__ (line 32) | def __str__(self):

FILE: superagi/types/queue_status.py
  class QueueStatus (line 4) | class QueueStatus(Enum):
    method get_queue_type (line 10) | def get_queue_type(cls, store):

FILE: superagi/types/storage_types.py
  class StorageType (line 4) | class StorageType(Enum):
    method get_storage_type (line 9) | def get_storage_type(cls, store):

FILE: superagi/types/vector_store_types.py
  class VectorStoreType (line 4) | class VectorStoreType(Enum):
    method get_vector_store_type (line 13) | def get_vector_store_type(cls, store):
    method __str__ (line 19) | def __str__(self):

FILE: superagi/vector_embeddings/base.py
  class VectorEmbeddings (line 5) | class VectorEmbeddings(ABC):
    method get_vector_embeddings_from_chunks (line 8) | def get_vector_embeddings_from_chunks(

FILE: superagi/vector_embeddings/pinecone.py
  class Pinecone (line 4) | class Pinecone(VectorEmbeddings):
    method __init__ (line 6) | def __init__(self, uuid, embeds, metadata):
    method get_vector_embeddings_from_chunks (line 11) | def get_vector_embeddings_from_chunks(self):

FILE: superagi/vector_embeddings/qdrant.py
  class Qdrant (line 4) | class Qdrant(VectorEmbeddings):
    method __init__ (line 6) | def __init__(self, uuid, embeds, metadata):
    method get_vector_embeddings_from_chunks (line 11) | def get_vector_embeddings_from_chunks(self):

FILE: superagi/vector_embeddings/vector_embedding_factory.py
  class VectorEmbeddingFactory (line 10) | class VectorEmbeddingFactory:
    method build_vector_storage (line 13) | def build_vector_storage(cls, vector_store: VectorStoreType, chunk_jso...

FILE: superagi/vector_embeddings/weaviate.py
  class Weaviate (line 4) | class Weaviate(VectorEmbeddings):
    method __init__ (line 6) | def __init__(self, uuid, embeds, metadata):
    method get_vector_embeddings_from_chunks (line 11) | def get_vector_embeddings_from_chunks(self):

FILE: superagi/vector_store/base.py
  class VectorStore (line 7) | class VectorStore(ABC):
    method add_texts (line 9) | def add_texts(
    method get_matching_text (line 18) | def get_matching_text(self, query: str, top_k: int, metadata: Optional...
    method add_documents (line 21) | def add_documents(self, documents: List[Document], **kwargs: Any) -> L...
    method get_index_stats (line 29) | def get_index_stats(self) -> dict:
    method add_embeddings_to_vector_db (line 33) | def add_embeddings_to_vector_db(self, embeddings: dict) -> None:
    method delete_embeddings_from_vector_db (line 37) | def delete_embeddings_from_vector_db(self,ids: List[str]) -> None:

FILE: superagi/vector_store/chromadb.py
  function _build_chroma_client (line 12) | def _build_chroma_client():
  class ChromaDB (line 19) | class ChromaDB(VectorStore):
    method __init__ (line 20) | def __init__(
    method create_collection (line 34) | def create_collection(cls, collection_name):
    method add_texts (line 42) | def add_texts(
    method get_matching_text (line 73) | def get_matching_text(self, query: str, top_k: int = 5, metadata: Opti...
    method get_index_stats (line 103) | def get_index_stats(self) -> dict:
    method add_embeddings_to_vector_db (line 106) | def add_embeddings_to_vector_db(self, embeddings: dict) -> None:
    method delete_embeddings_from_vector_db (line 109) | def delete_embeddings_from_vector_db(self, ids: List[str]) -> None:

FILE: superagi/vector_store/document.py
  class Document (line 4) | class Document(BaseModel):
    method __init__ (line 10) | def __init__(self, text_content, *args, **kwargs):

FILE: superagi/vector_store/embedding/base.py
  class BaseEmbedding (line 4) | class BaseEmbedding(ABC):
    method get_embedding (line 7) | def get_embedding(self, text):

FILE: superagi/vector_store/embedding/openai.py
  class OpenAiEmbedding (line 4) | class OpenAiEmbedding:
    method __init__ (line 5) | def __init__(self, api_key, model="text-embedding-ada-002"):
    method get_embedding_async (line 9) | async def get_embedding_async(self, text: str):
    method get_embedding (line 21) | def get_embedding(self, text):

FILE: superagi/vector_store/embedding/palm.py
  class PalmEmbedding (line 5) | class PalmEmbedding:
    method __init__ (line 6) | def __init__(self, api_key, model="models/embedding-gecko-001"):
    method get_embedding (line 10) | def get_embedding(self, text):

FILE: superagi/vector_store/pinecone.py
  class Pinecone (line 10) | class Pinecone(VectorStore):
    method __init__ (line 20) | def __init__(
    method add_texts (line 40) | def add_texts(
    method get_matching_text (line 79) | def get_matching_text(self, query: str, top_k: int = 5, metadata: Opti...
    method get_index_stats (line 103) | def get_index_stats(self) -> dict:
    method add_embeddings_to_vector_db (line 113) | def add_embeddings_to_vector_db(self, embeddings: dict) -> None:
    method delete_embeddings_from_vector_db (line 120) | def delete_embeddings_from_vector_db(self, ids: List[str]) -> None:
    method _build_documents (line 127) | def _build_documents(self, results: List[dict]):
    method _get_search_text (line 141) | def _get_search_text(self, results: List[dict], query: str):

FILE: superagi/vector_store/qdrant.py
  function create_qdrant_client (line 20) | def create_qdrant_client(api_key: Optional[str] = None, url: Optional[st...
  class Qdrant (line 31) | class Qdrant(VectorStore):
    method __init__ (line 45) | def __init__(
    method add_texts (line 59) | def add_texts(
    method get_matching_text (line 99) | def get_matching_text(
    method get_index_stats (line 165) | def get_index_stats(self) -> dict:
    method add_embeddings_to_vector_db (line 176) | def add_embeddings_to_vector_db(self, embeddings: dict) -> None:
    method delete_embeddings_from_vector_db (line 190) | def delete_embeddings_from_vector_db(self, ids: List[str]) -> None:
    method __get_embeddings (line 202) | def __get_embeddings(
    method __build_payloads (line 217) | def __build_payloads(
    method __build_documents (line 245) | def __build_documents(
    method create_collection (line 262) | def create_collection(cls,
    method _get_search_res (line 281) | def _get_search_res(self, results, text):

FILE: superagi/vector_store/redis.py
  class Redis (line 24) | class Redis(VectorStore):
    method delete_embeddings_from_vector_db (line 26) | def delete_embeddings_from_vector_db(self, ids: List[str]) -> None:
    method add_embeddings_to_vector_db (line 29) | def add_embeddings_to_vector_db(self, embeddings: dict) -> None:
    method get_index_stats (line 32) | def get_index_stats(self) -> dict:
    method __init__ (line 37) | def __init__(self, index: Any, embedding_model: Any):
    method build_redis_key (line 54) | def build_redis_key(self, prefix: str) -> str:
    method add_texts (line 58) | def add_texts(self, texts: Iterable[str],
    method get_matching_text (line 79) | def get_matching_text(self, query: str, top_k: int = 5, metadata: Opti...
    method _convert_to_redis_filters (line 117) | def _convert_to_redis_filters(self, metadata: Optional[dict] = None) -...
    method create_index (line 128) | def create_index(self):
    method escape_token (line 154) | def escape_token(self, value: str) -> str:

FILE: superagi/vector_store/vector_factory.py
  class VectorFactory (line 15) | class VectorFactory:
    method get_vector_storage (line 18) | def get_vector_storage(cls, vector_store: VectorStoreType, index_name,...
    method build_vector_storage (line 86) | def build_vector_storage(cls, vector_store: VectorStoreType, index_nam...

FILE: superagi/vector_store/weaviate.py
  function create_weaviate_client (line 12) | def create_weaviate_client(
  class Weaviate (line 43) | class Weaviate(VectorStore):
    method __init__ (line 44) | def __init__(
    method add_texts (line 53) | def add_texts(
    method get_matching_text (line 69) | def get_matching_text(
    method _get_metadata_fields (line 95) | def _get_metadata_fields(self) -> List[str]:
    method get_index_stats (line 104) | def get_index_stats(self) -> dict:
    method add_embeddings_to_vector_db (line 109) | def add_embeddings_to_vector_db(self, embeddings: dict) -> None:
    method delete_embeddings_from_vector_db (line 118) | def delete_embeddings_from_vector_db(self, ids: List[str]) -> None:
    method _build_documents (line 128) | def _build_documents(self, results_data, metadata_fields) -> List[Docu...
    method _get_search_res (line 140) | def _get_search_res(self, results, query):

FILE: superagi/worker.py
  function agent_status_change (line 45) | def agent_status_change(target, val,old_val,initiator):
  function execute_waiting_workflows (line 50) | def execute_waiting_workflows():
  function initialize_schedule_agent_task (line 58) | def initialize_schedule_agent_task():
  function execute_agent (line 67) | def execute_agent(agent_execution_id: int, time):
  function summarize_resource (line 76) | def summarize_resource(agent_id: int, resource_id: int):
  function webhook_callback (line 107) | def webhook_callback(agent_execution_id,val,old_val):

FILE: test.py
  function ask_user_for_goals (line 31) | def ask_user_for_goals():
  function run_superagi_cli (line 41) | def run_superagi_cli(agent_name=None, agent_description=None, agent_goal...

FILE: tests/integration_tests/vector_embeddings/test_pinecone.py
  class TestPinecone (line 5) | class TestPinecone(unittest.TestCase):
    method setUp (line 7) | def setUp(self):
    method test_init (line 13) | def test_init(self):
    method test_get_vector_embeddings_from_chunks (line 18) | def test_get_vector_embeddings_from_chunks(self):

FILE: tests/integration_tests/vector_embeddings/test_qdrant.py
  class TestQdrant (line 5) | class TestQdrant(unittest.TestCase):
    method setUp (line 7) | def setUp(self):
    method test_init (line 14) | def test_init(self):
    method test_get_vector_embeddings_from_chunks (line 19) | def test_get_vector_embeddings_from_chunks(self):

FILE: tests/integration_tests/vector_embeddings/test_weaviate.py
  class TestWeaviate (line 5) | class TestWeaviate(unittest.TestCase):
    method setUp (line 7) | def setUp(self):
    method test_init (line 10) | def test_init(self):
    method test_get_vector_embeddings_from_chunks (line 15) | def test_get_vector_embeddings_from_chunks(self):

FILE: tests/integration_tests/vector_store/test_qdrant.py
  function client (line 11) | def client():
  function mock_openai_embedding (line 17) | def mock_openai_embedding(monkeypatch):
  function store (line 26) | def store(client, mock_openai_embedding):
  function test_add_texts (line 35) | def test_add_texts(store):
  function test_get_matching_text (line 51) | def test_get_matching_text(store):

FILE: tests/integration_tests/vector_store/test_weaviate.py
  class TestWeaviateClient (line 5) | class TestWeaviateClient(unittest.TestCase):
    method test_create_weaviate_client (line 8) | def test_create_weaviate_client(self, MockAuth, MockClient):
  class TestWeaviate (line 19) | class TestWeaviate(unittest.TestCase):
    method setUp (line 21) | def setUp(self):
    method test_get_matching_text (line 33) | def test_get_matching_text(self):
    method test_add_texts (line 43) | def test_add_texts(self):
    method test_add_embeddings_to_vector_db (line 53) | def test_add_embeddings_to_vector_db(self):
    method test_delete_embeddings_from_vector_db (line 61) | def test_delete_embeddings_from_vector_db(self):

FILE: tests/tools/google_calendar/create_event_test.py
  class TestCreateEventCalendarInput (line 9) | class TestCreateEventCalendarInput(unittest.TestCase):
    method test_create_event_calendar_input_valid (line 10) | def test_create_event_calendar_input_valid(self):
    method test_create_event_calendar_input_invalid (line 26) | def test_create_event_calendar_input_invalid(self):
  class TestCreateEventCalendarTool (line 40) | class TestCreateEventCalendarTool(unittest.TestCase):
    method setUp (line 41) | def setUp(self):
    method test_execute (line 46) | def test_execute(self, mock_create_event_dates, mock_get_credentials):

FILE: tests/tools/google_calendar/delete_event_test.py
  class TestDeleteCalendarEventInput (line 6) | class TestDeleteCalendarEventInput(unittest.TestCase):
    method test_valid_input (line 7) | def test_valid_input(self):
    method test_invalid_input (line 12) | def test_invalid_input(self):
  class TestDeleteCalendarEventTools (line 17) | class TestDeleteCalendarEventTools(unittest.TestCase):
    method setUp (line 18) | def setUp(self):
    method test_execute_delete_event_with_valid_id (line 22) | def test_execute_delete_event_with_valid_id(self, mock_google_calendar...
    method test_execute_delete_event_with_no_id (line 29) | def test_execute_delete_event_with_no_id(self, mock_google_calendar_cr...
    method test_execute_delete_event_with_no_credentials (line 33) | def test_execute_delete_event_with_no_credentials(self, mock_google_ca...

FILE: tests/tools/google_calendar/event_details_test.py
  class TestEventDetailsCalendarInput (line 7) | class TestEventDetailsCalendarInput(unittest.TestCase):
    method test_invalid_input (line 8) | def test_invalid_input(self):
    method test_valid_input (line 12) | def test_valid_input(self):
  class TestEventDetailsCalendarTool (line 16) | class TestEventDetailsCalendarTool(unittest.TestCase):
    method setUp (line 17) | def setUp(self):
    method test_no_credentials (line 20) | def test_no_credentials(self):
    method test_no_event_id (line 26) | def test_no_event_id(self):
    method test_valid_event (line 32) | def test_valid_event(self):

FILE: tests/tools/google_calendar/list_events_test.py
  class TestListCalendarEventsInput (line 9) | class TestListCalendarEventsInput(unittest.TestCase):
    method test_valid_input (line 11) | def test_valid_input(self):
    method test_invalid_input (line 25) | def test_invalid_input(self):
  class TestListCalendarEventsTool (line 35) | class TestListCalendarEventsTool(unittest.TestCase):
    method test_without_events (line 39) | def test_without_events(self, mock_get_date_utc, mock_get_credentials):

FILE: tests/unit_tests/agent/test_agent_iteration_step_handler.py
  function test_handler (line 32) | def test_handler():
  function test_build_agent_prompt (line 42) | def test_build_agent_prompt(test_handler, mocker):
  function test_build_tools (line 77) | def test_build_tools(test_handler, mocker):
  function test_handle_wait_for_permission (line 100) | def test_handle_wait_for_permission(test_handler, mocker):

FILE: tests/unit_tests/agent/test_agent_message_builder.py
  function test_build_agent_messages (line 10) | def test_build_agent_messages(mock_get_config, mock_token_limit):
  function test_build_ltm_summary (line 50) | def test_build_ltm_summary(mock_token_limit, mock_count_text_tokens, moc...
  function test_build_prompt_for_ltm_summary (line 81) | def test_build_prompt_for_ltm_summary(mock_read_agent_prompt):
  function test_build_prompt_for_recursive_ltm_summary_using_previous_ltm_summary (line 102) | def test_build_prompt_for_recursive_ltm_summary_using_previous_ltm_summa...

FILE: tests/unit_tests/agent/test_agent_prompt_builder.py
  function test_add_list_items_to_string (line 8) | def test_add_list_items_to_string():
  function test_clean_prompt (line 14) | def test_clean_prompt():
  function test_replace_main_variables (line 22) | def test_replace_main_variables(mock_add_tools_to_prompt, mock_add_list_...
  function test_replace_task_based_variables (line 41) | def test_replace_task_based_variables(mock_count_message_tokens):
  function test_replace_task_based_variables (line 62) | def test_replace_task_based_variables(mock_count_message_tokens):

FILE: tests/unit_tests/agent/test_agent_prompt_template.py
  function test_get_super_agi_single_prompt (line 9) | def test_get_super_agi_single_prompt(mock_file):
  function test_start_task_based (line 15) | def test_start_task_based(mock_file):
  function test_analyse_task (line 21) | def test_analyse_task(mock_file):
  function test_create_tasks (line 28) | def test_create_tasks(mock_file):
  function test_prioritize_tasks (line 34) | def test_prioritize_tasks(mock_file):

FILE: tests/unit_tests/agent/test_agent_tool_step_handler.py
  function handler (line 25) | def handler():
  function test_create_permission_request (line 36) | def test_create_permission_request(handler):
  function test_execute_step (line 66) | def test_execute_step(handler):
  function test_handle_next_step_with_complete (line 102) | def test_handle_next_step_with_complete(handler):
  function test_handle_next_step_with_next_step (line 117) | def test_handle_next_step_with_next_step(handler):
  function test_build_tool_obj (line 133) | def test_build_tool_obj(handler):
  function test_process_output_instruction (line 155) | def test_process_output_instruction(handler):
  function test_build_tool_input_prompt (line 178) | def test_build_tool_input_prompt(handler):
  function test_build_tool_output_prompt (line 205) | def test_build_tool_output_prompt(handler):
  function test_handle_wait_for_permission_approved (line 230) | def test_handle_wait_for_permission_approved(handler):
  function test_handle_wait_for_permission_denied (line 254) | def test_handle_wait_for_permission_denied(handler):

FILE: tests/unit_tests/agent/test_agent_workflow_step_wait_handler.py
  function mock_datetime_now (line 13) | def mock_datetime_now():
  function mock_datetime_now_fixture (line 18) | def mock_datetime_now_fixture(monkeypatch, mock_datetime_now):
  function test_handle_next_step_complete (line 26) | def test_handle_next_step_complete(mock_fetch_next_step, mock_find_by_id...
  function test_execute_step (line 51) | def test_execute_step(mock_fetch_next_step, mock_find_by_id, mock_get_ag...

FILE: tests/unit_tests/agent/test_output_handler.py
  function test_tool_output_handle (line 21) | def test_tool_output_handle(parse_mock, execute_mock, get_completed_task...
  function test_add_text_to_memory (line 49) | def test_add_text_to_memory(TokenTextSplitter_mock):
  function test_tool_handler_check_permission_in_restricted_mode (line 76) | def test_tool_handler_check_permission_in_restricted_mode(op_mock):
  function test_task_output_handle_method (line 104) | def test_task_output_handle_method(extract_json_array_section_mock, get_...
  function test_handle_method (line 133) | def test_handle_method(extract_json_array_section_mock, get_tasks_mock, ...

FILE: tests/unit_tests/agent/test_output_parser.py
  function test_agent_schema_output_parser (line 7) | def test_agent_schema_output_parser():

FILE: tests/unit_tests/agent/test_queue_step_handler.py
  function queue_step_handler (line 8) | def queue_step_handler():
  function step_tool (line 20) | def step_tool():
  function test_queue_identifier (line 27) | def test_queue_identifier(queue_step_handler):
  function test_execute_step (line 37) | def test_execute_step(task_queue_mock, agent_execution_mock, workflow_st...
  function test_add_to_queue (line 50) | def test_add_to_queue(task_queue_mock, agent_execution_feed_mock, queue_...
  function test_consume_from_queue (line 65) | def test_consume_from_queue(task_queue_mock, agent_execution_feed_mock, ...

FILE: tests/unit_tests/agent/test_task_queue.py
  class TaskQueueTests (line 7) | class TaskQueueTests(unittest.TestCase):
    method setUp (line 8) | def setUp(self):
    method test_add_task (line 13) | def test_add_task(self, mock_add_task):
    method test_complete_task (line 19) | def test_complete_task(self, mock_complete_task):
    method test_get_first_task (line 26) | def test_get_first_task(self, mock_get_first_task):
    method test_get_tasks (line 31) | def test_get_tasks(self, mock_get_tasks):
    method test_get_completed_tasks (line 36) | def test_get_completed_tasks(self, mock_get_completed_tasks):
    method test_clear_tasks (line 41) | def test_clear_tasks(self, mock_clear_tasks):
    method test_get_last_task_details (line 46) | def test_get_last_task_details(self, mock_get_last_task_details):

FILE: tests/unit_tests/agent/test_tool_builder.py
  function session (line 9) | def session():
  function agent_id (line 13) | def agent_id():
  function tool_builder (line 17) | def tool_builder(session, agent_id):
  function tool (line 21) | def tool():
  function agent_config (line 29) | def agent_config():
  function agent_execution_config (line 33) | def agent_execution_config():
  function test_build_tool (line 38) | def test_build_tool(mock_getattr, mock_import_module, tool_builder, tool):

FILE: tests/unit_tests/agent/test_tool_executor.py
  class MockTool (line 9) | class MockTool:
    method __init__ (line 10) | def __init__(self, name):
    method execute (line 13) | def execute(self, args):
  function mock_tools (line 17) | def mock_tools():
  function executor (line 21) | def executor(mock_tools):
  function test_tool_executor_finish (line 24) | def test_tool_executor_finish(executor):
  function test_tool_executor_success (line 30) | def test_tool_executor_success(mock_event_handler, executor, mock_tools):
  function test_tool_executor_generic_error (line 38) | def test_tool_executor_generic_error(mock_event_handler, executor):
  function test_tool_executor_unknown_tool (line 48) | def test_tool_executor_unknown_tool(executor):
  function test_clean_tool_args (line 54) | def test_clean_tool_args(executor):

FILE: tests/unit_tests/apm/test_analytics_helper.py
  function organisation_id (line 7) | def organisation_id():
  function mock_session (line 11) | def mock_session():
  function analytics_helper (line 15) | def analytics_helper(mock_session, organisation_id):
  function test_calculate_run_completed_metrics (line 18) | def test_calculate_run_completed_metrics(analytics_helper, mock_session):
  function test_fetch_agent_data (line 23) | def test_fetch_agent_data(analytics_helper, mock_session):
  function test_fetch_agent_runs (line 28) | def test_fetch_agent_runs(analytics_helper, mock_session):
  function test_get_active_runs (line 33) | def test_get_active_runs(analytics_helper, mock_session):

FILE: tests/unit_tests/apm/test_call_log_helper.py
  function mock_session (line 12) | def mock_session():
  function mock_agent (line 16) | def mock_agent():
  function mock_tool (line 20) | def mock_tool():
  function mock_toolkit (line 24) | def mock_toolkit():
  function call_log_helper (line 28) | def call_log_helper(mock_session):
  function test_create_call_log_success (line 31) | def test_create_call_log_success(call_log_helper, mock_session):
  function test_create_call_log_failure (line 40) | def test_create_call_log_failure(call_log_helper, mock_session):
  function test_fetch_data_success (line 45) | def test_fetch_data_success(call_log_helper, mock_session):
  function test_fetch_data_failure (line 74) | def test_fetch_data_failure(call_log_helper, mock_session):

FILE: tests/unit_tests/apm/test_event_handler.py
  function mock_session (line 9) | def mock_session():
  function event_handler (line 13) | def event_handler(mock_session):
  function test_create_event_success (line 16) | def test_create_event_success(event_handler, mock_session):
  function test_create_event_failure (line 25) | def test_create_event_failure(event_handler, mock_session):

FILE: tests/unit_tests/apm/test_knowledge_handler.py
  function organisation_id (line 9) | def organisation_id():
  function mock_session (line 13) | def mock_session():
  function knowledge_handler (line 17) | def knowledge_handler(mock_session, organisation_id):
  function test_get_knowledge_usage_by_name (line 20) | def test_get_knowledge_usage_by_name(knowledge_handler, mock_session):
  function test_get_knowledge_events_by_name (line 45) | def test_get_knowledge_events_by_name(knowledge_handler, mock_session):
  function test_get_knowledge_events_by_name_knowledge_not_found (line 88) | def test_get_knowledge_events_by_name_knowledge_not_found(knowledge_hand...

FILE: tests/unit_tests/apm/test_tools_handler.py
  function organisation_id (line 12) | def organisation_id():
  function mock_session (line 16) | def mock_session():
  function tools_handler (line 20) | def tools_handler(mock_session, organisation_id):
  function test_calculate_tool_usage (line 23) | def test_calculate_tool_usage(tools_handler, mock_session):
  function test_get_tool_and_toolkit (line 55) | def test_get_tool_and_toolkit(tools_handler, mock_session):
  function test_get_tool_usage_by_name (line 67) | def test_get_tool_usage_by_name(tools_handler, mock_session):
  function test_get_tool_events_by_name (line 96) | def test_get_tool_events_by_name(tools_handler, mock_session):
  function test_get_tool_events_by_name_tool_not_found (line 140) | def test_get_tool_events_by_name_tool_not_found(tools_handler, mock_sess...

FILE: tests/unit_tests/controllers/api/test_agent.py
  function mock_api_key_get (line 17) | def mock_api_key_get():
  function mock_execution_state_change_input (line 21) | def mock_execution_state_change_input():
  function mock_run_id_config (line 26) | def mock_run_id_config():
  function mock_agent_execution (line 32) | def mock_agent_execution():
  function mock_run_id_config_empty (line 37) | def mock_run_id_config_empty():
  function mock_run_id_config_invalid (line 43) | def mock_run_id_config_invalid():
  function mock_agent_config_update_ext_input (line 48) | def mock_agent_config_update_ext_input():
  function mock_update_agent_config (line 62) | def mock_update_agent_config():
  function test_update_agent_not_found (line 87) | def test_update_agent_not_found(mock_update_agent_config,mock_api_key_get):
  function test_get_run_resources_no_run_ids (line 106) | def test_get_run_resources_no_run_ids(mock_run_id_config_empty,mock_api_...
  function test_get_run_resources_invalid_run_ids (line 125) | def test_get_run_resources_invalid_run_ids(mock_run_id_config_invalid,mo...
  function test_resume_agent_runs_agent_not_found (line 144) | def test_resume_agent_runs_agent_not_found(mock_execution_state_change_i...
  function test_pause_agent_runs_agent_not_found (line 163) | def test_pause_agent_runs_agent_not_found(mock_execution_state_change_in...
  function test_create_run_agent_not_found (line 181) | def test_create_run_agent_not_found(mock_agent_execution,mock_api_key_get):
  function test_create_run_project_not_matching_org (line 199) | def test_create_run_project_not_matching_org(mock_agent_execution, mock_...

FILE: tests/unit_tests/controllers/test_agent.py
  function mock_patch_schedule_input (line 16) | def mock_patch_schedule_input():
  function mock_schedule (line 26) | def mock_schedule():
  function mock_agent_config (line 31) | def mock_agent_config():
  function mock_schedule_get (line 35) | def mock_schedule_get():
  function test_stop_schedule_success (line 47) | def test_stop_schedule_success(mock_schedule):
  function test_stop_schedule_not_found (line 62) | def test_stop_schedule_not_found():
  function test_edit_schedule_success (line 76) | def test_edit_schedule_success(mock_schedule, mock_patch_schedule_input):
  function test_edit_schedule_not_found (line 96) | def test_edit_schedule_not_found(mock_patch_schedule_input):
  function test_get_schedule_data_success (line 109) | def test_get_schedule_data_success(mock_schedule_get, mock_agent_config):
  function test_get_schedule_data_not_found (line 128) | def test_get_schedule_data_not_found():
  function mock_agent_config_schedule (line 142) | def mock_agent_config_schedule():
  function mock_agent (line 176) | def mock_agent():
  function test_create_and_schedule_agent_success (line 181) | def test_create_and_schedule_agent_success(mock_agent_config_schedule, m...
  function test_create_and_schedule_agent_project_not_found (line 222) | def test_create_and_schedule_agent_project_not_found(mock_agent_config_s...

FILE: tests/unit_tests/controllers/test_agent_execution.py
  function mock_patch_schedule_input (line 13) | def mock_patch_schedule_input():
  function mock_schedule (line 23) | def mock_schedule():
  function test_schedule_existing_agent_already_scheduled (line 28) | def test_schedule_existing_agent_already_scheduled(mock_patch_schedule_i...
  function test_schedule_existing_agent_new_schedule (line 41) | def test_schedule_existing_agent_new_schedule(mock_patch_schedule_input,...

FILE: tests/unit_tests/controllers/test_agent_execution_config.py
  function mocks (line 15) | def mocks():
  function test_get_agent_execution_configuration_not_found_failure (line 24) | def test_get_agent_execution_configuration_not_found_failure():
  function test_get_agent_execution_configuration_success (line 34) | def test_get_agent_execution_configuration_success(mocks):

FILE: tests/unit_tests/controllers/test_agent_execution_feeds.py
  function test_get_agent_execution_feed (line 10) | def test_get_agent_execution_feed(mock_query):

FILE: tests/unit_tests/controllers/test_agent_template.py
  function test_edit_agent_template_success (line 12) | def test_edit_agent_template_success(mock_get_user_org, mock_auth_db, mo...
  function test_edit_agent_template_failure (line 69) | def test_edit_agent_template_failure(mock_get_user_org, mock_auth_db, mo...
  function test_edit_agent_template_with_new_config_success (line 93) | def test_edit_agent_template_with_new_config_success(mock_get_user_org, ...

FILE: tests/unit_tests/controllers/test_analytics.py
  function test_get_metrics_success (line 9) | def test_get_metrics_success(mock_get_db):
  function test_get_agents_success (line 20) | def test_get_agents_success(mock_get_db):
  function test_get_agent_runs_success (line 31) | def test_get_agent_runs_success(mock_get_db):
  function test_get_active_runs_success (line 42) | def test_get_active_runs_success(mock_get_db):
  function test_get_tools_user_success (line 53) | def test_get_tools_user_success(mock_get_db):

FILE: tests/unit_tests/controllers/test_models_controller.py
  function test_store_api_keys_success (line 14) | def test_store_api_keys_success(mock_get_db):
  function test_get_api_keys_success (line 26) | def test_get_api_keys_success(mock_get_db):
  function test_get_api_key_success (line 34) | def test_get_api_key_success(mock_fetch_api_key, mock_get_db):
  function test_verify_end_point_success (line 44) | def test_verify_end_point_success(mock_get_db):
  function test_store_model_success (line 50) | def test_store_model_success(mock_get_db):
  function test_fetch_models_success (line 67) | def test_fetch_models_success(mock_get_db):
  function test_fetch_model_details_success (line 74) | def test_fetch_model_details_success(mock_get_db):
  function test_fetch_data_success (line 81) | def test_fetch_data_success(mock_get_db):
  function test_get_marketplace_models_list_success (line 91) | def test_get_marketplace_models_list_success(mock_get_db):
  function test_get_marketplace_models_list_success (line 104) | def test_get_marketplace_models_list_success(mock_get_db):
  function test_get_local_llm (line 110) | def test_get_local_llm():

FILE: tests/unit_tests/controllers/test_publish_agent.py
  function mocks (line 16) | def mocks():
  function test_publish_template (line 24) | def test_publish_template(mocks):

FILE: tests/unit_tests/controllers/test_tool.py
  function mocks (line 15) | def mocks():
  function test_get_tools_success (line 61) | def test_get_tools_success(mocks):

FILE: tests/unit_tests/controllers/test_tool_config.py
  function mocks (line 16) | def mocks():
  function test_update_tool_configs_success (line 44) | def test_update_tool_configs_success():
  function test_get_all_tool_configs_success (line 70) | def test_get_all_tool_configs_success(mocks):
  function test_get_all_tool_configs_toolkit_not_found (line 94) | def test_get_all_tool_configs_toolkit_not_found(mocks):
  function test_get_tool_config_success (line 107) | def test_get_tool_config_success(mocks):
  function test_get_tool_config_unauthorized (line 132) | def test_get_tool_config_unauthorized(mocks):
  function test_get_tool_config_not_found (line 150) | def test_get_tool_config_not_found(mocks):

FILE: tests/unit_tests/controllers/test_toolkit.py
  function mocks (line 17) | def mocks():
  function mock_toolkit_details (line 64) | def mock_toolkit_details():
  function test_handle_marketplace_operations_list (line 108) | def test_handle_marketplace_operations_list(mocks):
  function test_install_toolkit_from_marketplace (line 146) | def test_install_toolkit_from_marketplace(mock_toolkit_details):

FILE: tests/unit_tests/controllers/test_update_agent_config_table.py
  function test_update_existing_toolkits (line 6) | def test_update_existing_toolkits():

FILE: tests/unit_tests/controllers/test_user.py
  function authenticated_user (line 13) | def authenticated_user():
  function test_update_first_login_source (line 27) | def test_update_first_login_source(authenticated_user):

FILE: tests/unit_tests/helper/test_agent_schedule_helper.py
  function test_update_next_scheduled_time (line 11) | def test_update_next_scheduled_time(mock_datetime, mock_session, mock_ag...
  function test_run_scheduled_agents (line 49) | def test_run_scheduled_agents(

FILE: tests/unit_tests/helper/test_calendar_date.py
  class TestCalendarDate (line 9) | class TestCalendarDate(unittest.TestCase):
    method setUp (line 10) | def setUp(self):
    method test_get_time_zone (line 15) | def test_get_time_zone(self):
    method test_convert_to_utc (line 19) | def test_convert_to_utc(self):
    method test_string_to_datetime (line 35) | def test_string_to_datetime(self):
    method test_localize_daterange (line 41) | def test_localize_daterange(self):
    method test_datetime_to_string (line 51) | def test_datetime_to_string(self):
    method test_get_date_utc (line 57) | def test_get_date_utc(self):
    method test_create_event_dates (line 67) | def test_create_event_dates(self):

FILE: tests/unit_tests/helper/test_error_handling.py
  function test_handle_error (line 7) | def test_handle_error():

FILE: tests/unit_tests/helper/test_feed_parser.py
  class TestParseFeed (line 5) | class TestParseFeed(unittest.TestCase):
    method test_parse_feed_system (line 6) | def test_parse_feed_system(self):

FILE: tests/unit_tests/helper/test_github_helper.py
  class TestGithubHelper (line 7) | class TestGithubHelper(unittest.TestCase):
    method test_check_repository_visibility (line 9) | def test_check_repository_visibility(self, mock_get):
    method test_get_file_path (line 26) | def test_get_file_path(self, mock_get):
    method test_search_repo (line 33) | def test_search_repo(self, mock_get):
    method test_sync_branch (line 51) | def test_sync_branch(self, mock_patch, mock_get):
    method test_create_branch (line 75) | def test_create_branch(self, mock_post, mock_get):
    method test_make_fork (line 99) | def test_make_fork(self, mock_post):
    method test_delete_file (line 117) | def test_delete_file(self, mock_delete):
    method test_create_pull_request (line 136) | def test_create_pull_request(self, mock_post):
    method test_get_pull_request_content_success (line 159) | def test_get_pull_request_content_success(self, mock_get):
    method test_get_pull_request_content_not_found (line 169) | def test_get_pull_request_content_not_found(self, mock_get):
    method test_get_latest_commit_id_of_pull_request (line 178) | def test_get_latest_commit_id_of_pull_request(self, mock_get):
    method test_add_line_comment_to_pull_request (line 188) | def test_add_line_comment_to_pull_request(self, mock_post):

FILE: tests/unit_tests/helper/test_json_cleaner.py
  function test_extract_json_section (line 4) | def test_extract_json_section():
  function test_remove_escape_sequences (line 9) | def test_remove_escape_sequences():
  function test_balance_braces (line 14) | def test_balance_braces():
  function test_balance_braces (line 20) | def test_balance_braces():

FILE: tests/unit_tests/helper/test_resource_helper.py
  function test_make_written_file_resource (line 9) | def test_make_written_file_resource(mocker):
  function test_get_resource_path (line 46) | def test_get_resource_path(mocker):
  function test_get_agent_resource_path (line 55) | def test_get_agent_resource_path(mocker):
  function test_get_formatted_agent_level_path (line 66) | def test_get_formatted_agent_level_path():
  function test_get_formatted_agent_execution_level_path (line 74) | def test_get_formatted_agent_execution_level_path():

FILE: tests/unit_tests/helper/test_s3_helper.py
  function s3helper_object (line 9) | def s3helper_object():
  function test__get_s3_client (line 12) | def test__get_s3_client(s3helper_object):
  function test_upload_file (line 19) | def test_upload_file(s3helper_object, have_creds, raises):
  function test_get_json_file (line 30) | def test_get_json_file(s3helper_object, have_creds, raises):
  function test_check_file_exists_in_s3 (line 59) | def test_check_file_exists_in_s3(s3helper_object):
  function test_read_from_s3 (line 67) | def test_read_from_s3(s3helper_object, http_status, expected_result, rai...
  function test_read_binary_from_s3 (line 82) | def test_read_binary_from_s3(s3helper_object, http_status, expected_resu...
  function test_delete_file_success (line 94) | def test_delete_file_success(s3helper_object):
  function test_delete_file_fail (line 101) | def test_delete_file_fail(s3helper_object):
  function test_list_files_from_s3 (line 107) | def test_list_files_from_s3(s3helper_object):
  function test_list_files_from_s3_no_contents (line 119) | def test_list_files_from_s3_no_contents(s3helper_object):
  function test_list_files_from_s3_raises_exception (line 126) | def test_list_files_from_s3_raises_exception(s3helper_object):

FILE: tests/unit_tests/helper/test_time_helper.py
  function test_get_time_difference (line 4) | def test_get_time_difference():
  function test_parse_interval_to_seconds (line 18) | def test_parse_interval_to_seconds():

FILE: tests/unit_tests/helper/test_token_counter.py
  function setup_model_token_limit (line 11) | def setup_model_token_limit():
  function test_token_limit (line 25) | def test_token_limit(mock_fetch_model_tokens, setup_model_token_limit):
  function test_count_message_tokens (line 36) | def test_count_message_tokens():
  function test_count_text_tokens (line 47) | def test_count_text_tokens():

FILE: tests/unit_tests/helper/test_tool_helper.py
  function setup_function (line 18) | def setup_function():
  function teardown_function (line 23) | def teardown_function():
  function mock_requests_get (line 28) | def mock_requests_get(monkeypatch):
  function test_parse_github_url (line 48) | def test_parse_github_url():
  function test_load_module_from_file (line 54) | def test_load_module_from_file(tmp_path):
  function test_get_readme_content_from_code_link (line 72) | def test_get_readme_content_from_code_link(mock_requests_get):
  function test_extract_repo_name (line 78) | def test_extract_repo_name():
  function test_download_tool (line 86) | def test_download_tool(mock_zip, mock_get):
  function test_handle_tools_import (line 103) | def test_handle_tools_import():
  function test_compare_tools (line 113) | def test_compare_tools():
  function test_compare_configs (line 126) | def test_compare_configs():
  function test_compare_toolkit (line 135) | def test_compare_toolkit():

FILE: tests/unit_tests/helper/test_twitter_helper.py
  class TestSendTweets (line 7) | class TestSendTweets(unittest.TestCase):
    method test_send_tweets_success (line 10) | def test_send_tweets_success(self, mock_post):
    method test_send_tweets_failure (line 33) | def test_send_tweets_failure(self, mock_post):

FILE: tests/unit_tests/helper/test_twitter_tokens.py
  class TestCreds (line 13) | class TestCreds(unittest.TestCase):
    method test_init (line 14) | def test_init(self):
  class TestTwitterTokens (line 22) | class TestTwitterTokens(unittest.TestCase):
    method setUp (line 24) | def setUp(self):
    method test_init (line 28) | def test_init(self):
    method test_percent_encode (line 31) | def test_percent_encode(self):
    method test_gen_nonce (line 34) | def test_gen_nonce(self):
    method test_get_request_token (line 41) | def test_get_request_token(self, mock_percent_encode, mock_gen_nonce, ...

FILE: tests/unit_tests/helper/test_webhooks.py
  function mock_session (line 8) | def mock_session():
  function mock_agent_execution (line 12) | def mock_agent_execution():
  function mock_agent (line 16) | def mock_agent():
  function mock_webhook (line 20) | def mock_webhook():
  function mock_org (line 24) | def mock_org():
  function test_agent_status_change_callback (line 29) | def test_agent_status_change_callback(

FILE: tests/unit_tests/jobs/conftest.py
  function pytest_configure (line 2) | def pytest_configure(config):
  function pytest_unconfigure (line 6) | def pytest_unconfigure(config):

FILE: tests/unit_tests/jobs/test_scheduling_executor.py
  function test_execute_scheduled_agent (line 13) | def test_execute_scheduled_agent(AgentExecutionMock, AgentWorkflowMock, ...

FILE: tests/unit_tests/llms/test_google_palm.py
  function test_chat_completion (line 7) | def test_chat_completion(mock_palm):
  function test_verify_access_key (line 33) | def test_verify_access_key():

FILE: tests/unit_tests/llms/test_hugging_face.py
  class TestHuggingFace (line 12) | class TestHuggingFace(TestCase):
    method test_verify_access_key (line 44) | def test_verify_access_key(self, mock_get):
    method test_verify_end_point (line 60) | def test_verify_end_point(self, mock_post):

FILE: tests/unit_tests/llms/test_model_factory.py
  function mock_openai (line 13) | def mock_openai():
  function mock_replicate (line 17) | def mock_replicate():
  function mock_google_palm (line 21) | def mock_google_palm():
  function mock_hugging_face (line 25) | def mock_hugging_face():
  function mock_replicate (line 29) | def mock_replicate():
  function mock_google_palm (line 33) | def mock_google_palm():
  function mock_hugging_face (line 37) | def mock_hugging_face():
  function test_build_model_with_openai (line 41) | def test_build_model_with_openai(mock_openai, monkeypatch):
  function test_build_model_with_replicate (line 47) | def test_build_model_with_replicate(mock_replicate, monkeypatch):
  function test_build_model_with_openai (line 54) | def test_build_model_with_openai(mock_openai, monkeypatch):
  function test_build_model_with_replicate (line 60) | def test_build_model_with_replicate(mock_replicate, monkeypatch):
  function test_build_model_with_google_palm (line 66) | def test_build_model_with_google_palm(mock_google_palm, monkeypatch):
  function test_build_model_with_hugging_face (line 72) | def test_build_model_with_hugging_face(mock_hugging_face, monkeypatch):
  function test_build_model_with_unknown_provider (line 78) | def test_build_model_with_unknown_provider(capsys):  # capsys is a built...

FILE: tests/unit_tests/llms/test_open_ai.py
  function test_chat_completion (line 9) | def test_chat_completion(mock_openai):
  function test_chat_completion_retry_rate_limit_error (line 40) | def test_chat_completion_retry_rate_limit_error(mock_openai, mock_wait_r...
  function test_chat_completion_retry_timeout_error (line 64) | def test_chat_completion_retry_timeout_error(mock_openai, mock_wait_rand...
  function test_chat_completion_retry_try_again_error (line 88) | def test_chat_completion_retry_try_again_error(mock_openai, mock_wait_ra...
  function test_verify_access_key (line 110) | def test_verify_access_key():

FILE: tests/unit_tests/llms/test_replicate.py
  class TestReplicate (line 9) | class TestReplicate(TestCase):
    method test_chat_completion (line 13) | def test_chat_completion(self, mock_replicate_run, mock_os_environ):
    method test_verify_access_key (line 35) | def test_verify_access_key(self, mock_get):
    method test_verify_access_key_false (line 51) | def test_verify_access_key_false(self, mock_get):

FILE: tests/unit_tests/models/test_agent.py
  function test_get_agent_from_id (line 6) | def test_get_agent_from_id():
  function test_get_active_agent_by_id (line 26) | def test_get_active_agent_by_id():
  function test_eval_tools_key (line 46) | def test_eval_tools_key():

FILE: tests/unit_tests/models/test_agent_execution.py
  function test_get_agent_execution_from_id (line 12) | def test_get_agent_execution_from_id():
  function mock_session (line 34) | def mock_session(mocker):
  function test_update_tokens (line 40) | def test_update_tokens(mock_session):
  function test_assign_next_step_id (line 64) | def test_assign_next_step_id(mock_session, mocker):
  function test_get_execution_by_agent_id_and_status (line 91) | def test_get_execution_by_agent_id_and_status():
  function mock_session (line 111) | def mock_session(mocker):

FILE: tests/unit_tests/models/test_agent_execution_config.py
  class TestAgentExecutionConfiguration (line 9) | class TestAgentExecutionConfiguration(unittest.TestCase):
    method setUp (line 11) | def setUp(self):
    method test_fetch_configuration (line 16) | def test_fetch_configuration(self):
    method test_eval_agent_config (line 28) | def test_eval_agent_config(self):

FILE: tests/unit_tests/models/test_agent_execution_feed.py
  function test_get_last_tool_response (line 7) | def test_get_last_tool_response():
  function test_get_last_tool_response_with_tool_name (line 19) | def test_get_last_tool_response_with_tool_name():

FILE: tests/unit_tests/models/test_agent_schedule.py
  function test_find_by_agent_id (line 6) | def test_find_by_agent_id():

FILE: tests/unit_tests/models/test_agent_template.py
  function test_to_dict (line 9) | def test_to_dict():
  function test_to_json (line 15) | def test_to_json():
  function test_from_json (line 21) | def test_from_json():
  function test_main_keys (line 29) | def test_main_keys():
  function test_fetch_marketplace_list (line 37) | def test_fetch_marketplace_list(mock_get):
  function test_fetch_marketplace_detail (line 45) | def test_fetch_marketplace_detail(mock_get):
  function test_eval_agent_config (line 53) | def test_eval_agent_config():
  function test_clone_agent_template_from_marketplace (line 61) | def test_clone_agent_template_from_marketplace(mock_session, mock_fetch_...

FILE: tests/unit_tests/models/test_agent_workflow.py
  function mock_session (line 9) | def mock_session():
  function test_find_by_name (line 14) | def test_find_by_name(mock_session):
  function test_find_or_create_by_name_new (line 19) | def test_find_or_create_by_name_new(mock_session):
  function test_find_or_create_by_name_exists (line 25) | def test_find_or_create_by_name_exists(mock_session):
  function test_fetch_trigger_step_id (line 30) | def test_fetch_trigger_step_id(mock_session):

FILE: tests/unit_tests/models/test_agent_workflow_step.py
  function test_find_by_id (line 9) | def test_find_by_id(mock_query):
  function test_find_by_unique_id (line 15) | def test_find_by_unique_id(mock_query):
  function test_from_json (line 20) | def test_from_json():
  function test_to_dict (line 33) | def test_to_dict():
  function test_find_or_create_tool_workflow_step (line 58) | def test_find_or_create_tool_workflow_step(mock_find_or_create_tool, moc...
  function test_find_or_create_tool_workflow_step_exists (line 80) | def test_find_or_create_tool_workflow_step_exists(mock_find_or_create_to...
  function test_find_or_create_iteration_workflow_step_exists (line 99) | def test_find_or_create_iteration_workflow_step_exists(mock_find_workflo...
  function test_add_next_workflow_step (line 118) | def test_add_next_workflow_step(mock_find_by_id, mock_query, mock_commit):
  function test_add_next_workflow_step_existing (line 139) | def test_add_next_workflow_step_existing(mock_find_by_id, mock_query, mo...
  function test_fetch_default_next_step (line 160) | def test_fetch_default_next_step(mock_find_by_unique_id, mock_find_by_id):
  function test_fetch_default_next_step_none (line 173) | def test_fetch_default_next_step_none(mock_find_by_id):

FILE: tests/unit_tests/models/test_agent_workflow_step_tool.py
  function test_find_by_id (line 8) | def test_find_by_id(mock_query):
  function test_find_or_create_tool_new (line 14) | def test_find_or_create_tool_new(mock_query, mock_add):
  function test_find_or_create_tool_exists (line 30) | def test_find_or_create_tool_exists(mock_query):

FILE: tests/unit_tests/models/test_api_key.py
  function test_get_by_org_id (line 6) | def test_get_by_org_id():
  function test_get_by_id (line 29) | def test_get_by_id():
  function test_delete_by_id (line 48) | def test_delete_by_id():
  function test_edit_by_id (line 71) | def test_edit_by_id():

FILE: tests/unit_tests/models/test_call_logs.py
  function mock_session (line 6) | def mock_session():
  function test_create_call_logs (line 13) | def test_create_call_logs(mock_session, agent_execution_name, agent_id, ...
  function test_repr_method_call_logs (line 29) | def test_repr_method_call_logs(mock_session, agent_execution_name, agent...

FILE: tests/unit_tests/models/test_configuration.py
  function test_fetch_configuration (line 11) | def test_fetch_configuration():
  function test_fetch_value_by_agent_id (line 23) | def test_fetch_value_by_agent_id():
  function test_fetch_value_by_agent_id_agent_not_found (line 36) | def test_fetch_value_by_agent_id_agent_not_found():

FILE: tests/unit_tests/models/test_events.py
  function mock_session (line 8) | def mock_session():
  function test_create_event (line 11) | def test_create_event(mock_session):
  function test_repr_method_event (line 26) | def test_repr_method_event(mock_session):

FILE: tests/unit_tests/models/test_iteration_workflow.py
  function test_find_by_id (line 7) | def test_find_by_id(mock_query):
  function test_find_workflow_by_name (line 16) | def test_find_workflow_by_name(mock_query):
  function test_find_or_create_by_name_new (line 26) | def test_find_or_create_by_name_new(mock_query, mock_add):
  function test_find_or_create_by_name_exists (line 35) | def test_find_or_create_by_name_exists(mock_query, mock_add):
  function test_fetch_trigger_step_id (line 44) | def test_fetch_trigger_step_id(mock_query):

FILE: tests/unit_tests/models/test_iteration_workflow_step.py
  function mock_session (line 9) | def mock_session():
  function test_find_by_id (line 15) | def test_find_by_id(mock_session):
  function test_find_or_create_step_new (line 21) | def test_find_or_create_step_new(mock_session):
  function test_find_or_create_step_exists (line 29) | def test_find_or_create_step_exists(mock_session):

FILE: tests/unit_tests/models/test_knowledge_configs.py
  class TestKnowledgeConfigs (line 7) | class TestKnowledgeConfigs(unittest.TestCase):
    method setUp (line 9) | def setUp(self):
    method test_fetch_knowledge_config_details_marketplace (line 15) | def test_fetch_knowledge_config_details_marketplace(self, mock_get):
    method test_add_update_knowledge_config (line 24) | def test_add_update_knowledge_config(self):
    method test_get_knowledge_config_from_knowledge_id (line 29) | def test_get_knowledge_config_from_knowledge_id(self):
    method test_delete_knowledge_config (line 37) | def test_delete_knowledge_config(self):
    method tearDown (line 42) | def tearDown(self):

FILE: tests/unit_tests/models/test_marketplace_stats.py
  class TestMarketPlaceStats (line 6) | class TestMarketPlaceStats(unittest.TestCase):
    method test_get_knowledge_installation_number (line 9) | def test_get_knowledge_installation_number(self, mock_get):
    method test_get_knowledge_installation_number_status_not_200 (line 20) | def test_get_knowledge_installation_number_status_not_200(self, mock_g...
    method test_update_knowledge_install_number_existing (line 29) | def test_update_knowledge_install_number_existing(self, mock_session):

FILE: tests/unit_tests/models/test_models.py
  function mock_session (line 8) | def mock_session():
  function test_create_model (line 11) | def test_create_model(mock_session):
  function test_repr_method_models (line 33) | def test_repr_method_models(mock_session):
  function test_fetch_marketplace_list (line 62) | def test_fetch_marketplace_list(mock_get):
  function test_fetch_model_tokens (line 110) | def test_fetch_model_tokens(mock_session):
  function test_store_model_details_when_model_exists (line 120) | def test_store_model_details_when_model_exists(mock_session):
  function test_store_model_details_when_model_not_exists (line 142) | def test_store_model_details_when_model_not_exists(mock_session, monkeyp...
  function test_store_model_details_when_unexpected_error_occurs (line 173) | def test_store_model_details_when_unexpected_error_occurs(mock_session, ...
  function test_fetch_models (line 199) | def test_fetch_models(mock_models_config, mock_session):
  function test_fetch_model_details (line 217) | def test_fetch_model_details(mock_models_config, mock_session):

FILE: tests/unit_tests/models/test_models_config.py
  function mock_session (line 8) | def mock_session():
  function test_create_models_config (line 11) | def test_create_models_config(mock_session):
  function test_repr_method_models_config (line 25) | def test_repr_method_models_config(mock_session):
  function test_fetch_model_by_id (line 103) | def test_fetch_model_by_id(mock_session):
  function test_fetch_model_by_id_marketplace (line 116) | def test_fetch_model_by_id_marketplace(mock_session):

FILE: tests/unit_tests/models/test_project.py
  function test_find_by_org_id (line 6) | def test_find_by_org_id():
  function test_find_by_id (line 25) | def test_find_by_id():

FILE: tests/unit_tests/models/test_tool.py
  function mock_session (line 10) | def mock_session():
  function test_get_invalid_tools (line 18) | def test_get_invalid_tools(mock_session):

FILE: tests/unit_tests/models/test_tool_config.py
  function mock_session (line 10) | def mock_session():
  function test_add_or_update_existing_tool_config (line 14) | def test_add_or_update_existing_tool_config(mock_session):
  function test_add_or_update_new_tool_config (line 30) | def test_add_or_update_new_tool_config(mock_session):

FILE: tests/unit_tests/models/test_toolkit.py
  function mock_session (line 11) | def mock_session():
  function mock_tool (line 16) | def mock_tool():
  function mock_session (line 23) | def mock_session(mock_tool):
  function test_add_or_update_existing_toolkit (line 34) | def test_add_or_update_existing_toolkit(mock_session):
  function test_add_or_update_new_toolkit (line 67) | def test_add_or_update_new_toolkit(mock_session):
  function test_fetch_marketplace_list_success (line 93) | def test_fetch_marketplace_list_success():
  function test_fetch_marketplace_detail_success (line 125) | def test_fetch_marketplace_detail_success():
  function test_fetch_marketplace_detail_error (line 151) | def test_fetch_marketplace_detail_error():
  function test_get_toolkit_from_name_existing_toolkit (line 173) | def test_get_toolkit_from_name_existing_toolkit(mock_session):
  function test_get_toolkit_from_name_nonexistent_toolkit (line 191) | def test_get_toolkit_from_name_nonexistent_toolkit(mock_session):
  function test_get_toolkit_installed_details (line 208) | def test_get_toolkit_installed_details(mock_session):
  function test_fetch_tool_ids_from_toolkit (line 238) | def test_fetch_tool_ids_from_toolkit(mock_tool, mock_session):
  function test_get_tool_and_toolkit_arr_with_nonexistent_toolkit (line 248) | def test_get_tool_and_toolkit_arr_with_nonexistent_toolkit():

FILE: tests/unit_tests/models/test_vector_db_configs.py
  class TestVectordbConfigs (line 5) | class TestVectordbConfigs(unittest.TestCase):
    method setUp (line 6) | def setUp(self):
    method test_get_vector_db_config_from_db_id (line 12) | def test_get_vector_db_config_from_db_id(self, model_mock):
    method test_add_vector_db_config (line 21) | def test_add_vector_db_config(self, model_mock):
    method test_delete_vector_db_configs (line 27) | def test_delete_vector_db_configs(self, model_mock):

FILE: tests/unit_tests/models/test_vector_db_indices.py
  class TestVectordbIndices (line 5) | class TestVectordbIndices(unittest.TestCase):
    method setUp (line 6) | def setUp(self):
    method test_get_vector_index_from_id (line 11) | def test_get_vector_index_from_id(self):
    method test_get_vector_indices_from_vectordb (line 16) | def test_get_vector_indices_from_vectordb(self):
    method test_delete_vector_db_index (line 21) | def test_delete_vector_db_index(self):
    method test_add_vector_index (line 27) | def test_add_vector_index(self):
    method test_update_vector_index_state (line 32) | def test_update_vector_index_state(self):

FILE: tests/unit_tests/models/test_vector_dbs.py
  class TestVectordbs (line 5) | class TestVectordbs(unittest.TestCase):
    method setUp (line 6) | def setUp(self):
    method test_fetch_marketplace_list (line 13) | def test_fetch_marketplace_list(self, mock_get):
    method test_get_vector_db_from_id (line 22) | def test_get_vector_db_from_id(self):
    method test_get_vector_db_from_organisation (line 28) | def test_get_vector_db_from_organisation(self):
    method test_add_vector_db (line 34) | def test_add_vector_db(self):
    method test_delete_vector_db (line 39) | def test_delete_vector_db(self):

FILE: tests/unit_tests/resource_manager/test_file_manager.py
  function resource_manager (line 11) | def resource_manager():
  function test_write_binary_file (line 18) | def test_write_binary_file(resource_manager):
  function test_write_file (line 29) | def test_write_file(resource_manager):

FILE: tests/unit_tests/resource_manager/test_llama_document_creation.py
  function test_create_llama_document_s3 (line 6) | def test_create_llama_document_s3(mocker):
  function test_create_llama_document_s3_file_path_provided (line 35) | def test_create_llama_document_s3_file_path_provided(mocker):

FILE: tests/unit_tests/resource_manager/test_llama_vector_store_factory.py
  function test_llama_vector_store_factory (line 10) | def test_llama_vector_store_factory():

FILE: tests/unit_tests/resource_manager/test_save_document_to_vector_store.py
  function test_save_document_to_vector_store (line 10) | def test_save_document_to_vector_store(mock_vc_from_docs, mock_sc_from_d...

FILE: tests/unit_tests/test_migrations_multiheads.py
  function test_alembic_down_revision (line 8) | def test_alembic_down_revision():

FILE: tests/unit_tests/test_tool_manager.py
  function tools_json_path (line 14) | def tools_json_path():
  function test_parse_github_url (line 20) | def test_parse_github_url():
  function setup_function (line 25) | def setup_function():
  function teardown_function (line 30) | def teardown_function():
  function test_download_tool (line 36) | def test_download_tool(mock_zip, mock_get):
  function test_load_tools_config (line 49) | def test_load_tools_config(mock_json_load):
  function test_download_and_extract_tools (line 58) | def test_download_and_extract_tools(mock_load_tools_config, mock_downloa...
  function test_update_tools_json (line 67) | def test_update_tools_json(tools_json_path):

FILE: tests/unit_tests/tools/code/test_improve_code.py
  function mock_improve_code_tool (line 6) | def mock_improve_code_tool():
  function test_execute (line 12) | def test_execute(mock_improve_code_tool):
  function test_execute_with_error (line 33) | def test_execute_with_error(mock_improve_code_tool):

FILE: tests/unit_tests/tools/code/test_write_code.py
  class MockBaseLlm (line 11) | class MockBaseLlm:
    method chat_completion (line 12) | def chat_completion(self, messages, max_tokens):
    method get_model (line 15) | def get_model(self):
  class TestCodingTool (line 18) | class TestCodingTool:
    method tool (line 21) | def tool(self):
    method test_execute (line 30) | def test_execute(self, tool):

FILE: tests/unit_tests/tools/code/test_write_spec.py
  class MockBaseLlm (line 9) | class MockBaseLlm:
    method chat_completion (line 10) | def chat_completion(self, messages, max_tokens):
    method get_model (line 13) | def get_model(self):
  class TestWriteSpecTool (line 16) | class TestWriteSpecTool:
    method tool (line 19) | def tool(self):
    method test_execute (line 27) | def test_execute(self, tool):

FILE: tests/unit_tests/tools/code/test_write_test.py
  function test_write_test_tool_init (line 7) | def test_write_test_tool_init():
  function test_execute (line 19) | def test_execute(mock_token_counter, mock_agent_prompt_builder, mock_pro...

FILE: tests/unit_tests/tools/duck_duck_go/test_duckduckgo_results.py
  class TestDuckDuckGoSearchTool (line 6) | class TestDuckDuckGoSearchTool:
    method setup_method (line 7) | def setup_method(self):
    method test_get_raw_duckduckgo_results_empty_query (line 10) | def test_get_raw_duckduckgo_results_empty_query(self):
    method test_get_raw_duckduckgo_results_valid_query (line 17) | def test_get_raw_duckduckgo_results_valid_query(self, mock_get_raw_duc...
    method test_get_formatted_webpages (line 26) | def test_get_formatted_webpages(self):
    method test_get_content_from_url_with_empty_links (line 43) | def test_get_content_from_url_with_empty_links(self):
    method test_get_formatted_webpages_with_empty_webpages (line 50) | def test_get_formatted_webpages_with_empty_webpages(self):

FILE: tests/unit_tests/tools/duck_duck_go/test_duckduckgo_toolkit.py
  class TestDuckDuckGoSearchToolKit (line 5) | class TestDuckDuckGoSearchToolKit:
    method setup_method (line 6) | def setup_method(self):
    method test_get_tools (line 17) | def test_get_tools(self):
    method test_get_env_keys (line 30) | def test_get_env_keys(self):

FILE: tests/unit_tests/tools/email/test_read_email.py
  function test_execute (line 8) | def test_execute(mock_read_email, mock_imap_email):

FILE: tests/unit_tests/tools/email/test_send_email.py
  function mock_get_tool_config (line 6) | def mock_get_tool_config(key):
  function mock_get_draft_tool_config (line 19) | def mock_get_draft_tool_config(key):
  function test_execute_sends_email (line 35) | def test_execute_sends_email(mock_imap_open, mock_smtp):
  function test_execute_sends_email_to_draft (line 54) | def test_execute_sends_email_to_draft(mock_imap_open, mock_smtp):

FILE: tests/unit_tests/tools/file/test_list_files.py
  function list_file_tool (line 9) | def list_file_tool():
  function test_list_files (line 18) | def test_list_files(list_file_tool):
  function test_execute (line 29) | def test_execute(list_file_tool):

FILE: tests/unit_tests/tools/file/test_read_file.py
  function mock_os_path_exists (line 12) | def mock_os_path_exists():
  function mock_os_makedirs (line 17) | def mock_os_makedirs():
  function mock_get_config (line 22) | def mock_get_config():
  function read_file_tool (line 28) | def read_file_tool():
  function mock_s3_helper (line 33) | def mock_s3_helper():
  function mock_partition (line 38) | def mock_partition():
  function mock_get_agent_from_id (line 43) | def mock_get_agent_from_id():
  function mock_get_agent_execution_from_id (line 48) | def mock_get_agent_execution_from_id():
  function mock_resource_helper (line 52) | def mock_resource_helper():
  function test_read_file_tool (line 56) | def test_read_file_tool(mock_os_path_exists, mock_os_makedirs, mock_get_...
  function test_read_file_tool_s3 (line 81) | def test_read_file_tool_s3(mock_os_path_exists, mock_os_makedirs, mock_g...
  function test_read_file_tool_not_found (line 107) | def test_read_file_tool_not_found(mock_os_path_exists, mock_os_makedirs,...

FILE: tests/unit_tests/tools/github/test_add_file.py
  function test_github_add_file_schema (line 8) | def test_github_add_file_schema():
  function github_add_file_tool (line 27) | def github_add_file_tool():
  function test_github_add_file_tool_execute (line 35) | def test_github_add_file_tool_execute(mock_make_fork, mock_create_branch...

FILE: tests/unit_tests/tools/github/test_fetch_pull_request.py
  function mock_github_helper (line 9) | def mock_github_helper():
  function tool (line 15) | def tool(mock_github_helper):
  function test_execute (line 24) | def test_execute(tool, mock_github_helper):
  function test_schema_validation (line 36) | def test_schema_validation():
  function test_execute_error (line 47) | def test_execute_error(mock_github_helper):

FILE: tests/unit_tests/tools/github/test_github_delete.py
  function test_github_delete_file_tool (line 6) | def test_github_delete_file_tool():

FILE: tests/unit_tests/tools/github/test_review_pull_request.py
  class MockLLM (line 8) | class MockLLM:
    method get_model (line 9) | def get_model(self):
  class MockTokenCounter (line 12) | class MockTokenCounter:
    method count_message_tokens (line 14) | def count_message_tokens(message, model):
  function test_split_pull_request_content_into_multiple_parts (line 20) | def test_split_pull_request_content_into_multiple_parts():
  function test_get_exact_line_number (line 41) | def test_get_exact_line_number(diff_content, file_path, line_number, exp...
  class MockGithubHelper (line 51) | class MockGithubHelper:
    method __init__ (line 52) | def __init__(self, access_token, username):
    method get_pull_request_content (line 55) | def get_pull_request_content(self, owner, repo, pr_number):
    method get_latest_commit_id_of_pull_request (line 58) | def get_latest_commit_id_of_pull_request(self, owner, repo, pr_number):
    method add_line_comment_to_pull_request (line 61) | def add_line_comment_to_pull_request(self, *args, **kwargs):
  function test_execute (line 66) | def test_execute():

FILE: tests/unit_tests/tools/image_generation/test_dalle_image_gen.py
  function test_execute_dalle_image_gen_tool (line 8) | def test_execute_dalle_image_gen_tool(mock_config, mock_requests, mock_d...
  function test_execute_dalle_image_gen_tool_invalid_api_key (line 44) | def test_execute_dalle_image_gen_tool_invalid_api_key(mock_config, mock_...

FILE: tests/unit_tests/tools/image_generation/test_stable_diffusion_image_gen.py
  function mock_get_tool_config (line 10) | def mock_get_tool_config(key):
  function create_sample_image_base64 (line 18) | def create_sample_image_base64():
  function stable_diffusion_tool (line 27) | def stable_diffusion_tool():
  function test_execute (line 55) | def test_execute(stable_diffusion_tool):
  function test_call_stable_diffusion (line 67) | def test_call_stable_diffusion(stable_diffusion_tool):

FILE: tests/unit_tests/tools/instagram_tool/test_instagram_tool.py
  class TestInstagramTool (line 6) | class TestInstagramTool(unittest.TestCase):
    method setUp (line 9) | def setUp(self, mock_get, mock_post):
    method test_create_caption (line 17) | def test_create_caption(self):
    method test_get_file_path (line 26) | def test_get_file_path(self, mock_resource_helper):
    method test_get_img_public_url (line 40) | def test_get_img_public_url(self, mock_get_config, mock_s3_helper):

FILE: tests/unit_tests/tools/instagram_tool/test_instagram_toolkit.py
  class TestInstagramToolKit (line 5) | class TestInstagramToolKit:
    method setup_method (line 6) | def setup_method(self):
    method test_get_tools (line 17) | def test_get_tools(self):
    method test_get_env_keys (line 30) | def test_get_env_keys(self):

FILE: tests/unit_tests/tools/jira/test_create_issue.py
  function test_create_issue_tool (line 7) | def test_create_issue_tool(mock_build_jira_instance):

FILE: tests/unit_tests/tools/jira/test_edit_issue.py
  function test_edit_issue_tool (line 8) | def test_edit_issue_tool(mock_build_jira_instance):

FILE: tests/unit_tests/tools/jira/test_get_projects.py
  function test_get_projects_tool (line 7) | def test_get_projects_tool(mock_build_jira_instance):

FILE: tests/unit_tests/tools/jira/test_search_issues.py
  function test_search_jira_tool (line 6) | def test_search_jira_tool(mock_build_jira_instance):

FILE: tests/unit_tests/tools/knowledge_tool/test_knowledge_search.py
  class TestKnowledgeSearchTool (line 6) | class TestKnowledgeSearchTool(unittest.TestCase):
    method setUp (line 7) | def setUp(self):
    method test_execute (line 21) | def test_execute(self, mock_get_embedding, mock_fetch_configuration, m...

FILE: tests/unit_tests/tools/searx/test_searx_toolkit.py
  class TestSearxSearchToolkit (line 7) | class TestSearxSearchToolkit(unittest.TestCase):
    method setUp (line 9) | def setUp(self):
    method test_get_tools (line 20) | def test_get_tools(self):
    method test_get_env_keys (line 34) | def test_get_env_keys(self):

FILE: tests/unit_tests/tools/test_search_repo.py
  function test_github_search_repo_schema (line 8) | def test_github_search_repo_schema():
  function github_repo_search_tool (line 23) | def github_repo_search_tool():
  function test_execute (line 28) | def test_execute(github_helper_mock, github_repo_search_tool):

FILE: tests/unit_tests/tools/twitter/test_send_tweets.py
  class TestSendTweetsInput (line 6) | class TestSendTweetsInput(unittest.TestCase):
    method test_fields (line 7) | def test_fields(self):
  class TestSendTweetsTool (line 16) | class TestSendTweetsTool(unittest.TestCase):
    method test_execute (line 20) | def test_execute(self, mock_send_tweets, mock_get_media_ids, mock_get_...

FILE: tests/unit_tests/types/test_model_source_types.py
  function test_get_model_source_type (line 6) | def test_get_model_source_type():
  function test_get_model_source_from_model (line 14) | def test_get_model_source_from_model():
  function test_str_representation (line 26) | def test_str_representation():

FILE: tests/unit_tests/vector_embeddings/test_vector_embedding_factory.py
  class TestVectorEmbeddingFactory (line 5) | class TestVectorEmbeddingFactory(unittest.TestCase):
    method test_build_vector_storage (line 10) | def test_build_vector_storage(self, mock_weaviate, mock_qdrant, mock_p...

FILE: tests/unit_tests/vector_store/test_chromadb.py
  function mock_embedding_model (line 9) | def mock_embedding_model():
  function test_create_collection (line 15) | def test_create_collection(mock_chromadb_client):
  function test_add_texts (line 20) | def test_add_texts(mock_chromadb_client, mock_embedding_model):
  function test_get_matching_text (line 27) | def test_get_matching_text(mock_get_embedding, mock_chromadb_client):

FILE: tests/unit_tests/vector_store/test_redis.py
  function test_escape_token (line 7) | def test_escape_token():
  function test_add_texts (line 13) | def test_add_texts(redis_mock):
  function test_get_matching_text (line 29) | def test_get_matching_text(redis_mock):

FILE: tests/unit_tests/vector_store/test_vector_factory.py
  class MockPineconeIndex (line 12) | class MockPineconeIndex(pinecone.index.Index):
  class MockWeaviate (line 16) | class MockWeaviate(Weaviate):
  class MockQdrant (line 20) | class MockQdrant(Qdrant):
  class TestVectorFactory (line 24) | class TestVectorFactory(unittest.TestCase):
    method test_get_vector_storage (line 30) | def test_get_vector_storage(self, mock_qdrant, mock_weaviate, mock_pin...

FILE: ui.py
  function check_command (line 9) | def check_command(command, message):
  function run_npm_commands (line 15) | def run_npm_commands(shell=False):
  function run_server (line 25) | def run_server(shell=False):
  function cleanup (line 35) | def cleanup(api_process, ui_process, celery_process):
Condensed preview — 630 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,083K chars).
[
  {
    "path": ".do/app.yaml",
    "chars": 1796,
    "preview": "alerts:\n  - rule: DEPLOYMENT_FAILED\n  - rule: DOMAIN_FAILED\ndatabases:\n  - engine: PG\n    name: super-agi-main\n    num_n"
  },
  {
    "path": ".do/deploy.template.yaml",
    "chars": 1957,
    "preview": "spec:\n  alerts:\n    - rule: DEPLOYMENT_FAILED\n    - rule: DOMAIN_FAILED\n  databases:\n    - engine: PG\n      name: super-"
  },
  {
    "path": ".dockerignore",
    "chars": 256,
    "preview": "# Ignore everything\n**\n\n# Allow files and directories\n!/migrations\n!/nginx\n!/superagi\n!/tgwui\n!/tools\n!/workspace\n!/main"
  },
  {
    "path": ".gitattributes",
    "chars": 17,
    "preview": "*.sh text eol=lf\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1.BUG_REPORT.yml",
    "chars": 5851,
    "preview": "name: Bug report \ndescription: Create a bug report for SuperAGI.\nlabels: ['status: needs triage']\nbody:\n  - type: markdo"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 1364,
    "preview": "<!-- Thank you for submitting this PR! :) -->\n<!-- Provide a general summary of your changes in the Title above ^, end w"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 3614,
    "preview": "# This workflow will install Python dependencies, run tests and lint with a single version of Python\n# For more informat"
  },
  {
    "path": ".github/workflows/codeql.yml",
    "chars": 2520,
    "preview": "name: \"CodeQL\"\n\non:\n  push:\n    branches: [ 'main', 'dev' ]\n  pull_request:\n    # The branches below must be a subset of"
  },
  {
    "path": ".gitignore",
    "chars": 398,
    "preview": ".idea\n**/.env\n**/.venv\nconfig.yaml\n__pycache__\nsuperagi/models/__pycache__\nsuperagi/controllers/__pycache__\n**agent_dict"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 168,
    "preview": "repos:\n  -   repo: local\n      hooks:\n        -   id: pylint\n            name: pylint\n            entry: pylint\n        "
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 5202,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 5341,
    "preview": "#  ⚡ Contributing to SuperAGI\n<p align=\"center\">\n  <a href=\"https://superagi.com//#gh-light-mode-only\">\n    <img src=\"ht"
  },
  {
    "path": "Dockerfile",
    "chars": 1071,
    "preview": "# Stage 1: Compile image\nFROM python:3.10-slim-bullseye AS compile-image\nWORKDIR /app\n\nRUN apt-get update && \\\n    apt-g"
  },
  {
    "path": "Dockerfile-gpu",
    "chars": 1432,
    "preview": "# Define the CUDA SDK version you need\nARG CUDA_IMAGE=\"12.1.1-devel-ubuntu22.04\"\nFROM nvidia/cuda:${CUDA_IMAGE}\n\nENV DEB"
  },
  {
    "path": "DockerfileCelery",
    "chars": 798,
    "preview": "FROM python:3.9\n\nWORKDIR /app\n\n#RUN apt-get update && apt-get install --no-install-recommends -y git wget libpq-dev gcc "
  },
  {
    "path": "DockerfileRedis",
    "chars": 36,
    "preview": "FROM redis/redis-stack-server:latest"
  },
  {
    "path": "LICENSE",
    "chars": 1075,
    "preview": "MIT License\n\nCopyright (c) 2023 TransformerOptimus\n\nPermission is hereby granted, free of charge, to any person obtainin"
  },
  {
    "path": "README.MD",
    "chars": 22845,
    "preview": "<p align=\"center\">\n  <a href=\"https://superagi.com//#gh-light-mode-only\">\n    <img src=\"https://superagi.com/wp-content/"
  },
  {
    "path": "alembic.ini",
    "chars": 3412,
    "preview": "# A generic, single database configuration.\n\n[alembic]\n# path to migration scripts\nscript_location = migrations\n\n# templ"
  },
  {
    "path": "cli2.py",
    "chars": 2814,
    "preview": "import os\r\nimport sys\r\nimport subprocess\r\nfrom time import sleep\r\nimport shutil\r\nfrom sys import platform\r\nfrom multipro"
  },
  {
    "path": "config_template.yaml",
    "chars": 4783,
    "preview": "#####################------------------SYSTEM KEYS-------------------------########################\nPINECONE_API_KEY: YO"
  },
  {
    "path": "docker-compose-dev.yaml",
    "chars": 1638,
    "preview": "version: '3.8'\nservices:\n  backend:\n    volumes:\n      - \"./:/app\"\n    build: .\n    depends_on:\n      - super__redis\n   "
  },
  {
    "path": "docker-compose-gpu.yml",
    "chars": 2049,
    "preview": "version: '3.8'\nservices:\n  backend:\n    volumes:\n      - \"./:/app\"\n    build:\n      context: .\n      dockerfile: Dockerf"
  },
  {
    "path": "docker-compose.image.example.yaml",
    "chars": 1627,
    "preview": "version: '3.8'\nservices:\n  backend:\n    image: \"superagidev/superagi:main\"\n    depends_on:\n      - super__redis\n      - "
  },
  {
    "path": "docker-compose.yaml",
    "chars": 1633,
    "preview": "version: '3.8'\nservices:\n  backend:\n    volumes:\n      - \"./:/app\"\n    build: .\n    depends_on:\n      - super__redis\n   "
  },
  {
    "path": "entrypoint.sh",
    "chars": 292,
    "preview": "#!/bin/bash\n\n# Downloads the tools from marketplace and external tool repositories\npython superagi/tool_manager.py\n\n# In"
  },
  {
    "path": "entrypoint_celery.sh",
    "chars": 183,
    "preview": "#!/bin/bash\n\n# Downloads the tools\npython superagi/tool_manager.py\n\n# Install dependencies\n./install_tool_dependencies.s"
  },
  {
    "path": "gui/.dockerignore",
    "chars": 160,
    "preview": "# Ignore everything\n**\n\n# Allow files and directories\n!app\n!pages\n!public\n!utils\n!package.json\n!next.config.js\n!package-"
  },
  {
    "path": "gui/.eslintrc.json",
    "chars": 40,
    "preview": "{\n  \"extends\": \"next/core-web-vitals\"\n}\n"
  },
  {
    "path": "gui/Dockerfile",
    "chars": 500,
    "preview": "FROM node:18-alpine AS deps\nRUN apk add --no-cache libc6-compat\nWORKDIR /app\nCOPY package.json package-lock.json ./\nRUN "
  },
  {
    "path": "gui/DockerfileProd",
    "chars": 1057,
    "preview": "FROM node:18-alpine AS deps\nRUN apk add --no-cache libc6-compat\nWORKDIR /app\nCOPY package.json package-lock.json ./\nRUN "
  },
  {
    "path": "gui/README.md",
    "chars": 1369,
    "preview": "This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js"
  },
  {
    "path": "gui/app/globals.css",
    "chars": 2205,
    "preview": ":root {\n  --max-width: 1100px;\n  --border-radius: 12px;\n  --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Se"
  },
  {
    "path": "gui/app/layout.js",
    "chars": 253,
    "preview": "import './globals.css'\n\nexport const metadata = {\n  title: 'Super AGI',\n  description: 'Generated by create next app',\n}"
  },
  {
    "path": "gui/jsconfig.json",
    "chars": 73,
    "preview": "{\n  \"compilerOptions\": {\n    \"paths\": {\n      \"@/*\": [\"./*\"]\n    }\n  }\n}\n"
  },
  {
    "path": "gui/next.config.js",
    "chars": 185,
    "preview": "/** @type {import('next').NextConfig} */\nconst nextConfig = {\n  assetPrefix: process.env.NODE_ENV === \"production\" ? \"/\""
  },
  {
    "path": "gui/package.json",
    "chars": 932,
    "preview": "{\n  \"name\": \"super-agi\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"ne"
  },
  {
    "path": "gui/pages/Content/APM/Apm.module.css",
    "chars": 171,
    "preview": ".apm_dashboard_container {\n    display: flex;\n    flex-direction: column;\n}\n\n.apm_dashboard {\n    margin-top: 16px;\n    "
  },
  {
    "path": "gui/pages/Content/APM/ApmDashboard.js",
    "chars": 22361,
    "preview": "import React, {useState, useEffect, useCallback, useRef} from 'react';\nimport Image from \"next/image\";\nimport style from"
  },
  {
    "path": "gui/pages/Content/APM/BarGraph.js",
    "chars": 1772,
    "preview": "import React, {useEffect, useRef} from \"react\";\nimport * as echarts from 'echarts';\n\nexport const BarGraph = ({data, typ"
  },
  {
    "path": "gui/pages/Content/Agents/ActionConsole.js",
    "chars": 7166,
    "preview": "import React, {useState, useEffect} from 'react';\nimport styles from './Agents.module.css';\nimport Image from 'next/imag"
  },
  {
    "path": "gui/pages/Content/Agents/ActivityFeed.js",
    "chars": 8237,
    "preview": "import React, {useEffect, useRef, useState} from 'react';\nimport styles from './Agents.module.css';\nimport {getExecution"
  },
  {
    "path": "gui/pages/Content/Agents/AgentCreate.js",
    "chars": 63930,
    "preview": "import React, {useState, useEffect, useRef} from 'react';\nimport Image from \"next/image\";\nimport {ToastContainer, toast}"
  },
  {
    "path": "gui/pages/Content/Agents/AgentSchedule.js",
    "chars": 16147,
    "preview": "import React, {useState, useEffect, useRef} from 'react';\nimport {setLocalStorageValue, convertToGMT, preventDefault, ge"
  },
  {
    "path": "gui/pages/Content/Agents/AgentTemplatesList.js",
    "chars": 6202,
    "preview": "import React, {useEffect, useState} from \"react\";\nimport Image from \"next/image\";\nimport styles from '../Marketplace/Mar"
  },
  {
    "path": "gui/pages/Content/Agents/AgentWorkspace.js",
    "chars": 27765,
    "preview": "import React, {useEffect, useState, useMemo} from 'react';\nimport Image from 'next/image';\nimport {ToastContainer, toast"
  },
  {
    "path": "gui/pages/Content/Agents/Agents.js",
    "chars": 1647,
    "preview": "import React from 'react';\nimport Image from \"next/image\";\nimport 'react-toastify/dist/ReactToastify.css';\nimport {creat"
  },
  {
    "path": "gui/pages/Content/Agents/Agents.module.css",
    "chars": 8782,
    "preview": ".container {\n    height: 100%;\n    width: 100%;\n    padding: 0 0 0 8px;\n}\n\n.title_box {\n    width: 100%;\n    padding: 8p"
  },
  {
    "path": "gui/pages/Content/Agents/Details.js",
    "chars": 11491,
    "preview": "import React, {useEffect, useState, useRef} from 'react';\nimport styles from './Agents.module.css';\nimport Image from \"n"
  },
  {
    "path": "gui/pages/Content/Agents/ResourceList.js",
    "chars": 3705,
    "preview": "import React, {useState, useMemo} from 'react';\nimport styles from './Agents.module.css';\nimport Image from \"next/image\""
  },
  {
    "path": "gui/pages/Content/Agents/ResourceManager.js",
    "chars": 3979,
    "preview": "import React, {useState, useRef, useEffect} from 'react';\nimport styles from './Agents.module.css';\nimport Image from \"n"
  },
  {
    "path": "gui/pages/Content/Agents/RunHistory.js",
    "chars": 2628,
    "preview": "import React, {useEffect} from 'react';\nimport styles from './Agents.module.css';\nimport Image from \"next/image\";\nimport"
  },
  {
    "path": "gui/pages/Content/Agents/TaskQueue.js",
    "chars": 2439,
    "preview": "import React, {useEffect, useState} from 'react';\nimport styles from './Agents.module.css';\nimport 'react-toastify/dist/"
  },
  {
    "path": "gui/pages/Content/Agents/react-datetime.css",
    "chars": 4058,
    "preview": ".rdt {\n  position: relative;\n}\n\n.rdtPicker {\n  display: none;\n  position: absolute;\n  min-width: 250px;\n  padding: 4px;\n"
  },
  {
    "path": "gui/pages/Content/Knowledge/AddKnowledge.js",
    "chars": 1755,
    "preview": "import React, {useState, useEffect} from 'react';\nimport KnowledgeForm from \"@/pages/Content/Knowledge/KnowledgeForm\";\n\n"
  },
  {
    "path": "gui/pages/Content/Knowledge/Knowledge.js",
    "chars": 2195,
    "preview": "import React from 'react';\nimport Image from \"next/image\";\nimport styles from '../Toolkits/Tool.module.css';\nimport styl"
  },
  {
    "path": "gui/pages/Content/Knowledge/Knowledge.module.css",
    "chars": 1487,
    "preview": ".knowledge_label {\n    margin-bottom: 4px;\n    font-size: 12px;\n    color: #888888;\n}\n\n.knowledge_info {\n    font-size: "
  },
  {
    "path": "gui/pages/Content/Knowledge/KnowledgeDetails.js",
    "chars": 10531,
    "preview": "import React, {useEffect, useState} from 'react';\nimport styles1 from './Knowledge.module.css'\nimport {ToastContainer, t"
  },
  {
    "path": "gui/pages/Content/Knowledge/KnowledgeForm.js",
    "chars": 11351,
    "preview": "import React, {useState, useEffect, useRef} from 'react';\nimport styles1 from '@/pages/Content/Knowledge/Knowledge.modul"
  },
  {
    "path": "gui/pages/Content/Marketplace/AgentTemplate.js",
    "chars": 10270,
    "preview": "import React, {useEffect, useState} from 'react';\nimport Image from \"next/image\";\nimport styles from '.././Toolkits/Tool"
  },
  {
    "path": "gui/pages/Content/Marketplace/KnowledgeTemplate.js",
    "chars": 16931,
    "preview": "import React, {useEffect, useRef, useState} from 'react';\nimport Image from \"next/image\";\nimport styles from '.././Toolk"
  },
  {
    "path": "gui/pages/Content/Marketplace/Market.js",
    "chars": 4604,
    "preview": "import React, {useState, useEffect} from 'react';\nimport Image from \"next/image\";\nimport styles from './Market.module.cs"
  },
  {
    "path": "gui/pages/Content/Marketplace/Market.module.css",
    "chars": 9091,
    "preview": ".container {\n    height: 100%;\n    width: 100%;\n    padding: 0 8px;\n}\n\n.title_box {\n    width: 100%;\n    padding: 8px;\n "
  },
  {
    "path": "gui/pages/Content/Marketplace/MarketAgent.js",
    "chars": 3075,
    "preview": "import React, {useEffect, useState} from \"react\";\nimport Image from \"next/image\";\nimport {fetchAgentTemplateList} from \""
  },
  {
    "path": "gui/pages/Content/Marketplace/MarketKnowledge.js",
    "chars": 3557,
    "preview": "import React, {useEffect, useState} from \"react\";\nimport Image from \"next/image\";\nimport styles from './Market.module.cs"
  },
  {
    "path": "gui/pages/Content/Marketplace/MarketTools.js",
    "chars": 3171,
    "preview": "import React, {useEffect, useState} from \"react\";\nimport Image from \"next/image\";\nimport {fetchToolTemplateList} from \"@"
  },
  {
    "path": "gui/pages/Content/Marketplace/MarketplacePublic.js",
    "chars": 1554,
    "preview": "import React from 'react';\nimport Image from \"next/image\";\nimport styles from './Market.module.css';\nimport Market from "
  },
  {
    "path": "gui/pages/Content/Marketplace/ToolkitTemplate.js",
    "chars": 8968,
    "preview": "import React, {useEffect, useState} from 'react';\nimport Image from \"next/image\";\nimport styles from '.././Toolkits/Tool"
  },
  {
    "path": "gui/pages/Content/Models/AddModel.js",
    "chars": 567,
    "preview": "import React, {useEffect, useState} from \"react\";\nimport ModelForm from \"./ModelForm\";\n\nexport default function AddModel"
  },
  {
    "path": "gui/pages/Content/Models/AddModelMarketPlace.js",
    "chars": 7271,
    "preview": "import React, {useState, useEffect} from \"react\";\nimport Image from \"next/image\";\nimport {openNewTab, modelIcon, modelGe"
  },
  {
    "path": "gui/pages/Content/Models/MarketModels.js",
    "chars": 4570,
    "preview": "import React, {useState, useEffect} from \"react\";\nimport styles from \"@/pages/Content/Marketplace/Market.module.css\";\nim"
  },
  {
    "path": "gui/pages/Content/Models/ModelDetails.js",
    "chars": 2359,
    "preview": "import React, {useState, useEffect} from \"react\";\nimport Image from \"next/image\";\nimport ModelMetrics from \"./ModelMetri"
  },
  {
    "path": "gui/pages/Content/Models/ModelForm.js",
    "chars": 10699,
    "preview": "import React, {useEffect, useRef, useState} from \"react\";\nimport {removeTab, openNewTab, createInternalId, getUserClick}"
  },
  {
    "path": "gui/pages/Content/Models/ModelInfo.js",
    "chars": 1586,
    "preview": "import React, {useState, useEffect} from \"react\";\nimport Image from \"next/image\";\n\nexport default function ModelInfo(mod"
  },
  {
    "path": "gui/pages/Content/Models/ModelMetrics.js",
    "chars": 4932,
    "preview": "import React, {useState, useEffect} from \"react\";\nimport {fetchModelData} from \"@/pages/api/DashboardService\";\nimport {f"
  },
  {
    "path": "gui/pages/Content/Models/ModelTemplate.js",
    "chars": 3189,
    "preview": "import React, {useEffect, useState} from 'react';\nimport Image from \"next/image\";\nimport {EventBus} from \"@/utils/eventB"
  },
  {
    "path": "gui/pages/Content/Models/Models.js",
    "chars": 1820,
    "preview": "import React from \"react\";\nimport 'react-toastify/dist/ReactToastify.css';\nimport {createInternalId, getUserClick} from "
  },
  {
    "path": "gui/pages/Content/Toolkits/AddTool.js",
    "chars": 2727,
    "preview": "import React, {useState, useEffect} from 'react';\nimport {addTool} from \"@/pages/api/DashboardService\";\nimport {removeTa"
  },
  {
    "path": "gui/pages/Content/Toolkits/Metrics.js",
    "chars": 5544,
    "preview": "import React, {useState, useEffect, useRef} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport '"
  },
  {
    "path": "gui/pages/Content/Toolkits/Tool.module.css",
    "chars": 4095,
    "preview": ".tool_filter {\n    font-size: 14px;\n    padding: 5px 8px;\n    border-radius: 8px;\n    cursor: pointer;\n    margin-right:"
  },
  {
    "path": "gui/pages/Content/Toolkits/ToolkitWorkspace.js",
    "chars": 10623,
    "preview": "import React, {useEffect, useRef, useState} from 'react';\nimport Image from 'next/image';\nimport {ToastContainer, toast}"
  },
  {
    "path": "gui/pages/Content/Toolkits/Toolkits.js",
    "chars": 1921,
    "preview": "import React from 'react';\nimport Image from \"next/image\";\nimport {createInternalId, returnToolkitIcon, excludedToolkits"
  },
  {
    "path": "gui/pages/Dashboard/Content.js",
    "chars": 22360,
    "preview": "import React, {useEffect, useRef, useState} from 'react';\nimport Agents from '../Content/Agents/Agents';\nimport Knowledg"
  },
  {
    "path": "gui/pages/Dashboard/Dashboard.module.css",
    "chars": 2059,
    "preview": ".logo {\n    cursor: default;\n}\n\n.empty_state {\n    background-color: #2F2C40;\n    width: 100%;\n    height: 100%;\n    bor"
  },
  {
    "path": "gui/pages/Dashboard/Settings/AddDatabase.js",
    "chars": 16115,
    "preview": "import React, {useState, useEffect} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport 'react-to"
  },
  {
    "path": "gui/pages/Dashboard/Settings/ApiKeys.js",
    "chars": 12476,
    "preview": "import React, {useState, useEffect, useRef} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport '"
  },
  {
    "path": "gui/pages/Dashboard/Settings/Database.js",
    "chars": 8263,
    "preview": "import React, {useState, useEffect} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport 'react-to"
  },
  {
    "path": "gui/pages/Dashboard/Settings/DatabaseDetails.js",
    "chars": 8844,
    "preview": "import React, {useState, useEffect} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport 'react-to"
  },
  {
    "path": "gui/pages/Dashboard/Settings/Model.js",
    "chars": 4615,
    "preview": "import React, {useState, useEffect, useRef} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport '"
  },
  {
    "path": "gui/pages/Dashboard/Settings/Settings.js",
    "chars": 2641,
    "preview": "import React, {useState, useEffect} from 'react';\nimport 'react-toastify/dist/ReactToastify.css';\nimport styles from \"@/"
  },
  {
    "path": "gui/pages/Dashboard/Settings/Webhooks.js",
    "chars": 5493,
    "preview": "import React, {useState, useEffect} from 'react';\nimport {ToastContainer, toast} from 'react-toastify';\nimport 'react-to"
  },
  {
    "path": "gui/pages/Dashboard/SideBar.js",
    "chars": 1870,
    "preview": "import React, {useState} from 'react';\nimport Image from 'next/image';\nimport styles from './Dashboard.module.css';\nimpo"
  },
  {
    "path": "gui/pages/Dashboard/TopBar.js",
    "chars": 5957,
    "preview": "import React, {useState} from 'react';\nimport Image from 'next/image';\nimport styles from './Dashboard.module.css';\nimpo"
  },
  {
    "path": "gui/pages/_app.css",
    "chars": 40962,
    "preview": "* {\n    -webkit-font-smoothing: antialiased !important;\n    text-rendering: optimizelegibility !important;\n    -ms-overf"
  },
  {
    "path": "gui/pages/_app.js",
    "chars": 11645,
    "preview": "import React, {useState, useEffect} from 'react';\nimport SideBar from './Dashboard/SideBar';\nimport Content from './Dash"
  },
  {
    "path": "gui/pages/api/DashboardService.js",
    "chars": 11955,
    "preview": "import api from './apiConfig';\n\nexport const getOrganisation = (userId) => {\n  return api.get(`/organisations/get/user/$"
  },
  {
    "path": "gui/pages/api/apiConfig.js",
    "chars": 1275,
    "preview": "import axios from 'axios';\nimport Cookies from \"js-cookie\";\n\nconst GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID;\ncons"
  },
  {
    "path": "gui/utils/eventBus.js",
    "chars": 140,
    "preview": "import mitt from 'mitt';\n\nconst emitter = mitt();\n\nexport const EventBus = {\n  on: emitter.on,\n  off: emitter.off,\n  emi"
  },
  {
    "path": "gui/utils/utils.js",
    "chars": 18939,
    "preview": "import {formatDistanceToNow, format, addMinutes} from 'date-fns';\nimport {utcToZonedTime} from 'date-fns-tz';\nimport {ba"
  },
  {
    "path": "install_tool_dependencies.sh",
    "chars": 882,
    "preview": "#!/bin/bash\n\n# Update and upgrade apt settings and apps\napt update && apt upgrade -y\nxargs apt install -y < /app/require"
  },
  {
    "path": "local-llm",
    "chars": 2065,
    "preview": "version: '3.8'\n\nservices:\n  backend:\n    volumes:\n      - \"./:/app\"\n    build: .\n    ports:\n      - \"8001:8001\"\n    depe"
  },
  {
    "path": "local-llm-gpu",
    "chars": 2799,
    "preview": "version: '3.8'\n\nservices:\n  backend:\n    volumes:\n      - \"./:/app\"\n    build: .\n    ports:\n      - \"8001:8001\"\n    depe"
  },
  {
    "path": "main.py",
    "chars": 17374,
    "preview": "import requests\nfrom fastapi import FastAPI, HTTPException, Depends, Request, status, Query\nfrom fastapi.middleware.cors"
  },
  {
    "path": "migrations/README",
    "chars": 38,
    "preview": "Generic single-database configuration."
  },
  {
    "path": "migrations/env.py",
    "chars": 3497,
    "preview": "from logging.config import fileConfig\n\nfrom sqlalchemy import engine_from_config\nfrom sqlalchemy import pool\nfrom alembi"
  },
  {
    "path": "migrations/script.py.mako",
    "chars": 510,
    "preview": "\"\"\"${message}\n\nRevision ID: ${up_revision}\nRevises: ${down_revision | comma,n}\nCreate Date: ${create_date}\n\n\"\"\"\nfrom ale"
  },
  {
    "path": "migrations/versions/1d54db311055_add_permissions.py",
    "chars": 1566,
    "preview": "\"\"\"add permissions\n\nRevision ID: 1d54db311055\nRevises: 3356a2f89a33\nCreate Date: 2023-06-14 11:05:59.678961\n\n\"\"\"\nfrom al"
  },
  {
    "path": "migrations/versions/2cc1179834b0_agent_executions_modified.py",
    "chars": 835,
    "preview": "\"\"\"agent_executions_modified\n\nRevision ID: 2cc1179834b0\nRevises: 2f97c068fab9\nCreate Date: 2023-06-02 21:01:43.303961\n\n\""
  },
  {
    "path": "migrations/versions/2f97c068fab9_resource_modified.py",
    "chars": 834,
    "preview": "\"\"\"Resource Modified\n\nRevision ID: 2f97c068fab9\nRevises: a91808a89623\nCreate Date: 2023-06-02 13:13:21.670935\n\n\"\"\"\nfrom "
  },
  {
    "path": "migrations/versions/2fbd6472112c_add_feed_group_id_to_execution_and_feed.py",
    "chars": 744,
    "preview": "\"\"\"add feed group id to execution and feed\n\nRevision ID: 2fbd6472112c\nRevises: 5184645e9f12\nCreate Date: 2023-08-01 17:0"
  },
  {
    "path": "migrations/versions/3356a2f89a33_added_configurations_table.py",
    "chars": 1661,
    "preview": "\"\"\"added_configurations_table\n\nRevision ID: 3356a2f89a33\nRevises: 35e47f20475b\nCreate Date: 2023-06-06 10:51:15.111738\n\n"
  },
  {
    "path": "migrations/versions/35e47f20475b_renamed_tokens_calls.py",
    "chars": 1172,
    "preview": "\"\"\"renamed_tokens_calls\n\nRevision ID: 35e47f20475b\nRevises: 598cfb37292a\nCreate Date: 2023-06-06 04:34:15.101672\n\n\"\"\"\nfr"
  },
  {
    "path": "migrations/versions/3867bb00a495_added_first_login_source.py",
    "chars": 700,
    "preview": "\"\"\"added_first_login_source\n\nRevision ID: 3867bb00a495\nRevises: 661ec8a4c32e\nCreate Date: 2023-09-15 02:06:24.006555\n\n\"\""
  },
  {
    "path": "migrations/versions/40affbf3022b_add_filter_colume_in_webhooks.py",
    "chars": 687,
    "preview": "\"\"\"add filter colume in webhooks\n\nRevision ID: 40affbf3022b\nRevises: 5d5f801f28e7\nCreate Date: 2023-08-28 12:30:35.17117"
  },
  {
    "path": "migrations/versions/446884dcae58_add_api_key_and_web_hook.py",
    "chars": 2185,
    "preview": "\"\"\"add api_key and web_hook\n\nRevision ID: 446884dcae58\nRevises: 71e3980d55f5\nCreate Date: 2023-07-29 10:55:21.714245\n\n\"\""
  },
  {
    "path": "migrations/versions/44b0d6f2d1b3_init_models.py",
    "chars": 6061,
    "preview": "\"\"\"init models\n\nRevision ID: 44b0d6f2d1b3\nRevises: \nCreate Date: 2023-06-01 11:55:35.195423\n\n\"\"\"\nfrom alembic import op\n"
  },
  {
    "path": "migrations/versions/467e85d5e1cd_updated_resources_added_exec_id.py",
    "chars": 716,
    "preview": "\"\"\"updated_resources_added_exec_id\n\nRevision ID: 467e85d5e1cd\nRevises: ba60b12ae109\nCreate Date: 2023-07-10 08:54:46.702"
  },
  {
    "path": "migrations/versions/516ecc1c723d_adding_marketplace_template_id_to_agent_.py",
    "chars": 594,
    "preview": "\"\"\"adding marketplace_template_id to agent tempaltes\n\nRevision ID: 516ecc1c723d\nRevises: 8962bed0d809\nCreate Date: 2023-"
  },
  {
    "path": "migrations/versions/5184645e9f12_add_question_to_agent_execution_.py",
    "chars": 538,
    "preview": "\"\"\"add question to agent execution permission\n\nRevision ID: 5184645e9f12\nRevises: 9419b3340af7\nCreate Date: 2023-07-21 0"
  },
  {
    "path": "migrations/versions/520aa6776347_create_models_config.py",
    "chars": 1005,
    "preview": "\"\"\"create models config\n\nRevision ID: 520aa6776347\nRevises: 71e3980d55f5\nCreate Date: 2023-08-01 07:48:13.724938\n\n\"\"\"\nfr"
  },
  {
    "path": "migrations/versions/598cfb37292a_adding_agent_templates.py",
    "chars": 2826,
    "preview": "\"\"\"adding agent templates\n\nRevision ID: 598cfb37292a\nRevises: 2f97c068fab9\nCreate Date: 2023-06-05 12:44:30.982492\n\n\"\"\"\n"
  },
  {
    "path": "migrations/versions/5d5f801f28e7_create_model_table.py",
    "chars": 1346,
    "preview": "\"\"\"create model table\n\nRevision ID: 5d5f801f28e7\nRevises: 520aa6776347\nCreate Date: 2023-08-07 05:36:29.791610\n\n\"\"\"\nfrom"
  },
  {
    "path": "migrations/versions/661ec8a4c32e_open_ai_error_handling.py",
    "chars": 883,
    "preview": "\"\"\"open_ai_error_handling\n\nRevision ID: 661ec8a4c32e\nRevises: 40affbf3022b\nCreate Date: 2023-09-07 10:41:07.462436\n\n\"\"\"\n"
  },
  {
    "path": "migrations/versions/71e3980d55f5_knowledge_and_vector_dbs.py",
    "chars": 3549,
    "preview": "\"\"\"Knowledge and Vector dbs\n\nRevision ID: 71e3980d55f5\nRevises: cac478732572\nCreate Date: 2023-07-26 07:18:06.492832\n\n\"\""
  },
  {
    "path": "migrations/versions/7a3e336c0fba_added_tools_related_models.py",
    "chars": 1813,
    "preview": "\"\"\"added_tools_related_models\n\nRevision ID: 7a3e336c0fba\nRevises: 516ecc1c723d\nCreate Date: 2023-06-18 11:05:35.801505\n\n"
  },
  {
    "path": "migrations/versions/83424de1347e_added_agent_execution_config.py",
    "chars": 1033,
    "preview": "\"\"\"added_agent_execution_config\n\nRevision ID: 83424de1347e\nRevises: c02f3d759bf3\nCreate Date: 2023-07-03 22:42:50.091762"
  },
  {
    "path": "migrations/versions/8962bed0d809_creating_agent_templates.py",
    "chars": 1973,
    "preview": "\"\"\"creating agent templates\n\nRevision ID: 8962bed0d809\nRevises: d9b3436197eb\nCreate Date: 2023-06-10 15:40:08.942612\n\n\"\""
  },
  {
    "path": "migrations/versions/9270eb5a8475_local_llms.py",
    "chars": 681,
    "preview": "\"\"\"local_llms\n\nRevision ID: 9270eb5a8475\nRevises: 3867bb00a495\nCreate Date: 2023-10-04 09:26:33.865424\n\n\"\"\"\nfrom alembic"
  },
  {
    "path": "migrations/versions/9419b3340af7_create_agent_workflow.py",
    "chars": 2685,
    "preview": "\"\"\"create agent workflow\n\nRevision ID: 9419b3340af7\nRevises: fe234ea6e9bc\nCreate Date: 2023-07-18 16:46:03.497943\n\n\"\"\"\nf"
  },
  {
    "path": "migrations/versions/a91808a89623_added_resources.py",
    "chars": 1488,
    "preview": "\"\"\"added resources\n\nRevision ID: a91808a89623\nRevises: 44b0d6f2d1b3\nCreate Date: 2023-06-01 07:00:33.982485\n\n\"\"\"\nfrom al"
  },
  {
    "path": "migrations/versions/ba60b12ae109_create_agent_scheduler.py",
    "chars": 1886,
    "preview": "\"\"\"create_agent_scheduler\n\nRevision ID: ba60b12ae109\nRevises: 83424de1347e\nCreate Date: 2023-07-04 10:58:37.991063\n\n\"\"\"\n"
  },
  {
    "path": "migrations/versions/be1d922bf2ad_create_call_logs_table.py",
    "chars": 1186,
    "preview": "\"\"\"create call logs table\n\nRevision ID: be1d922bf2ad\nRevises: 2fbd6472112c\nCreate Date: 2023-08-08 08:42:37.148178\n\n\"\"\"\n"
  },
  {
    "path": "migrations/versions/c02f3d759bf3_add_summary_to_resource.py",
    "chars": 682,
    "preview": "\"\"\"add summary to resource\n\nRevision ID: c02f3d759bf3\nRevises: 1d54db311055\nCreate Date: 2023-06-27 05:07:29.016704\n\n\"\"\""
  },
  {
    "path": "migrations/versions/c4f2f6ba602a_agent_workflow_wait_step.py",
    "chars": 1202,
    "preview": "\"\"\"agent_workflow_wait_step\n\nRevision ID: c4f2f6ba602a\nRevises: 40affbf3022b\nCreate Date: 2023-09-04 05:34:10.195248\n\n\"\""
  },
  {
    "path": "migrations/versions/c5c19944c90c_create_oauth_tokens.py",
    "chars": 2107,
    "preview": "\"\"\"Create Oauth Tokens\n\nRevision ID: c5c19944c90c\nRevises: 7a3e336c0fba\nCreate Date: 2023-06-30 07:26:29.180784\n\n\"\"\"\nfro"
  },
  {
    "path": "migrations/versions/cac478732572_delete_agent_feature.py",
    "chars": 507,
    "preview": "\"\"\"delete_agent_feature\n\nRevision ID: cac478732572\nRevises: e39295ec089c\nCreate Date: 2023-07-13 17:18:42.003412\n\n\"\"\"\nfr"
  },
  {
    "path": "migrations/versions/d8315244ea43_updated_tool_configs.py",
    "chars": 964,
    "preview": "\"\"\"updated_tool_configs\n\nRevision ID: d8315244ea43\nRevises: 71e3980d55f5\nCreate Date: 2023-08-01 11:11:32.725355\n\n\"\"\"\nfr"
  },
  {
    "path": "migrations/versions/d9b3436197eb_renaming_templates.py",
    "chars": 1153,
    "preview": "\"\"\"renaming templates\n\nRevision ID: d9b3436197eb\nRevises: 3356a2f89a33\nCreate Date: 2023-06-10 09:28:28.262705\n\n\"\"\"\nfrom"
  },
  {
    "path": "migrations/versions/e39295ec089c_creating_events.py",
    "chars": 1528,
    "preview": "\"\"\"creating events\n\nRevision ID: e39295ec089c\nRevises: 7a3e336c0fba\nCreate Date: 2023-06-30 12:23:12.269999\n\n\"\"\"\nfrom al"
  },
  {
    "path": "migrations/versions/fe234ea6e9bc_modify_agent_workflow_tables.py",
    "chars": 1309,
    "preview": "\"\"\"update agent workflow tables\n\nRevision ID: fe234ea6e9bc\nRevises: d8315244ea43\nCreate Date: 2023-07-18 16:46:29.305378"
  },
  {
    "path": "nginx/default.conf",
    "chars": 737,
    "preview": "server {\n  listen 80;\n\n  location / {\n    proxy_pass http://gui:3000;\n    proxy_set_header Host $host;\n    proxy_set_hea"
  },
  {
    "path": "package.json",
    "chars": 82,
    "preview": "{\n  \"dependencies\": {\n    \"axios\": \"^1.4.0\",\n    \"react-toastify\": \"^9.1.3\"\n  }\n}\n"
  },
  {
    "path": "requirements.txt",
    "chars": 2899,
    "preview": "aiohttp==3.8.4\naiosignal==1.3.1\nalembic==1.11.1\namqp==5.1.1\nanyio==3.7.0\napiclient==1.0.4\nappdirs==1.4.4\nasync-timeout=="
  },
  {
    "path": "run.bat",
    "chars": 928,
    "preview": "@echo off\necho Checking if config.yaml file exists...\nif not exist config.yaml (\n    echo ERROR: config.yaml file not fo"
  },
  {
    "path": "run.sh",
    "chars": 2007,
    "preview": "#!/bin/bash\n\n# Check if config.yaml file exists\nif [ ! -f \"config.yaml\" ]; then\n    echo \"ERROR: config.yaml file not fo"
  },
  {
    "path": "run_gui.py",
    "chars": 1553,
    "preview": "import os\nimport sys\nimport subprocess\nfrom time import sleep\nimport shutil\nfrom superagi.lib.logger import logger\n\ndef "
  },
  {
    "path": "run_gui.sh",
    "chars": 884,
    "preview": "#!/bin/bash\n\napi_process=\"\"\nui_process=\"\"\n\nfunction check_command() {\n  command -v \"$1\" >/dev/null 2>&1\n  if [ $? -ne 0 "
  },
  {
    "path": "superagi/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "superagi/agent/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "superagi/agent/agent_iteration_step_handler.py",
    "chars": 13758,
    "preview": "from datetime import datetime\nimport json\nfrom sqlalchemy import asc\nfrom sqlalchemy.sql.operators import and_\nimport lo"
  },
  {
    "path": "superagi/agent/agent_message_builder.py",
    "chars": 9157,
    "preview": "import time\nfrom typing import Tuple, List\nfrom sqlalchemy import asc\n\nfrom superagi.config.config import get_config\nfro"
  },
  {
    "path": "superagi/agent/agent_prompt_builder.py",
    "chars": 6179,
    "preview": "import json\nimport re\n\nfrom pydantic.types import List\n\nfrom superagi.helper.token_counter import TokenCounter\nfrom supe"
  },
  {
    "path": "superagi/agent/agent_prompt_template.py",
    "chars": 2473,
    "preview": "import re\n\nfrom pydantic.types import List\n\nfrom superagi.helper.prompt_reader import PromptReader\n\nFINISH_NAME = \"finis"
  },
  {
    "path": "superagi/agent/agent_tool_step_handler.py",
    "chars": 13259,
    "preview": "import json\n\nfrom superagi.agent.task_queue import TaskQueue\nfrom superagi.agent.agent_message_builder import AgentLlmMe"
  },
  {
    "path": "superagi/agent/agent_workflow_step_wait_handler.py",
    "chars": 2239,
    "preview": "from datetime import datetime\n\nfrom superagi.agent.types.agent_execution_status import AgentExecutionStatus\nfrom superag"
  },
  {
    "path": "superagi/agent/common_types.py",
    "chars": 279,
    "preview": "from pydantic import BaseModel\n\n\nclass ToolExecutorResponse(BaseModel):\n    status: str\n    result: str = None\n    retry"
  },
  {
    "path": "superagi/agent/output_handler.py",
    "chars": 9495,
    "preview": "import json\nfrom superagi.agent.common_types import TaskExecutorResponse, ToolExecutorResponse\nfrom superagi.agent.outpu"
  },
  {
    "path": "superagi/agent/output_parser.py",
    "chars": 2548,
    "preview": "import json\nfrom abc import ABC, abstractmethod\nfrom typing import Dict, NamedTuple, List\nimport re\nimport ast\nimport js"
  },
  {
    "path": "superagi/agent/prompts/agent_queue_input.txt",
    "chars": 291,
    "preview": "Use the below instruction and break down the last response to an individual array of items that can be inserted into the"
  },
  {
    "path": "superagi/agent/prompts/agent_recursive_summary.txt",
    "chars": 803,
    "preview": "AI, you are provided with a previous summary of interactions between the system, user, and assistant, as well as additio"
  },
  {
    "path": "superagi/agent/prompts/agent_summary.txt",
    "chars": 517,
    "preview": "AI, your task is to generate a concise summary of the previous interactions between the system, user, and assistant.\nThe"
  },
  {
    "path": "superagi/agent/prompts/agent_tool_input.txt",
    "chars": 824,
    "preview": "{tool_name} is the most suitable tool for the given instruction, use {tool_name} to perform the below instruction which "
  },
  {
    "path": "superagi/agent/prompts/agent_tool_output.txt",
    "chars": 300,
    "preview": "Analyze {tool_name} output and follow the instruction to come up with the response:\nHigh-Level GOAL:\n`{goals}`\n\nTOOL OUT"
  },
  {
    "path": "superagi/agent/prompts/analyse_task.txt",
    "chars": 1261,
    "preview": "High level goal:\n{goals}\n\n{task_instructions}\n\nYour Current Task: `{current_task}`\n\nTask History:\n`{task_history}`\n\nBase"
  },
  {
    "path": "superagi/agent/prompts/create_tasks.txt",
    "chars": 693,
    "preview": "You are an AI assistant to create task.\n\nHigh level goal:\n{goals}\n\n{task_instructions}\n\nYou have following incomplete ta"
  },
  {
    "path": "superagi/agent/prompts/initialize_tasks.txt",
    "chars": 483,
    "preview": "You are a task-generating AI known as SuperAGI. You are not a part of any system or device. Your role is to understand t"
  },
  {
    "path": "superagi/agent/prompts/prioritize_tasks.txt",
    "chars": 629,
    "preview": "You are a task prioritization AI assistant.\n\nHigh level goal:\n{goals}\n\n{task_instructions}\n\nYou have following incomplet"
  },
  {
    "path": "superagi/agent/prompts/superagi.txt",
    "chars": 2503,
    "preview": "You are SuperAGI an AI assistant to solve complex problems. Your decisions must always be made independently without see"
  },
  {
    "path": "superagi/agent/queue_step_handler.py",
    "chars": 5820,
    "preview": "import time\n\nimport numpy as np\n\nfrom superagi.agent.agent_message_builder import AgentLlmMessageBuilder\nfrom superagi.a"
  },
  {
    "path": "superagi/agent/task_queue.py",
    "chars": 1551,
    "preview": "import json\n\nimport redis\n\nfrom superagi.config.config import get_config\n\nredis_url = get_config('REDIS_URL') or \"localh"
  },
  {
    "path": "superagi/agent/tool_builder.py",
    "chars": 5322,
    "preview": "import importlib\nimport os\nfrom superagi.config.config import get_config\nfrom superagi.llms.llm_model_factory import get"
  },
  {
    "path": "superagi/agent/tool_executor.py",
    "chars": 3123,
    "preview": "from pydantic import ValidationError\n\nfrom superagi.agent.common_types import ToolExecutorResponse\nfrom superagi.apm.eve"
  },
  {
    "path": "superagi/agent/types/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "superagi/agent/types/agent_execution_status.py",
    "chars": 566,
    "preview": "from enum import Enum\n\n\nclass AgentExecutionStatus(Enum):\n    RUNNING = 'RUNNING'\n    WAITING_FOR_PERMISSION = 'WAITING_"
  },
  {
    "path": "superagi/agent/types/agent_workflow_step_action_types.py",
    "chars": 474,
    "preview": "from enum import Enum\n\n\nclass AgentWorkflowStepAction(Enum):\n    ITERATION_WORKFLOW = 'ITERATION_WORKFLOW'\n    TOOL = 'T"
  },
  {
    "path": "superagi/agent/types/wait_step_status.py",
    "chars": 466,
    "preview": "from enum import Enum\n\n\nclass AgentWorkflowStepWaitStatus(Enum):\n    PENDING = 'PENDING'\n    WAITING = 'WAITING'\n    COM"
  },
  {
    "path": "superagi/agent/workflow_seed.py",
    "chars": 19591,
    "preview": "from superagi.agent.agent_prompt_builder import AgentPromptBuilder\nfrom superagi.agent.agent_prompt_template import Agen"
  },
  {
    "path": "superagi/apm/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "superagi/apm/analytics_helper.py",
    "chars": 9643,
    "preview": "from typing import List, Dict, Union, Any\nfrom sqlalchemy import text, func, and_\nfrom sqlalchemy.orm import Session\n\nfr"
  },
  {
    "path": "superagi/apm/call_log_helper.py",
    "chars": 3698,
    "preview": "import logging\nfrom typing import Optional\nfrom sqlalchemy.exc import SQLAlchemyError\nfrom sqlalchemy.orm import Session"
  },
  {
    "path": "superagi/apm/event_handler.py",
    "chars": 895,
    "preview": "import logging\nfrom typing import Optional, Dict\nfrom sqlalchemy.exc import SQLAlchemyError\nfrom sqlalchemy.orm import S"
  },
  {
    "path": "superagi/apm/knowledge_handler.py",
    "chars": 5971,
    "preview": "from sqlalchemy.orm import Session\nfrom superagi.models.events import Event\nfrom superagi.models.knowledges import Knowl"
  },
  {
    "path": "superagi/apm/tools_handler.py",
    "chars": 7641,
    "preview": "from typing import List, Dict, Union\nfrom sqlalchemy import func, distinct, and_\nfrom sqlalchemy.orm import Session\nfrom"
  },
  {
    "path": "superagi/config/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "superagi/config/config.py",
    "chars": 1645,
    "preview": "import os\nfrom pydantic import BaseSettings\nfrom pathlib import Path\nimport yaml\nfrom superagi.lib.logger import logger\n"
  },
  {
    "path": "superagi/controllers/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "superagi/controllers/agent.py",
    "chars": 17677,
    "preview": "from fastapi import APIRouter\nfrom fastapi import HTTPException, Depends\nfrom fastapi_jwt_auth import AuthJWT\nfrom fasta"
  },
  {
    "path": "superagi/controllers/agent_execution.py",
    "chars": 17574,
    "preview": "from datetime import datetime\nfrom typing import Optional, Union, List\n\nfrom fastapi_sqlalchemy import db\nfrom fastapi i"
  },
  {
    "path": "superagi/controllers/agent_execution_config.py",
    "chars": 4133,
    "preview": "import ast\nimport json\n\nfrom fastapi import APIRouter\nfrom fastapi import HTTPException, Depends\nfrom fastapi_jwt_auth i"
  },
  {
    "path": "superagi/controllers/agent_execution_feed.py",
    "chars": 9204,
    "preview": "import asyncio\nfrom datetime import datetime\nimport time\nfrom typing import Optional\n\nfrom fastapi import APIRouter, Bac"
  },
  {
    "path": "superagi/controllers/agent_execution_permission.py",
    "chars": 6414,
    "preview": "from datetime import datetime\nfrom typing import Annotated\n\nfrom fastapi_sqlalchemy import db\nfrom fastapi import HTTPEx"
  },
  {
    "path": "superagi/controllers/agent_template.py",
    "chars": 22236,
    "preview": "from datetime import datetime\n\nfrom fastapi import APIRouter\nfrom fastapi import HTTPException, Depends\nfrom fastapi_sql"
  },
  {
    "path": "superagi/controllers/agent_workflow.py",
    "chars": 703,
    "preview": "from fastapi import APIRouter\nfrom fastapi import Depends\nfrom fastapi_sqlalchemy import db\n\nfrom superagi.helper.auth i"
  },
  {
    "path": "superagi/controllers/analytics.py",
    "chars": 4888,
    "preview": "from fastapi import APIRouter, Depends, HTTPException\nfrom superagi.helper.auth import check_auth, get_user_organisation"
  },
  {
    "path": "superagi/controllers/api/agent.py",
    "chars": 17721,
    "preview": "from fastapi import APIRouter\nfrom fastapi import HTTPException, Depends ,Security\n\nfrom fastapi_sqlalchemy import db\nfr"
  },
  {
    "path": "superagi/controllers/api_key.py",
    "chars": 2018,
    "preview": "import json\nimport uuid\nfrom fastapi import APIRouter, Body\nfrom fastapi import HTTPException, Depends\nfrom fastapi_jwt_"
  },
  {
    "path": "superagi/controllers/budget.py",
    "chars": 2155,
    "preview": "from fastapi import APIRouter\nfrom fastapi import HTTPException, Depends\nfrom fastapi_jwt_auth import AuthJWT\nfrom fasta"
  },
  {
    "path": "superagi/controllers/config.py",
    "chars": 5403,
    "preview": "from datetime import datetime\nfrom typing import Optional\n\nfrom fastapi import APIRouter\nfrom pydantic import BaseModel\n"
  },
  {
    "path": "superagi/controllers/google_oauth.py",
    "chars": 4011,
    "preview": "from fastapi import Depends, Query\nfrom fastapi import APIRouter\nfrom fastapi.responses import RedirectResponse\nfrom fas"
  },
  {
    "path": "superagi/controllers/knowledge_configs.py",
    "chars": 593,
    "preview": "from fastapi_sqlalchemy import db\nfrom fastapi import HTTPException, Depends, Query, status\nfrom fastapi import APIRoute"
  }
]

// ... and 430 more files (download for full content)

About this extraction

This page contains the full source code of the TransformerOptimus/SuperAGI GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 630 files (1.9 MB), approximately 460.6k tokens, and a symbol index with 2048 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!