Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Mistral API compatibility #512

Open
Onigam opened this issue Jan 17, 2024 · 1 comment
Open

Mistral API compatibility #512

Onigam opened this issue Jan 17, 2024 · 1 comment

Comments

@Onigam
Copy link

Onigam commented Jan 17, 2024

Instead of using OpenAI api I want to use Mistral AI api using the 8x7B model.

The only blocker with this code is the presence_penalty: 1 parameter in the index.js file, we just need to remove this line
to avoid OpenAI error 422 due to this Extra inputs not supported and permitted from Mistral API

I created a fork with this fix here

Now I'm using Mistral instead of OpenAI than is a lot cheaper

@Onigam
Copy link
Author

Onigam commented Jan 17, 2024

You can have it from the marketplace

https://github.com/marketplace/actions/ai-based-pr-reviewer-summarizer-with-mistral-8x7b-chat-capabilities

You just need to add this github action

name: Code Review

permissions:
  contents: read
  pull-requests: write

on:
  pull_request:
  pull_request_review_comment:
    types: [created]

concurrency:
  group: ${{ github.repository }}-${{ github.event.number || github.head_ref ||
    github.sha }}-${{ github.workflow }}-${{ github.event_name ==
    'pull_request_review_comment' && 'pr_comment' || 'pr' }}
  cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - name: AI-based PR Reviewer & Summarizer with Mistral 8x7B Chat Capabilities
        uses: Onigam/ai-mistral-pr-reviewer@mistralai-support-marketplace
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
        with:
          debug: false
          review_simple_changes: false
          review_comment_lgtm: false
          openai_base_url: "https://api.mistral.ai/v1"
          openai_light_model: "mistral-tiny"
          openai_heavy_model: "mistral-small"

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

No branches or pull requests

1 participant