Spaces:
Sleeping
Sleeping
Update azure_ai.py
Browse files- azure_ai.py +3 -31
azure_ai.py
CHANGED
|
@@ -18,19 +18,10 @@ def enhance_with_ai(repo_info):
|
|
| 18 |
|
| 19 |
system_prompt = """You are a senior open-source developer and technical writer who has authored
|
| 20 |
documentation for projects with 50,000+ GitHub stars (e.g., FastAPI, LangChain, Streamlit).
|
| 21 |
-
|
| 22 |
Your README output must:
|
| 23 |
- Feel like a polished, production-grade open-source project
|
| 24 |
- Use Mermaid diagrams: sequenceDiagram for API/data flow, flowchart LR for architecture.
|
| 25 |
- In Mermaid Diagrams, Dont use any Use only text dont use any symbol like .,*£_-+()/ and HTML tags in Mermaid and Follow correct Mermaid Syntax
|
| 26 |
-
- When using architecture-beta:
|
| 27 |
-
- Start with: architecture-beta
|
| 28 |
-
- Define groups using: group <id>(<icon>)[<label>]
|
| 29 |
-
- Define services using: service <id>(<icon>)[<label>] in <group>
|
| 30 |
-
- Connect services using directional edges:
|
| 31 |
-
serviceA:R --> L:serviceB
|
| 32 |
-
- Always include direction markers: R, L, T, B
|
| 33 |
-
- Do not mix flowchart syntax with architecture-beta
|
| 34 |
- Mermaid diagrams should change according to project working refer the sample one present in user input
|
| 35 |
- Include shields.io badges, tables, and collapsible sections where appropriate
|
| 36 |
- Be scannable: a developer should understand the project in under 60 seconds
|
|
@@ -39,54 +30,38 @@ Your README output must:
|
|
| 39 |
|
| 40 |
user_prompt = f"""
|
| 41 |
Generate a world-class GitHub README.md for this project.
|
| 42 |
-
|
| 43 |
PROJECT CONTEXT
|
| 44 |
---------------
|
| 45 |
Name : {repo_info['name']}
|
| 46 |
Description : {repo_info['description']}
|
| 47 |
Topics : {', '.join(repo_info['topics'])}
|
| 48 |
User : {repo_info['owner']['login']}
|
| 49 |
-
|
| 50 |
FILES (sampled for context):
|
| 51 |
{file_summaries}
|
| 52 |
---------------
|
| 53 |
-
|
| 54 |
Follow this EXACT structure and do not skip any section:
|
| 55 |
-
|
| 56 |
1. Hero Section
|
| 57 |
- H1 title with a one-line tagline below it
|
| 58 |
- A short 2-line summary of what the project does
|
| 59 |
-
|
| 60 |
2. Table of Contents
|
| 61 |
- Linked TOC to every section
|
| 62 |
-
|
| 63 |
3. Introduction
|
| 64 |
- The problem this project solves (2-3 sentences)
|
| 65 |
- Who benefits from it
|
| 66 |
- A "Why {repo_info['name']}?" comparison table vs alternatives:
|
| 67 |
| Feature | {repo_info['name']} | Alternative A | Alternative B |
|
| 68 |
-
|
| 69 |
4. Features
|
| 70 |
- 6-8 bullet points, each starting with a relevant emoji
|
| 71 |
- Group under: Core Features, Developer Experience, Deployment
|
| 72 |
-
|
| 73 |
5. Architecture
|
| 74 |
- A Mermaid flowchart LR showing system components:
|
| 75 |
```mermaid
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
service input(server)[Input Layer] in system
|
| 81 |
-
service processing(server)[Processing Layer] in system
|
| 82 |
-
service output(server)[Output Layer] in system
|
| 83 |
-
|
| 84 |
-
input:R --> L:processing
|
| 85 |
-
processing:R --> L:output
|
| 86 |
```
|
| 87 |
- A component breakdown table after the diagram:
|
| 88 |
| Component | Role | Technology |
|
| 89 |
-
|
| 90 |
6. Workflow
|
| 91 |
- A Mermaid sequenceDiagram showing the request/response or data flow:
|
| 92 |
```mermaid
|
|
@@ -100,10 +75,8 @@ Follow this EXACT structure and do not skip any section:
|
|
| 100 |
App-->>User: result
|
| 101 |
```
|
| 102 |
- Numbered step-by-step explanation below the diagram
|
| 103 |
-
|
| 104 |
7. Tech Stack
|
| 105 |
| Layer | Technology | Purpose |
|
| 106 |
-
|
| 107 |
8. Installation
|
| 108 |
- Prerequisites block
|
| 109 |
- Quick Start in 3 steps max:
|
|
@@ -127,7 +100,6 @@ Follow this EXACT structure and do not skip any section:
|
|
| 127 |
10. Usage
|
| 128 |
- Basic example with code block
|
| 129 |
- Advanced example with code block
|
| 130 |
-
|
| 131 |
|
| 132 |
Write the complete README now. Do not summarize, skip, or truncate any section.
|
| 133 |
"""
|
|
|
|
| 18 |
|
| 19 |
system_prompt = """You are a senior open-source developer and technical writer who has authored
|
| 20 |
documentation for projects with 50,000+ GitHub stars (e.g., FastAPI, LangChain, Streamlit).
|
|
|
|
| 21 |
Your README output must:
|
| 22 |
- Feel like a polished, production-grade open-source project
|
| 23 |
- Use Mermaid diagrams: sequenceDiagram for API/data flow, flowchart LR for architecture.
|
| 24 |
- In Mermaid Diagrams, Dont use any Use only text dont use any symbol like .,*£_-+()/ and HTML tags in Mermaid and Follow correct Mermaid Syntax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
- Mermaid diagrams should change according to project working refer the sample one present in user input
|
| 26 |
- Include shields.io badges, tables, and collapsible sections where appropriate
|
| 27 |
- Be scannable: a developer should understand the project in under 60 seconds
|
|
|
|
| 30 |
|
| 31 |
user_prompt = f"""
|
| 32 |
Generate a world-class GitHub README.md for this project.
|
|
|
|
| 33 |
PROJECT CONTEXT
|
| 34 |
---------------
|
| 35 |
Name : {repo_info['name']}
|
| 36 |
Description : {repo_info['description']}
|
| 37 |
Topics : {', '.join(repo_info['topics'])}
|
| 38 |
User : {repo_info['owner']['login']}
|
|
|
|
| 39 |
FILES (sampled for context):
|
| 40 |
{file_summaries}
|
| 41 |
---------------
|
|
|
|
| 42 |
Follow this EXACT structure and do not skip any section:
|
|
|
|
| 43 |
1. Hero Section
|
| 44 |
- H1 title with a one-line tagline below it
|
| 45 |
- A short 2-line summary of what the project does
|
|
|
|
| 46 |
2. Table of Contents
|
| 47 |
- Linked TOC to every section
|
|
|
|
| 48 |
3. Introduction
|
| 49 |
- The problem this project solves (2-3 sentences)
|
| 50 |
- Who benefits from it
|
| 51 |
- A "Why {repo_info['name']}?" comparison table vs alternatives:
|
| 52 |
| Feature | {repo_info['name']} | Alternative A | Alternative B |
|
|
|
|
| 53 |
4. Features
|
| 54 |
- 6-8 bullet points, each starting with a relevant emoji
|
| 55 |
- Group under: Core Features, Developer Experience, Deployment
|
|
|
|
| 56 |
5. Architecture
|
| 57 |
- A Mermaid flowchart LR showing system components:
|
| 58 |
```mermaid
|
| 59 |
+
flowchart LR
|
| 60 |
+
A[Input Layer] --> B[Processing Layer]
|
| 61 |
+
B --> C[Output Layer]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
```
|
| 63 |
- A component breakdown table after the diagram:
|
| 64 |
| Component | Role | Technology |
|
|
|
|
| 65 |
6. Workflow
|
| 66 |
- A Mermaid sequenceDiagram showing the request/response or data flow:
|
| 67 |
```mermaid
|
|
|
|
| 75 |
App-->>User: result
|
| 76 |
```
|
| 77 |
- Numbered step-by-step explanation below the diagram
|
|
|
|
| 78 |
7. Tech Stack
|
| 79 |
| Layer | Technology | Purpose |
|
|
|
|
| 80 |
8. Installation
|
| 81 |
- Prerequisites block
|
| 82 |
- Quick Start in 3 steps max:
|
|
|
|
| 100 |
10. Usage
|
| 101 |
- Basic example with code block
|
| 102 |
- Advanced example with code block
|
|
|
|
| 103 |
|
| 104 |
Write the complete README now. Do not summarize, skip, or truncate any section.
|
| 105 |
"""
|