Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenAI integration with CLI for generating Mermaid diagrams. #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

BaoLiqi
Copy link

@BaoLiqi BaoLiqi commented Jan 3, 2025

#5 #4

I tested my fork with the model 'deepseek/deepseek-chat' on OpenRouter.
It seems that the generated diagram is heavily influenced by the contents of the README file, as my changes did not appear in the output.
To confirm this, I removed my local README file, tested again, and obtained the following diagram, which looks improved.

flowchart TD
    subgraph "API Gateway"
        NGINX["Nginx"]:::gateway
        click NGINX "nginx/api.conf"
        click NGINX "nginx/setup_nginx.sh"
    end

    subgraph "Application Server"
        APP["Application Server (main.py)"]:::app
        click APP "app/main.py"
    end

    subgraph "Router Layer"
        MODIFY["Modify Router (modify.py)"]:::router
        GENERATE["Generate Router (generate.py)"]:::router
        click MODIFY "app/routers/modify.py"
        click GENERATE "app/routers/generate.py"
    end

    subgraph "Service Layer"
        GITHUB["GitHub Service (github_service.py)"]:::service
        CLAUDE["Claude Service (claude_service.py)"]:::service
        OPENAI["OpenAI Service (openai_service.py)"]:::service
        click GITHUB "app/services/github_service.py"
        click CLAUDE "app/services/claude_service.py"
        click OPENAI "app/services/openai_service.py"
    end

    subgraph "Rate Limiter"
        LIMITER["Rate Limiter (limiter.py)"]:::limiter
        click LIMITER "app/core/limiter.py"
    end

    subgraph "External Services"
        GITHUB_API["GitHub API"]:::external
        CLAUDE_API["Claude API"]:::external
        OPENAI_API["OpenAI API"]:::external
    end

    subgraph "Deployment"
        DOCKER["Dockerfile"]:::deploy
        DEPLOY["deploy.sh"]:::deploy
        click DOCKER "Dockerfile"
        click DEPLOY "deploy.sh"
    end

    Client --> NGINX
    NGINX --> APP
    APP --> MODIFY
    APP --> GENERATE
    MODIFY --> GITHUB
    MODIFY --> CLAUDE
    MODIFY --> OPENAI
    GENERATE --> GITHUB
    GENERATE --> CLAUDE
    GENERATE --> OPENAI
    GITHUB --> GITHUB_API
    CLAUDE --> CLAUDE_API
    OPENAI --> OPENAI_API
    LIMITER --> APP
    DOCKER --> NGINX
    DEPLOY --> NGINX

    classDef gateway fill:#f9f,stroke:#333,stroke-width:2px
    classDef app fill:#bbf,stroke:#333,stroke-width:2px
    classDef router fill:#fbb,stroke:#333,stroke-width:2px
    classDef service fill:#bfb,stroke:#333,stroke-width:2px
    classDef limiter fill:#ffb,stroke:#333,stroke-width:2px
    classDef external fill:#ccc,stroke:#333,stroke-width:2px
    classDef deploy fill:#bff,stroke:#333,stroke-width:2px

Loading

Copy link

vercel bot commented Jan 3, 2025

@BaoLiqi is attempting to deploy a commit to the Ahmed Khaleel's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines 9 to 17
excluded_patterns = [
'node_modules', 'vendor', 'venv',
'.min.', '.pyc', '.pyo', '.pyd', '.so', '.dll', '.class', ".o",
'.jpg', '.jpeg', '.png', '.gif', '.ico', '.svg', '.ttf', '.woff', '.webp',
'.pdf', '.xml', '.wav', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', ".txt", ".log",
'__pycache__', '.cache', '.tmp',
'yarn.lock', 'poetry.lock',
'.vscode', '.idea', '.git', "test", "activate"
]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be an idea to respect the local .gitignore contents as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback! 👍 I’ve gone ahead and updated the code to respect the local .gitignore contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants