Metadata-Version: 2.1
Name: cori-ai
Version: 0.1.2
Summary: An AI-powered code review assistant
Home-page: https://github.com/theboringhumane/cori-ai
Author: The Boring Human
Author-email: human@theboring.human
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiofiles==24.1.0
Requires-Dist: aiohappyeyeballs==2.4.4
Requires-Dist: aiohttp==3.11.10
Requires-Dist: aiosignal==1.3.2
Requires-Dist: annotated-types==0.7.0
Requires-Dist: anyio==4.7.0
Requires-Dist: attrs==24.3.0
Requires-Dist: cachetools==5.5.0
Requires-Dist: certifi==2024.12.14
Requires-Dist: cffi==1.17.1
Requires-Dist: charset-normalizer==3.4.0
Requires-Dist: cryptography==44.0.0
Requires-Dist: dataclasses-json==0.6.7
Requires-Dist: deprecated==1.2.15
Requires-Dist: distro==1.9.0
Requires-Dist: eval-type-backport==0.2.0
Requires-Dist: filelock==3.16.1
Requires-Dist: filetype==1.2.0
Requires-Dist: frozenlist==1.5.0
Requires-Dist: fsspec==2024.10.0
Requires-Dist: google-ai-generativelanguage==0.6.10
Requires-Dist: google-api-core[grpc]==2.24.0
Requires-Dist: google-api-python-client==2.155.0
Requires-Dist: google-auth==2.37.0
Requires-Dist: google-auth-httplib2==0.2.0
Requires-Dist: google-generativeai==0.8.3
Requires-Dist: googleapis-common-protos==1.66.0
Requires-Dist: groq==0.13.1
Requires-Dist: grpcio==1.68.1
Requires-Dist: grpcio-status==1.68.1
Requires-Dist: h11==0.14.0
Requires-Dist: httpcore==1.0.7
Requires-Dist: httplib2==0.22.0
Requires-Dist: httpx==0.27.2
Requires-Dist: httpx-sse==0.4.0
Requires-Dist: huggingface-hub==0.27.0
Requires-Dist: idna==3.10
Requires-Dist: jiter==0.8.2
Requires-Dist: jsonpatch==1.33
Requires-Dist: jsonpath-python==1.0.6
Requires-Dist: jsonpointer==3.0.0
Requires-Dist: langchain==0.3.12
Requires-Dist: langchain-community==0.3.12
Requires-Dist: langchain-core==0.3.25
Requires-Dist: langchain-google-genai==2.0.7
Requires-Dist: langchain-groq==0.2.1
Requires-Dist: langchain-mistralai==0.2.3
Requires-Dist: langchain-openai==0.2.12
Requires-Dist: langchain-text-splitters==0.3.3
Requires-Dist: langsmith==0.2.3
Requires-Dist: marshmallow==3.23.1
Requires-Dist: mistralai==1.2.5
Requires-Dist: multidict==6.1.0
Requires-Dist: mypy-extensions==1.0.0
Requires-Dist: numpy==1.26.4
Requires-Dist: openai==1.55.3
Requires-Dist: orjson==3.10.12
Requires-Dist: packaging==23.2
Requires-Dist: propcache==0.2.1
Requires-Dist: proto-plus==1.25.0
Requires-Dist: protobuf==5.29.1
Requires-Dist: pyasn1==0.6.1
Requires-Dist: pyasn1-modules==0.4.1
Requires-Dist: pycparser==2.22
Requires-Dist: pydantic==2.10.3
Requires-Dist: pydantic-core==2.27.1
Requires-Dist: pydantic-settings==2.7.0
Requires-Dist: pygithub==2.5.0
Requires-Dist: pyjwt[crypto]==2.10.1
Requires-Dist: pynacl==1.5.0
Requires-Dist: pyparsing==3.2.0
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: pyyaml==6.0.2
Requires-Dist: regex==2024.11.6
Requires-Dist: requests==2.32.3
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: rsa==4.9
Requires-Dist: six==1.17.0
Requires-Dist: sniffio==1.3.1
Requires-Dist: sqlalchemy==2.0.36
Requires-Dist: tenacity==8.5.0
Requires-Dist: tiktoken==0.8.0
Requires-Dist: tokenizers==0.21.0
Requires-Dist: tqdm==4.67.1
Requires-Dist: typing-extensions==4.12.2
Requires-Dist: typing-inspect==0.9.0
Requires-Dist: uritemplate==4.1.1
Requires-Dist: urllib3==2.2.3
Requires-Dist: wrapt==1.17.0
Requires-Dist: yarl==1.18.3

