diff --git a/404.html b/404.html index d072212..bc4bd7c 100644 --- a/404.html +++ b/404.html @@ -198,14 +198,14 @@ diff --git a/app/index.html b/app/index.html index 56a04d3..7f70931 100644 --- a/app/index.html +++ b/app/index.html @@ -203,14 +203,14 @@ diff --git a/index.html b/index.html index ee88bbf..67eda6b 100644 --- a/index.html +++ b/index.html @@ -260,14 +260,14 @@ diff --git a/search/search_index.json b/search/search_index.json index f0d15db..5c67942 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to DemoGPT Documentation","text":"

DemoGPT is an open-source project that leverages the power of Large Language Models (LLM) to auto-generate LangChain code, which is then transformed into interactive Streamlit applications. This process is powered by the synergy of GPT-3.5-turbo & Llama 2.

"},{"location":"#brief-description","title":"Brief Description","text":"

DemoGPT is a revolutionary initiative reshaping the landscape of LLM-based application development. By combining the capabilities of GPT-3.5-turbo and Llama 2, DemoGPT auto-generates LangChain code, which is then transformed into interactive Streamlit applications. This process is enriched with a sophisticated architecture that translates user instructions into interactive applications. DemoGPT is more than a project; it's a visionary approach, pushing the boundaries of what's possible in LLM-based application development.

"},{"location":"#core-functionalities","title":"Core Functionalities","text":"

DemoGPT's core functionalities revolve around four main steps:

  1. Planning: DemoGPT starts by generating a plan from the user's instruction.
  2. Task Creation: It then creates specific tasks from the plan and instruction.
  3. Code Snippet Generation: These tasks are transferred into code snippets.
  4. Final Code Assembly: The code snippets are combined into a final code, resulting in an interactive Streamlit app.

These functionalities allow DemoGPT to transform user instructions into interactive applications, making it a powerful tool for LLM-based application development.

"},{"location":"#project-structure","title":"Project Structure","text":"

The project is organized into several modules and files. Here's a brief overview of the project structure:

Please navigate through the documentation for a detailed understanding of the project.

"},{"location":"app/","title":"Streamlit Application Documentation","text":""},{"location":"app/#introduction","title":"Introduction","text":"

This Python Streamlit application uses LogicModel and StreamlitModel from the model module to generate and execute Python code based on user input. The user can input their idea, and the application will generate code, refine it, test it, and display the results. The Streamlit web app allows users to interact with the model in real time, which is particularly useful for demonstrating the capabilities of the models.

"},{"location":"app/#application-flow","title":"Application Flow","text":""},{"location":"app/#importing-dependencies","title":"Importing Dependencies","text":"

At the beginning of the application, all necessary modules such as streamlit, model, os, logging, webbrowser, and signal are imported. The logging level is set to DEBUG with the format 'levelname-message'.

"},{"location":"app/#loading-environment-variables","title":"Loading Environment Variables","text":"

The application tries to load environment variables using the dotenv module. If the module is not present, it logs an error message but continues to execute the application.

"},{"location":"app/#generate-response","title":"Generate Response","text":"

The function generate_response uses the LogicModel to generate responses for the given text. It's a generator function yielding the output of the LogicModel in each iteration.

"},{"location":"app/#streamlit-configuration","title":"Streamlit Configuration","text":"

The title of the Streamlit page is set using st.set_page_config.

"},{"location":"app/#input-fields","title":"Input Fields","text":"

Input fields for the OpenAI API Key, demo title, and demo idea are created using st.sidebar.text_input, st.text_input, and st.text_area respectively. The OpenAI API Key defaults to the value of the environment variable 'OPENAI_API_KEY'.

"},{"location":"app/#submission-form","title":"Submission Form","text":"

A form is created to handle the submission of user input. If the user submits the form, the application checks if a valid OpenAI API Key is entered. If not, it displays a warning message.

