1
1
# ADA - AI Documentation Assistant
2
2
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.
4
4
5
5
## Features
6
6
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.
9
13
- 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.
12
14
- Logs execution data to a CSV file for analytics.
13
15
14
16
## Prerequisites
15
17
16
18
- Python 3.6 or higher
17
19
- An Azure OpenAI API key
18
- - Required Python packages: ` openai ` , ` azure-identity ` , ` requests `
20
+ - Required Python packages: ` openai ` , ` azure-identity ` , ` requests ` , ` pyyaml `
19
21
20
22
## Installation
21
23
@@ -27,7 +29,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
27
29
28
30
2. Install the required Python packages:
29
31
` ` ` bash
30
- pip install openai azure-identity requests
32
+ pip install openai azure-identity requests pyyaml
31
33
` ` `
32
34
33
35
3. 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
49
51
- **Subscription**: Choose your Azure subscription.
50
52
- **Resource Group**: Select an existing resource group or create a new one.
51
53
- **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.
53
55
- **Pricing Tier**: Select the appropriate pricing tier (e.g., Standard S0).
54
56
- Click " Review + create" and then " Create" to deploy the resource.
55
57
@@ -69,7 +71,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
69
71
70
72
5. **Set Environment Variables in Linux**:
71
73
- 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` :
73
75
` ` ` bash
74
76
nano ~ /.bashrc
75
77
` ` `
@@ -79,7 +81,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
79
81
export AZURE_OPENAI_ENDPOINT=" <your_endpoint>"
80
82
` ` `
81
83
- 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:
83
85
` ` ` bash
84
86
source ~ /.bashrc
85
87
` ` `
@@ -100,49 +102,60 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
100
102
python ada.py
101
103
` ` `
102
104
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
104
111
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
106
118
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
108
122
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.
112
124
113
125
## Script Workflow
114
126
115
127
1. **Initialization**: The script initializes the Azure OpenAI client and checks for required packages.
116
128
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.
122
130
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 .
124
132
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
129
139
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
133
146
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 .
135
148
136
- 9 . **Logging **: Logs execution data to ` execution_log.csv ` .
149
+ 7 . **Dependency Generation **: Optionally identifies and creates dependency files referenced in the document .
137
150
138
- 10 . **Final Output **: Saves the final merged document and provides the path .
151
+ 8 . **Logging **: Logs execution data to ` execution_log.csv ` .
139
152
140
153
## Logging
141
154
142
155
The script logs the following data to ` execution_log.csv` :
143
156
144
157
- 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.) .
146
159
- Input: The path to the input file or the workload description.
147
160
- Output: The path to the output file.
148
161
- Number of Attempts: The number of attempts made to generate a successful document.
0 commit comments