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 hacker_news/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import re
import time
from json import JSONDecodeError

import litellm
from litellm import completion
import openai
from slugify import slugify
from summarizer import Summarizer
Expand Down Expand Up @@ -193,7 +194,7 @@ def openai_complete(self, prompt, need_json):
)
answer = resp['choices'][0]['text'].strip()
else:
resp = openai.ChatCompletion.create(
resp = completion(
messages=[
{'role': 'user', 'content': prompt},
],
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ python-dotenv==1.0.0
python_slugify==8.0.1
sqlalchemy==2.0.19
psycopg2==2.9.6
humanize==4.7.0
humanize==4.7.0
litellm==0.1.381