If the input is valid, instances of LogicModel and StreamlitModel are created with the provided OpenAI API Key.

"},{"location":"app/#running-the-model","title":"Running the Model","text":"

The application then enters a loop where it generates, refines, tests and executes code using the LogicModel. The progress of this process is displayed on a Streamlit progress bar.

If the code execution is successful, it launches a new Streamlit application running the generated code and opens the new application in the web browser.

In case the execution was not successful, the application refines the code and retries. If all attempts are unsuccessful, it reports a failure.

"},{"location":"src_plan/","title":"src/plan Module","text":"

The src/plan module is the core directory of the DemoGPT project. It contains the main application and the modules for the different stages of the DemoGPT pipeline.

"},{"location":"src_plan/#files-in-srcplan","title":"Files in src/plan","text":""},{"location":"src_plan/#chains-folder","title":"chains Folder","text":"

The chains folder contains the files related to the task chains and their definitions.

"},{"location":"src_plan/#prompts-folder","title":"prompts Folder","text":"

The prompts folder under chains contains all the necessary prompts for the models.

"},{"location":"src_plan/#summary","title":"Summary","text":"

The src/plan module is the heart of the DemoGPT project. It orchestrates the different stages of the pipeline, from planning to task creation, code snippet generation, and final code assembly. The chains folder within this module contains the definitions and implementations of the tasks, as well as the prompts for the models. The test_cases.py and test.py files provide a suite of tests to ensure the correct functioning of the modules.

"},{"location":"src_plan_chains/","title":"src/plan/chains Module","text":"

The src/plan/chains module is a subdirectory of the src/plan module in the DemoGPT project. It contains the files related to the task chains and their definitions.

"},{"location":"src_plan_chains/#files-in-srcplanchains","title":"Files in src/plan/chains","text":""},{"location":"src_plan_chains/#prompts-folder","title":"prompts Folder","text":"

The prompts folder under chains contains all the necessary prompts for the models.

"},{"location":"src_plan_chains/#summary","title":"Summary","text":"

The src/plan/chains module is a crucial part of the DemoGPT project. It contains the definitions and implementations of the tasks that are used in the DemoGPT pipeline. The chains.py file includes the model definitions for the plan, tasks, and final stages of the pipeline. The task_chains.py and task_definitions.py files contain the implementations and definitions of all the available tasks, respectively. The prompts folder contains the prompts for the models, which are used to guide the models in performing the tasks.

"},{"location":"src_plan_chains_prompts/","title":"src/plan/chains/prompts Module","text":"

The src/plan/chains/prompts module is a subdirectory of the src/plan/chains module in the DemoGPT project. It contains the files related to the prompts for the models.

"},{"location":"src_plan_chains_prompts/#files-in-srcplanchainsprompts","title":"Files in src/plan/chains/prompts","text":""},{"location":"src_plan_chains_prompts/#task_list-folder","title":"task_list Folder","text":"

The task_list folder under prompts contains the prompts for the available tasks.

"},{"location":"src_plan_chains_prompts/#summary","title":"Summary","text":"

The src/plan/chains/prompts module is a crucial part of the DemoGPT project. It contains the prompts that guide the models in performing the tasks in the DemoGPT pipeline. The plan.py, tasks.py, and final.py files include the prompts for the plan generation, task generation, and finalization stages of the pipeline, respectively. The task_list folder within prompts contains the prompts for the available tasks.

"},{"location":"src_plan_chains_prompts_tasks/","title":"src/plan/chains/prompts/task_list Module","text":"

The src/plan/chains/prompts/task_list module is a subdirectory of the src/plan/chains/prompts module in the DemoGPT project. It contains the files related to the tasks and their definitions.

"},{"location":"src_plan_chains_prompts_tasks/#files-in-srcplanchainspromptstask_list","title":"Files in src/plan/chains/prompts/task_list","text":""},{"location":"src_plan_chains_prompts_tasks/#summary","title":"Summary","text":"