# ✨ CoriAI Code Review, PhD

🤖 A GitHub Action that provides AI-powered code reviews for your pull requests using multiple LLM providers. Created by a very smart human with multiple degrees in Computer Science! 🎓

[Cori Repo]https://github.com/theboringhumane/cori-ai

![✨ CoriAI](/static/otterai.png)
![✨ CoriAI](/static/image.png)

## ✨ Features

- 🔍 Automated code review comments on pull requests
- 🧠 Multiple LLM providers support (OpenAI, Gemini, Groq, Mistral)
- 🔌 Custom API endpoint support
- 💬 Customizable review focus
- 📝 Line-specific comments on code changes
- 🤖 Auto-fix suggestions with new PRs
- 🎯 Project-specific guidelines
- 🚫 Skip review functionality with special PR titles or descriptions

## 🛠️ How to Use

### 1. Skip Code Review (Optional)

![Skip Code Review](/static/skip-code-review.png)

✨ CoriAI can automatically skip reviews based on certain patterns in your PR title or description. Here's how to use it:

#### 🎯 Skip Patterns
You can use any of these patterns (case-insensitive):

```
# Using hyphens
no-review: Your message
skip-review: Your message
no-cori: Your message
skip-cori: Your message
no-coriai: Your message
skip-coriai: Your message
cori-no: Your message
cori-bye: Your message
cori-restricted: Your message

# Multiple flags (comma-separated)
no-review,skip-cori: Complex update
skip-review,cori-restricted: Sensitive change
```

#### 🔄 Automatic Skip Conditions
Reviews are automatically skipped when:
- 🏷️ PR title contains any of the skip patterns
- 📝 PR description contains any of the skip patterns
- 🔒 PR state is 'merged' or 'closed'

#### 📋 Example Usage
```yaml
# Skip review for documentation updates
title: "no-review: Update README.md"

# Skip review for sensitive changes
title: "cori-restricted: Security patch"

# Skip review with multiple flags
title: "no-review,cori-restricted: Confidential update"

# Regular PR (will be reviewed)
title: "feat: Add new feature"
```

When a review is skipped:
- ✨ CoriAI will leave a comment notifying the PR author
- ⏭️ No code review will be performed
- 🚫 Dependencies won't be installed

### 2. Set up Secrets
First, add the API key for your preferred LLM provider:

#### OpenAI (Default)
```bash
OPENAI_API_KEY=your-openai-key
```

#### Google Gemini
```bash
GOOGLE_API_KEY=your-gemini-key
```

#### Groq
```bash
GROQ_API_KEY=your-groq-key
```

#### Mistral
```bash
MISTRAL_API_KEY=your-mistral-key
```

### 3. Create Workflow File
Create `.github/workflows/code-review.yml` with:

```yaml
name: AI Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
      - name: AI Code Review
        uses: theboringhumane/cori-ai@v1.2.0
        with:
          # Choose your preferred provider
          provider: 'openai'  # or 'gemini', 'groq', 'mistral'
          
          # Provider-specific settings
          openai_api_key: ${{ secrets.OPENAI_API_KEY }}
          # or
          # google_api_key: ${{ secrets.GOOGLE_API_KEY }}
          # or
          # groq_api_key: ${{ secrets.GROQ_API_KEY }}
          # or
          # mistral_api_key: ${{ secrets.MISTRAL_API_KEY }}
          
          github_token: ${{ secrets.GITHUB_TOKEN }}
```

