11# ADA - AI Documentation Assistant
22
3- Welcome to ADA! This tool helps you convert documents and troubleshoot errors efficiently using OpenAI's Large Language Models and the Azure Innovation Engine.
3+ Welcome to ADA! This tool helps you convert documents and troubleshoot errors efficiently using Azure OpenAI's Large Language Models and the Azure Innovation Engine.
44
55## Features
66
7- - Converts input documents using OpenAI's LLMs.
8- - Automatically installs required packages and the Innovation Engine.
9- - Runs tests on the converted document using the Innovation Engine.
10- - Provides detailed error logs and generates troubleshooting steps.
11- - Merges code blocks from the updated document with non-code content from the original document.
7+ - Converts source markdown files to Exec Docs with proper formatting.
8+ - Generates new Exec Docs from workload descriptions with auto-generated titles.
9+ - Creates documentation for shell scripts while preserving the original code.
10+ - Redacts Personally Identifiable Information (PII) from Exec Doc result blocks.
11+ - Automatically identifies and generates dependency files referenced in documents.
12+ - Performs comprehensive security vulnerability analysis on Exec Docs.
1213- Logs execution data to a CSV file for analytics.
1314
1415## Prerequisites
1516
1617- Python 3.6 or higher
1718- An Azure OpenAI API key
18- - Required Python packages: ` openai ` , ` azure-identity ` , ` requests `
19+ - Required Python packages: ` openai ` , ` azure-identity ` , ` requests ` , ` pyyaml `
1920
2021## Installation
2122
@@ -27,7 +28,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
2728
28292. Install the required Python packages:
2930 ` ` ` bash
30- pip install openai azure-identity requests
31+ pip install openai azure-identity requests pyyaml
3132 ` ` `
3233
33343. Ensure you have the Azure OpenAI API key and endpoint set as environment variables:
@@ -49,7 +50,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
4950 - **Subscription**: Choose your Azure subscription.
5051 - **Resource Group**: Select an existing resource group or create a new one.
5152 - **Region**: Choose the region closest to your location.
52- - **Name**: Provide a unique name for your OpenAI resource.
53+ - **Name**: Provide a unique name for your Azure OpenAI resource.
5354 - **Pricing Tier**: Select the appropriate pricing tier (e.g., Standard S0).
5455 - Click " Review + create" and then " Create" to deploy the resource.
5556
@@ -69,7 +70,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
6970
7071 5. **Set Environment Variables in Linux**:
7172 - Open your terminal.
72- - Edit the ` .bashrc` file using a text editor, such as ` nano` :
73+ - Edit the [ .bashrc](http://_vscodecontentref_/2) file using a text editor, such as ` nano` :
7374 ` ` ` bash
7475 nano ~ /.bashrc
7576 ` ` `
@@ -79,7 +80,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
7980 export AZURE_OPENAI_ENDPOINT=" <your_endpoint>"
8081 ` ` `
8182 - Save and exit the editor (` Ctrl + X` , then ` Y` , and ` Enter` for nano).
82- - Apply the changes by sourcing the ` .bashrc` file:
83+ - Apply the changes by sourcing the [ .bashrc](http://_vscodecontentref_/3) file:
8384 ` ` ` bash
8485 source ~ /.bashrc
8586 ` ` `
@@ -100,49 +101,87 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
100101 python ada.py
101102 ` ` `
102103
103- 2. Enter the path to the input file or describe your intended workload when prompted.
104+ 2. Choose from the available options:
105+ - Option 1: Convert an existing markdown file to an Exec Doc
106+ - Option 2: Describe a workload to generate a new Exec Doc
107+ - Option 3: Add descriptions to a shell script as an Exec Doc
108+ - Option 4: Redact PII from an existing Exec Doc
109+ - Option 5: Perform security vulnerability check on an Exec Doc
104110
105- 3. The script will process the file or description, convert it using OpenAI's GPT-4O model, and perform testing using the Innovation Engine.
111+ 3. Follow the prompts to provide the required information:
112+ - For file conversion, provide the path to your input file
113+ - For workload descriptions, describe your intended workload in detail
114+ - For shell script documentation, provide the path to your script and optional context
115+ - For PII redaction, provide the path to your Exec Doc
116+ - For security checks, provide the path to your Exec Doc
106117
107- 4. If the tests fail, the script will generate troubleshooting steps and attempt to correct the document.
118+ 4. The tool will process your request based on the selected option:
119+ - For options 1 and 2, it will convert or create an Exec Doc and run tests using Innovation Engine
120+ - For options 3, 4, and 5, it will generate the requested output and save it to a file
108121
109- 5. If the tests pass successfully, the script will merge code blocks from the updated document with non-code content from the original document.
110-
111- 6. The final merged document will be saved, and a summary will be displayed.
122+ 5. For document conversion or creation, if the tests pass successfully, the final document will be saved with proper formatting.
112123
113124## Script Workflow
114125
1151261. **Initialization**: The script initializes the Azure OpenAI client and checks for required packages.
116127
117- 2. **Input File or Workload Description**: Prompts the user to enter the path to the input file or describe their intended workload.
118-
119- 3. **System Prompt**: Prepares the system prompt for the AI model.
120-
121- 4. **File Content or Workload Description**: Reads the content of the input file or uses the provided workload description.
122-
123- 5. **Install Innovation Engine**: Checks if the Innovation Engine is installed and installs it if necessary.
124-
125- 6. **Conversion and Testing**:
126- - Attempts to convert the document using OpenAI's GPT-4O model.
127- - Runs tests on the converted document using the Innovation Engine.
128- - If tests fail, generates troubleshooting steps and attempts to correct the document.
129-
130- 7. **Merge Documents**:
131- - If tests pass successfully, merges code blocks from the updated document with non-code content from the original document.
132- - Ensures that anything not within code blocks remains unchanged from the original document.
133-
134- 8. **Remove Backticks**: Ensures that backticks are properly handled in the document.
135-
136- 9. **Logging**: Logs execution data to ` execution_log.csv` .
137-
138- 10. **Final Output**: Saves the final merged document and provides the path.
128+ 2. **Option Selection**: Prompts the user to select from available options for document processing.
129+
130+ 3. **Input Collection**: Collects necessary inputs based on the selected option.
131+
132+ 4. **Processing Based on Option**:
133+ - **Convert Markdown**: Converts an existing markdown file to an Exec Doc
134+ - **Generate New Doc**: Creates an Exec Doc from a workload description
135+ - **Document Script**: Adds detailed explanations to a shell script
136+ - **Redact PII**: Removes personally identifiable information from result blocks
137+ - **Security Check**: Performs comprehensive security analysis
138+
139+ 5. **For Document Conversion and Generation**:
140+ - Install Innovation Engine if needed
141+ - Process the document using Azure OpenAI's model
142+ - Run tests on the document using Innovation Engine
143+ - If tests fail, generate troubleshooting steps and attempt corrections
144+ - If tests pass, finalize the document
145+
146+ 6. **Final Output**: Saves the processed document and provides the file path.
147+
148+ 7. **Dependency Generation**: Optionally identifies and creates dependency files referenced in the document.
149+
150+ 8. **Logging**: Logs execution data to ` execution_log.csv` .
151+
152+ ## Advanced Features
153+
154+ ### Dependency File Management
155+ ADA can identify, generate, and manage auxiliary files referenced in your Exec Docs:
156+ - Automatically detects files referenced in the document
157+ - Creates dependency files with proper formatting based on file type
158+ - Tracks existing files to prevent overwriting user modifications
159+ - Intelligently updates dependency files when errors are detected
160+ - Regenerates dependencies when major document changes occur
161+
162+ ### Error Resolution System
163+ When errors occur during testing, ADA employs a sophisticated resolution system:
164+ - Analyzes errors to determine if they originate in main document or dependency files
165+ - Uses progressive troubleshooting strategies for persistent errors
166+ - Only counts attempts against the maximum when fixing the main document
167+ - Provides specific strategies for different error patterns
168+ - Remembers previous errors to avoid repetitive solutions
169+
170+ ### Progressive Error Strategies
171+ ADA uses increasingly more aggressive strategies when encountering repeated errors:
172+ 1. Target specific issues identified in error messages
173+ 2. Simplify complex code blocks into smaller, manageable steps
174+ 3. Remove problematic result blocks that may be causing validation issues
175+ 4. Try alternative commands or approaches to achieve the same result
176+ 5. Completely redesign problematic sections with simpler implementations
177+ 6. Remove and rebuild problematic sections from scratch
139178
140179## Logging
141180
142181The script logs the following data to ` execution_log.csv` :
143182
144183- Timestamp: The date and time when the script was run.
145- - Type: Whether the input was a file or a workload description.
184+ - Type: The type of processing performed ( file conversion, workload description, etc.) .
146185- Input: The path to the input file or the workload description.
147186- Output: The path to the output file.
148187- Number of Attempts: The number of attempts made to generate a successful document.
@@ -161,4 +200,4 @@ Please read CONTRIBUTING.md for details on our code of conduct and the process f
161200## Acknowledgments
162201
163202- [OpenAI](https://openai.com/)
164- - [Azure](https://azure.microsoft.com/)
203+ - [Azure](https://azure.microsoft.com/)
0 commit comments