The src/plan/chains/prompts/task_list module contains the definitions of all tasks used in the DemoGPT pipeline. Each task has a specific purpose and is good at performing a certain function. The tasks range from getting user input and showing output to the user, to generating intelligent text output, transforming text into a list, routing queries, answering questions that require external search on the web, summarizing long text, answering questions related to a file, solving math problems, executing bash commands, and providing weather-related information.

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to DemoGPT Documentation","text":"

DemoGPT is an open-source project that leverages the power of Large Language Models (LLM) to auto-generate LangChain code, which is then transformed into interactive Streamlit applications. This process is powered by the synergy of GPT-3.5-turbo & Llama 2.

"},{"location":"#brief-description","title":"Brief Description","text":"

DemoGPT is a revolutionary initiative reshaping the landscape of LLM-based application development. By combining the capabilities of GPT-3.5-turbo and Llama 2, DemoGPT auto-generates LangChain code, which is then transformed into interactive Streamlit applications. This process is enriched with a sophisticated architecture that translates user instructions into interactive applications. DemoGPT is more than a project; it's a visionary approach, pushing the boundaries of what's possible in LLM-based application development.

"},{"location":"#core-functionalities","title":"Core Functionalities","text":"

DemoGPT's core functionalities revolve around four main steps:

  1. Planning: DemoGPT starts by generating a plan from the user's instruction.
  2. Task Creation: It then creates specific tasks from the plan and instruction.
  3. Code Snippet Generation: These tasks are transferred into code snippets.
  4. Final Code Assembly: The code snippets are combined into a final code, resulting in an interactive Streamlit app.

These functionalities allow DemoGPT to transform user instructions into interactive applications, making it a powerful tool for LLM-based application development.

"},{"location":"#project-structure","title":"Project Structure","text":"

The project is organized into several modules and files. Here's a brief overview of the project structure:

Please navigate through the documentation for a detailed understanding of the project.

"},{"location":"app/","title":"Streamlit Application Documentation","text":""},{"location":"app/#introduction","title":"Introduction","text":"

This Python Streamlit application uses LogicModel and StreamlitModel from the model module to generate and execute Python code based on user input. The user can input their idea, and the application will generate code, refine it, test it, and display the results. The Streamlit web app allows users to interact with the model in real time, which is particularly useful for demonstrating the capabilities of the models.

"},{"location":"app/#application-flow","title":"Application Flow","text":""},{"location":"app/#importing-dependencies","title":"Importing Dependencies","text":"

At the beginning of the application, all necessary modules such as streamlit, model, os, logging, webbrowser, and signal are imported. The logging level is set to DEBUG with the format 'levelname-message'.

"},{"location":"app/#loading-environment-variables","title":"Loading Environment Variables","text":"

The application tries to load environment variables using the dotenv module. If the module is not present, it logs an error message but continues to execute the application.

"},{"location":"app/#generate-response","title":"Generate Response","text":"

The function generate_response uses the LogicModel to generate responses for the given text. It's a generator function yielding the output of the LogicModel in each iteration.

"},{"location":"app/#streamlit-configuration","title":"Streamlit Configuration","text":"

The title of the Streamlit page is set using st.set_page_config.

"},{"location":"app/#input-fields","title":"Input Fields","text":"

Input fields for the OpenAI API Key, demo title, and demo idea are created using st.sidebar.text_input, st.text_input, and st.text_area respectively. The OpenAI API Key defaults to the value of the environment variable 'OPENAI_API_KEY'.

"},{"location":"app/#submission-form","title":"Submission Form","text":"

A form is created to handle the submission of user input. If the user submits the form, the application checks if a valid OpenAI API Key is entered. If not, it displays a warning message.

If the input is valid, instances of LogicModel and StreamlitModel are created with the provided OpenAI API Key.

