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

[WEB - 595] feat: Add support for Claude-2, Cohere Llama2, CodeLlama, Azure OpenAI, Replicate LLMs (100+LLMs) #3828

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions apiserver/plane/app/views/external/base.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Python imports
import requests
import os

# Third party imports
from openai import OpenAI
from rest_framework.response import Response
import litellm
import requests
from litellm import completion
from rest_framework import status
from rest_framework.response import Response

# Django imports

# Module imports
from ..base import BaseAPIView
from plane.app.permissions import ProjectEntityPermission
from plane.db.models import Workspace, Project
from plane.app.serializers import (
ProjectLiteSerializer,
WorkspaceLiteSerializer,
)
from plane.db.models import Project, Workspace
from plane.license.utils.instance_value import get_configuration_value

# Module imports
from ..base import BaseAPIView


class GPTIntegrationEndpoint(BaseAPIView):
permission_classes = [
Expand Down Expand Up @@ -58,11 +58,9 @@ def post(self, request, slug, project_id):

final_text = task + "\n" + prompt

client = OpenAI(
api_key=OPENAI_API_KEY,
)
litellm.api_key = OPENAI_API_KEY

response = client.chat.completions.create(
response = completion(
model=GPT_ENGINE,
messages=[{"role": "user", "content": final_text}],
)
Expand Down
1 change: 1 addition & 0 deletions apiserver/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ django-redis==5.3.0
uvicorn==0.23.2
channels==4.0.0
openai==1.2.4
litellm==1.27.14
slack-sdk==3.21.3
celery==5.3.4
django_celery_beat==2.5.0
Expand Down
Loading