### 4. Provider-Specific Configurations

#### OpenAI
```yaml
with:
  provider: 'openai'
  openai_api_key: ${{ secrets.OPENAI_API_KEY }}
  model: 'gpt-4-turbo-preview'  # Optional, default model
  openai_base_url: 'https://api.openai.com/v1'  # Optional, for custom endpoints
```

#### Google Gemini
```yaml
with:
  provider: 'gemini'
  google_api_key: ${{ secrets.GOOGLE_API_KEY }}
  model: 'gemini-1.5-flash'  # Optional, default model
```

#### Groq
```yaml
with:
  provider: 'groq'
  groq_api_key: ${{ secrets.GROQ_API_KEY }}
  model: 'mixtral-8x7b-32768'  # Optional, default model
```

#### Mistral
```yaml
with:
  provider: 'mistral'
  mistral_api_key: ${{ secrets.MISTRAL_API_KEY }}
  model: 'mistral-large-latest'  # Optional, default model
```

### 5. Customize Review Focus (Optional)
Add specific focus areas for the review:

```yaml
with:
  # ... provider settings ...
  extra_prompt: |
    Focus on:
    - Security best practices
    - Performance optimizations
    - Code maintainability
```

### 6. Auto-Fix Feature
✨ CoriAI will:
1. Review your code changes
2. Add detailed comments
3. Create a new PR with suggested fixes (coming soon)
  > This will be a new PR that has the fixes
4. Link the fix PR to your original PR (coming soon)
  > This will be a link to the new PR that has the fixes
5. Create relevant labels for the PR (coming soon)
  > This will be a list of labels that need to be added to the PR
6. Create relevant issues for the PR (coming soon)
  > This will be a list of issues that need to be fixed
7. Generate a summary of the PR (coming soon)
  > This will be a summary of the PR and the changes made
8. Generate feature guide for the PR (coming soon)
  > This will be a guide for the developer to understand the feature and how to build it
  > cori-ai will suggest the best way to build the feature and the best practices to follow

## 🎓 Default Models by Provider

| Provider | Default Model | Alternative Options |
|----------|---------------|-------------------|
| OpenAI | gpt-4-turbo-preview | gpt-4, gpt-3.5-turbo |
| Gemini | gemini-1.5-flash | gemini-1.5-pro | xyz |
| Groq | mixtral-8x7b-32768 | llama2-70b-4096 | xyz |
| Mistral | mistral-large-latest | mistral-medium, mistral-small | xyz |

## 🔒 Security Best Practices

1. Store API keys securely in GitHub Secrets
2. Use repository-specific tokens
3. Set appropriate permissions in workflow
4. Review auto-generated fixes before merging

## 🐛 Troubleshooting

### Common Issues
1. **API Key Issues**: Ensure the correct API key is set for your chosen provider
2. **Model Availability**: Some models might be region-restricted
3. **Rate Limits**: Consider using different providers during high load

### Provider Status
- OpenAI: [status.openai.com](https://status.openai.com)
- Gemini: [status.generativeai.google](https://status.generativeai.google)
- Groq: [status.groq.com](https://status.groq.com)
- Mistral: [status.mistral.ai](https://status.mistral.ai)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- Thanks to all LLM providers for their amazing models
- Thanks to GitHub for their platform
- Thanks to the human who created this action (and their PhD committee)

## 🦦 Support

- 📧 Email: thehuman@boring.name
- 🐙 GitHub Issues: [Create an issue](https://github.com/theboringhumane/cori-ai/issues)
- 🦦 Otter Signal: *splashes water playfully*

---

Made with 💖 by @theboringhumane, PhD in Computer Science, Machine Learning, and Fish Recognition