"},{"location":"app/#running-the-model","title":"Running the Model","text":"

The application then enters a loop where it generates, refines, tests and executes code using the LogicModel. The progress of this process is displayed on a Streamlit progress bar.

If the code execution is successful, it launches a new Streamlit application running the generated code and opens the new application in the web browser.

In case the execution was not successful, the application refines the code and retries. If all attempts are unsuccessful, it reports a failure.

"},{"location":"src_plan/","title":"src/plan Module","text":"

The src/plan module is the core directory of the DemoGPT project. It contains the main application and the modules for the different stages of the DemoGPT pipeline.

"},{"location":"src_plan/#files-in-srcplan","title":"Files in src/plan","text":""},{"location":"src_plan/#chains-folder","title":"chains Folder","text":"

The chains folder contains the files related to the task chains and their definitions.

"},{"location":"src_plan/#prompts-folder","title":"prompts Folder","text":"

The prompts folder under chains contains all the necessary prompts for the models.

"},{"location":"src_plan/#summary","title":"Summary","text":"

The src/plan module is the heart of the DemoGPT project. It orchestrates the different stages of the pipeline, from planning to task creation, code snippet generation, and final code assembly. The chains folder within this module contains the definitions and implementations of the tasks, as well as the prompts for the models. The test_cases.py and test.py files provide a suite of tests to ensure the correct functioning of the modules.

"},{"location":"src_plan_chains/","title":"src/plan/chains Module","text":"

The src/plan/chains module is a subdirectory of the src/plan module in the DemoGPT project. It contains the files related to the task chains and their definitions.

"},{"location":"src_plan_chains/#files-in-srcplanchains","title":"Files in src/plan/chains","text":""},{"location":"src_plan_chains/#prompts-folder","title":"prompts Folder","text":"

The prompts folder under chains contains all the necessary prompts for the models.

"},{"location":"src_plan_chains/#summary","title":"Summary","text":"

The src/plan/chains module is a crucial part of the DemoGPT project. It contains the definitions and implementations of the tasks that are used in the DemoGPT pipeline. The chains.py file includes the model definitions for the plan, tasks, and final stages of the pipeline. The task_chains.py and task_definitions.py files contain the implementations and definitions of all the available tasks, respectively. The prompts folder contains the prompts for the models, which are used to guide the models in performing the tasks.

"},{"location":"src_plan_chains_prompts/","title":"src/plan/chains/prompts Module","text":"

The src/plan/chains/prompts module is a subdirectory of the src/plan/chains module in the DemoGPT project. It contains the files related to the prompts for the models.

"},{"location":"src_plan_chains_prompts/#files-in-srcplanchainsprompts","title":"Files in src/plan/chains/prompts","text":""},{"location":"src_plan_chains_prompts/#task_list-folder","title":"task_list Folder","text":"

The task_list folder under prompts contains the prompts for the available tasks.

"},{"location":"src_plan_chains_prompts/#summary","title":"Summary","text":"

The src/plan/chains/prompts module is a crucial part of the DemoGPT project. It contains the prompts that guide the models in performing the tasks in the DemoGPT pipeline. The plan.py, tasks.py, and final.py files include the prompts for the plan generation, task generation, and finalization stages of the pipeline, respectively. The task_list folder within prompts contains the prompts for the available tasks.

"},{"location":"src_plan_chains_prompts_tasks/","title":"src/plan/chains/prompts/task_list Module","text":"

The src/plan/chains/prompts/task_list module is a subdirectory of the src/plan/chains/prompts module in the DemoGPT project. It contains the files related to the tasks and their definitions.

"},{"location":"src_plan_chains_prompts_tasks/#files-in-srcplanchainspromptstask_list","title":"Files in src/plan/chains/prompts/task_list","text":""},{"location":"src_plan_chains_prompts_tasks/#summary","title":"Summary","text":"

