Skip to content

Commit

Permalink
added dependencies for openai and dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Tin Chi Lo committed Nov 15, 2024
1 parent 2f06e18 commit 632e7fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Flask==3.0.0
pytest==7.4.0
pytest==7.4.0
openai==1.54.3
python-dotenv==1.0.1
4 changes: 1 addition & 3 deletions src/translator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import openai
from openai import AzureOpenAI
from dotenv import load_dotenv
import os
Expand Down Expand Up @@ -29,9 +30,6 @@ def get_language(post: str) -> str:
return response.choices[0].message.content

def query_llm_robust(post: str) -> tuple[bool, str]:
'''
TODO: Implement this
'''
translation_context = "The team is implementing a translation feature for NodeBB, a forum that allows instructors and students to make posts. Your task is to translate the content of English and non-English posts into English. For inputs that are non-english strings, you will translate into college-level English. If inputs are in English, return the input but with spelling and grammar corrections."
translation_response = client.chat.completions.create(
model="gpt-4o-mini", # This should match your deployment name in Azure
Expand Down

0 comments on commit 632e7fa

Please sign in to comment.