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

adding support for claude, azure, llama2 and cohere #58

Open
wants to merge 2 commits 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 terminalgpt/chat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import os
import sys
import time

import litellm
from litellm import completion
import openai
import tiktoken
from colorama import Back, Fore, Style
Expand Down Expand Up @@ -106,7 +107,7 @@ def get_user_answer(messages, model):
color="blue",
side="right",
):
answer = openai.ChatCompletion.create(model=model, messages=messages)
answer = completion(model=model, messages=messages)
return answer
except openai.InvalidRequestError as error:
if "Please reduce the length of the messages" in str(error):
Expand Down
4 changes: 3 additions & 1 deletion terminalgpt/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import time

import openai
import litellm
from litellm import completion
from colorama import Back, Style

from terminalgpt import config, print_utils
Expand Down Expand Up @@ -79,7 +81,7 @@ def get_system_answer(messages):

while True:
try:
answer = openai.ChatCompletion.create(
answer = completion(
model=config.DEFAULT_MODEL, messages=messages
)
return answer
Expand Down