The src/plan/chains/prompts/task_list module contains the definitions of all tasks used in the DemoGPT pipeline. Each task has a specific purpose and is good at performing a certain function. The tasks range from getting user input and showing output to the user, to generating intelligent text output, transforming text into a list, routing queries, answering questions that require external search on the web, summarizing long text, answering questions related to a file, solving math problems, executing bash commands, and providing weather-related information.

"},{"location":"test/","title":"TestDemoGPT - Unit Testing","text":"

TestDemoGPT is a class that contains a series of unit tests to validate the functionality of our application.

"},{"location":"test/#test-scenario","title":"Test Scenario","text":""},{"location":"test/#test-methods","title":"Test Methods","text":""},{"location":"test/#how-to-run-tests","title":"How to run tests","text":""},{"location":"test/#running-all-tests","title":"Running all tests","text":"

To run all the tests, use the following command:

python -m unittest src.plan.test.TestDemoGPT.test_all\n
"},{"location":"test/#running-a-single-test-module","title":"Running a single test module","text":"

To run a specific test module, you can use the following command format:

python -m unittest src.plan.test.TestDemoGPT.$func_name\n
"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index dfafa99..82fbaf2 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ diff --git a/src_plan/index.html b/src_plan/index.html index dab2f1e..52bbb34 100644 --- a/src_plan/index.html +++ b/src_plan/index.html @@ -209,14 +209,14 @@ diff --git a/src_plan_chains/index.html b/src_plan_chains/index.html index be197c1..f6d52ea 100644 --- a/src_plan_chains/index.html +++ b/src_plan_chains/index.html @@ -209,14 +209,14 @@ diff --git a/src_plan_chains_prompts/index.html b/src_plan_chains_prompts/index.html index ec41731..2d6fb23 100644 --- a/src_plan_chains_prompts/index.html +++ b/src_plan_chains_prompts/index.html @@ -209,14 +209,14 @@ diff --git a/src_plan_chains_prompts_tasks/index.html b/src_plan_chains_prompts_tasks/index.html index 5b4e9fe..d4b631f 100644 --- a/src_plan_chains_prompts_tasks/index.html +++ b/src_plan_chains_prompts_tasks/index.html @@ -12,6 +12,8 @@ + + @@ -207,14 +209,14 @@ diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..93f0e2f --- /dev/null +++ b/test/index.html @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + + + + + Test - 🧩 DemoGPT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

TestDemoGPT - Unit Testing

+

TestDemoGPT is a class that contains a series of unit tests to validate the functionality of our application.

+

Test Scenario

+
    +
  • The test scenario involves planning, task generation, code generation and testing of various tasks in the application like UI input text, UI output text, etc. The test plan uses various test cases defined in TEST_CASES and TOOL_EXAMPLES.
  • +
+

Test Methods

+
    +
  • setUpClass: This method is executed once at the start of the testing process. It sets up the environment required for testing.
  • +
  • writeToFile: A helper method to write the test results to a file.
  • +
  • printRes: A helper method to print the results in a colorful, formatted manner.
  • +
  • test_plan: Tests the plan creation.
  • +
  • test_tasks: Tests the task creation.
  • +
  • test_final: Tests the final code generation.
  • +
  • test_task_ui_input_text: Tests UI input text task.
  • +
  • test_task_ui_output_text: Tests UI output text task.
  • +
  • test_task_prompt_chat_template: Tests prompt chat template task.
  • +
  • test: This method runs the entire workflow of the application, from plan creation to code generation.
  • +
  • test_all: This method iterates over all the test cases in TEST_CASES and runs the test method for each of them.
  • +
+

How to run tests

+

Running all tests

+

To run all the tests, use the following command:

+
python -m unittest src.plan.test.TestDemoGPT.test_all
+
+

Running a single test module

+

To run a specific test module, you can use the following command format:

+
python -m unittest src.plan.test.TestDemoGPT.$func_name
+
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file