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 support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - LiteLLM #53

Open
wants to merge 1 commit into
base: main
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
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import re
import openai
import litellm
import requests
from bs4 import BeautifulSoup
from graphviz import Digraph
Expand All @@ -20,7 +21,7 @@
app = Flask(__name__)

# Set your OpenAI API key
openai.api_key = os.getenv("OPENAI_API_KEY")
litellm.api_key = os.getenv("OPENAI_API_KEY")
response_data = ""

# If Neo4j credentials are set, then Neo4j is used to store information
Expand Down Expand Up @@ -130,7 +131,7 @@ def get_response_data():
return jsonify({"error": "No input provided"}), 400
print("starting openai call")
try:
completion: KnowledgeGraph = openai.ChatCompletion.create(
completion: KnowledgeGraph = litellm.completion(
model="gpt-3.5-turbo-16k",
messages=[
{
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ authors = ["Your Name <[email protected]>"]
[tool.poetry.dependencies]
python = ">=3.10.0,<3.11"
openai = "^0.28.0"
litellm = ">=0.1.820"
bs4 = "^0.0.1"
matplotlib = "^3.7.2"
networkx = "^3.1"
Expand Down