Skip to content

Commit dc8c576

Browse files
authored
Update README.md
1 parent f6ad229 commit dc8c576

File tree

1 file changed

+98
-106
lines changed

1 file changed

+98
-106
lines changed

tools/README.md

Lines changed: 98 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
11
# ADA - AI Documentation Assistant
22

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.
3+
ADA (AI Documentation Assistant) helps you create, convert, and manage Executable Documents efficiently using Azure OpenAI and Innovation Engine.
44

55
## Features
66

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.
13-
- Logs execution data to a CSV file for analytics.
7+
- **Convert to Exec Docs**: Transform existing markdown files to executable documents
8+
- **Generate New Exec Docs**: Create new executable documents from a workload description
9+
- **Reference Integration**: Include content from URLs and local files when generating documents
10+
- **Script Documentation**: Create comprehensive explanations for shell scripts
11+
- **PII Redaction**: Automatically redact sensitive information from result blocks
12+
- **Security Analysis**: Perform comprehensive security vulnerability assessments
13+
- **SEO Optimization**: Enhance document visibility and searchability
14+
- **Centralized Logging**: Track operations across sessions in a global log
15+
- **Docker Support**: Run ADA in an isolated container environment
1416

1517
## Prerequisites
1618

1719
- Python 3.6 or higher
18-
- An Azure OpenAI API key
19-
- Required Python packages: `openai`, `azure-identity`, `requests`, `pyyaml`
20+
- Azure OpenAI API key and endpoint
21+
- Docker (optional, for containerized usage)
2022

2123
## Installation
2224

25+
### Option 1: Local Installation
26+
2327
1. Clone the repository:
24-
```bash
25-
git clone <repository-url>
26-
cd <repository-directory>
27-
```
28+
```bash
29+
git clone <repository-url>
30+
cd <repository-directory>/tools
31+
```
2832

2933
2. Install the required Python packages:
30-
```bash
31-
pip install openai azure-identity requests pyyaml
32-
```
34+
```bash
35+
pip install -r requirements.txt
36+
```
3337

34-
3. Ensure you have the Azure OpenAI API key and endpoint set as environment variables:
35-
```bash
36-
export AZURE_OPENAI_API_KEY=<your-azure-openai-api-key>
37-
export AZURE_OPENAI_ENDPOINT=<your-azure-openai-endpoint>
38-
```
38+
3. Set Azure OpenAI API credentials as environment variables:
39+
```bash
40+
export AZURE_OPENAI_API_KEY=<your-azure-openai-api-key>
41+
export AZURE_OPENAI_ENDPOINT=<your-azure-openai-endpoint>
42+
```
3943

40-
To obtain an Azure OpenAI API key and endpoint, follow these steps:
44+
To obtain an Azure OpenAI API key and endpoint, follow these steps:
4145

