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.
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.
913- 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.
1214- Logs execution data to a CSV file for analytics.
1315
1416## Prerequisites
1517
1618- Python 3.6 or higher
1719- An Azure OpenAI API key
18- - Required Python packages: ` openai ` , ` azure-identity ` , ` requests `
20+ - Required Python packages: ` openai ` , ` azure-identity ` , ` requests ` , ` pyyaml `
1921
2022## Installation
2123
@@ -27,7 +29,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
2729
28302. Install the required Python packages:
2931 ` ` ` bash
30- pip install openai azure-identity requests
32+ pip install openai azure-identity requests pyyaml
3133 ` ` `
3234
33353. Ensure you have the Azure OpenAI API key and endpoint set as environment variables:
@@ -49,7 +51,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
4951 - **Subscription**: Choose your Azure subscription.
5052 - **Resource Group**: Select an existing resource group or create a new one.
5153 - **Region**: Choose the region closest to your location.
52- - **Name**: Provide a unique name for your OpenAI resource.
54+ - **Name**: Provide a unique name for your Azure OpenAI resource.
5355 - **Pricing Tier**: Select the appropriate pricing tier (e.g., Standard S0).
5456 - Click " Review + create" and then " Create" to deploy the resource.
5557
@@ -69,7 +71,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
6971
7072 5. **Set Environment Variables in Linux**:
7173 - Open your terminal.
72- - Edit the ` .bashrc` file using a text editor, such as ` nano` :
74+ - Edit the [ .bashrc](http://_vscodecontentref_/2) file using a text editor, such as ` nano` :
7375 ` ` ` bash
7476 nano ~ /.bashrc
7577 ` ` `
@@ -79,7 +81,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
7981 export AZURE_OPENAI_ENDPOINT=" <your_endpoint>"
8082 ` ` `
8183 - Save and exit the editor (` Ctrl + X` , then ` Y` , and ` Enter` for nano).
82- - Apply the changes by sourcing the ` .bashrc` file:
84+ - Apply the changes by sourcing the [ .bashrc](http://_vscodecontentref_/3) file:
8385 ` ` ` bash
8486 source ~ /.bashrc
8587 ` ` `
@@ -100,49 +102,60 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
100102 python ada.py
101103 ` ` `
102104
103- 2. Enter the path to the input file or describe your intended workload when prompted.
105+ 2. Choose from the available options:
106+ - Option 1: Convert an existing markdown file to an Exec Doc
107+ - Option 2: Describe a workload to generate a new Exec Doc
108+ - Option 3: Add descriptions to a shell script as an Exec Doc
109+ - Option 4: Redact PII from an existing Exec Doc
110+ - Option 5: Perform security vulnerability check on an Exec Doc
104111
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.
112+ 3. Follow the prompts to provide the required information:
113+ - For file conversion, provide the path to your input file
114+ - For workload descriptions, describe your intended workload in detail
115+ - For shell script documentation, provide the path to your script and optional context
116+ - For PII redaction, provide the path to your Exec Doc
117+ - For security checks, provide the path to your Exec Doc
106118
107- 4. If the tests fail, the script will generate troubleshooting steps and attempt to correct the document.
119+ 4. The tool will process your request based on the selected option:
120+ - For options 1 and 2, it will convert or create an Exec Doc and run tests using Innovation Engine
121+ - For options 3, 4, and 5, it will generate the requested output and save it to a file
108122
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.
123+ 5. For document conversion or creation, if the tests pass successfully, the final document will be saved with proper formatting.
112124
113125## Script Workflow
114126
1151271. **Initialization**: The script initializes the Azure OpenAI client and checks for required packages.
116128
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.
129+ 2. **Option Selection**: Prompts the user to select from available options for document processing.
122130
123- 5 . **Install Innovation Engine **: Checks if the Innovation Engine is installed and installs it if necessary .
131+ 3 . **Input Collection **: Collects necessary inputs based on the selected option .
124132
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.
133+ 4. **Processing Based on Option**:
134+ - **Convert Markdown**: Converts an existing markdown file to an Exec Doc
135+ - **Generate New Doc**: Creates an Exec Doc from a workload description
136+ - **Document Script**: Adds detailed explanations to a shell script
137+ - **Redact PII**: Removes personally identifiable information from result blocks
138+ - **Security Check**: Performs comprehensive security analysis
129139
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.
140+ 5. **For Document Conversion and Generation**:
141+ - Install Innovation Engine if needed
142+ - Process the document using Azure OpenAI's model
143+ - Run tests on the document using Innovation Engine
144+ - If tests fail, generate troubleshooting steps and attempt corrections
145+ - If tests pass, finalize the document
133146
134- 8 . **Remove Backticks **: Ensures that backticks are properly handled in the document .
147+ 6 . **Final Output **: Saves the processed document and provides the file path .
135148
136- 9 . **Logging **: Logs execution data to ` execution_log.csv ` .
149+ 7 . **Dependency Generation **: Optionally identifies and creates dependency files referenced in the document .
137150
138- 10 . **Final Output **: Saves the final merged document and provides the path .
151+ 8 . **Logging **: Logs execution data to ` execution_log.csv ` .
139152
140153## Logging
141154
142155The script logs the following data to ` execution_log.csv` :
143156
144157- Timestamp: The date and time when the script was run.
145- - Type: Whether the input was a file or a workload description.
158+ - Type: The type of processing performed ( file conversion, workload description, etc.) .
146159- Input: The path to the input file or the workload description.
147160- Output: The path to the output file.
148161- Number of Attempts: The number of attempts made to generate a successful document.
0 commit comments