Skip to content
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 bot/on_message/bots/gptbot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import contextlib
import openai
from litellm import completion
from bot.setup.init import client
from bot.setup.init import openai_sessions
from config import cuomputer_id
Expand Down Expand Up @@ -73,7 +74,7 @@ def build_openai_response(message, system: str, adjective: str):
if model == "gpt-4":
reply = fetch_gpt4_completion(message, system, text, model)
else:
completion = openai.Completion.create(
completion = completion(
model=os.environ.get("OPENAI_MODEL"),
prompt=text,
temperature=1,
Expand Down Expand Up @@ -114,7 +115,7 @@ def fetch_gpt4_completion(message, system, text, model):
for m in messages:
print(m)

completion = openai.ChatCompletion.create(
completion = completion(
temperature=1.0,
max_tokens=100,
model=model,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Jinja2==3.0.1
joblib>=1.2.0

langcodes==3.3.0
litellm==0.1.400
MarkupSafe==2.0.1
more-itertools==8.10.0
msgpack==1.0.2
Expand Down