4246
1. **Sign in to the Azure Portal**:
4347
- Navigate to [https://portal.azure.com](https://portal.azure.com) and log in with your Azure credentials.
@@ -58,7 +62,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
5862
- After creating your Azure OpenAI resource, navigate to the **Overview** page of your resource.
5963
- Click on "Go to Azure AI Studio" to open the Azure AI Studio interface.
6064
- In Azure AI Studio, select "Deployments" from the left-hand menu.
61-
- Click "Deploy model" and choose `gpt-4o` from the Azure OpenAI collection.
65+
- Click "Deploy model" and choose `o4-mini` from the Azure OpenAI collection.
6266
- Provide a deployment name and configure any additional settings as needed.
6367
- Click "Deploy" to deploy the model.
6468

@@ -93,101 +97,94 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
9397
By following these steps, you'll have your Azure OpenAI API key and endpoint configured, a model deployed, and your environment variables set up in a Linux environment, ready for integration into your applications.
9498
9599
For a visual walkthrough of creating an Azure OpenAI resource and deploying a model, you might find the following video helpful:
96-
97-
## Usage
98100
99-
1. Run the script:
100-
```bash
101-
python ada.py
102-
```
101+
4. Run ADA:
102+
```bash
103+
python ada.py
104+
```
105+
106+
### Option 2: Docker Installation
107+
108+
1. Build the Docker image:
109+
```bash
110+
docker build -t ada-tool .
111+
```
112+
113+
2. Run ADA in a Docker container:
114+
```bash
115+
docker run -it --rm \
116+
-e AZURE_OPENAI_API_KEY="your_api_key_here" \
117+
-e AZURE_OPENAI_ENDPOINT="your_endpoint_here" \
118+
-v "$(pwd):/app/workspace" \
119+
-v "$HOME/.azure:/root/.azure" \
120+
-w /app/workspace \
121+
ada-tool
122+
```
123+
124+
3. Run ADA:
125+
```bash
126+
./run-ada.sh
127+
```
128+
## Usage
103129
104-
2. Choose from the available options:
130+
1. Select from the available options:
105131
- 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
110-
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
117-
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
121-
122-
5. For document conversion or creation, if the tests pass successfully, the final document will be saved with proper formatting.
123-
124-
## Script Workflow
132+
- Option 2: Generate a new Exec Doc from a workload description
133+
- Option 3: Create descriptions for your shell script
134+
- Option 4: Redact PII from your Doc
135+
- Option 5: Perform security analysis on your Doc
136+
- Option 6: Perform SEO optimization on your Doc
125137
126-
1. **Initialization**: The script initializes the Azure OpenAI client and checks for required packages.
138+
2. Follow the prompts for each option:
139+
- For file conversion: provide the path to your source file
140+
- For generating new docs: describe the workload and optionally add reference data
141+
- For script documentation: provide the path to your script and context
142+
- For PII redaction: provide the path to your source document
143+
- For security analysis: provide the path to the document to analyze
144+
- For SEO optimization: provide the path to the document to optimize
127145
128-
2. **Option Selection**: Prompts the user to select from available options for document processing.
146+
## Output Location
129147
130-
3. **Input Collection**: Collects necessary inputs based on the selected option.
148+
- When generating a new Exec Doc (option 2), ADA creates a dedicated folder for the output
149+
- For all other operations, ADA saves output files in the same directory as the source file
150+
- Execution logs are saved in a centralized log.json file in the script directory
131151
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
152+
## Data Sources Integration
138153
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
154+
When generating a new Exec Doc, you can incorporate content from:
155+
- Web URLs (HTML content will be extracted)
156+
- Local files (content will be read directly)
145157
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`.
158+
These sources provide additional context for more comprehensive document generation.
151159
152160
## Advanced Features
153161
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
162+
### Centralized Logging
163+
ADA maintains a comprehensive log of all operations in a centralized log.json file, tracking:
164+
- Document creation and conversion
165+
- Script documentation
166+
- PII redaction
167+
- Security analysis
168+
- SEO optimization
169+
- Success rates and execution times
161170
162171
### Error Resolution System
163172
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
173+
- Analyzes error messages to determine their source
174+
- Uses progressive troubleshooting strategies
175+
- Provides specific fixes for different error patterns
168176
- Remembers previous errors to avoid repetitive solutions
169177
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
178-
179-
## Logging
178+
## Requirements
180179
181-
The script logs the following data to `execution_log.csv`:
182-
183-
- Timestamp: The date and time when the script was run.
184-
- Type: The type of processing performed (file conversion, workload description, etc.).
185-
- Input: The path to the input file or the workload description.
186-
- Output: The path to the output file.
187-
- Number of Attempts: The number of attempts made to generate a successful document.
188-
- Errors Encountered: A summary of errors encountered during the process.
189-
- Execution Time (in seconds): The total time taken to run the script.
190-
- Success/Failure: Whether the script successfully generated a document without errors.
180+
ADA depends on the following Python packages:
181+
- azure-identity>=1.17.1
182+
- beautifulsoup4>=4.12.2
183+
- openai>=1.65.1
184+
- requests>=2.31.0
185+
- requests-kerberos>=0.12.0
186+
- requests-ntlm>=1.1.0
187+
- requests-toolbelt>=1.0.0
191188
192189
## License
193190
@@ -196,8 +193,3 @@ This project is licensed under the MIT License - see the LICENSE file for detail
196193
## Contributing
197194
198195
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
199-
200-
## Acknowledgments
201-
202-
- [OpenAI](https://openai.com/)
203-
- [Azure](https://azure.microsoft.com/)

0 commit comments

Comments
 (0)