diff --git a/backend/api/main.py b/backend/api/main.py index 5021ecc..19636b8 100644 --- a/backend/api/main.py +++ b/backend/api/main.py @@ -29,7 +29,7 @@ def start(): temperature=0.3, max_tokens=512, client=None, - model="gpt-3.5-turbo", + model="gpt-4o", verbose=True, ) ai = AI( diff --git a/backend/data/food_to_cook/food_i_eat.txt b/backend/data/food_to_cook/food_i_eat.txt index 576cc8c..1130c09 100644 --- a/backend/data/food_to_cook/food_i_eat.txt +++ b/backend/data/food_to_cook/food_i_eat.txt @@ -22,3 +22,4 @@ Indomie noodles Yam porridge Fried plantain and egg sauce Asun (spicy goat meat) +Afang diff --git a/backend/plugins/a1_german_teacher.py b/backend/plugins/a1_german_teacher.py index f015457..43908e8 100644 --- a/backend/plugins/a1_german_teacher.py +++ b/backend/plugins/a1_german_teacher.py @@ -5,12 +5,16 @@ from langchain.memory import ConversationBufferMemory class GermanTeacherPlugin(): - def __init__(self, model): - self.model = ChatOpenAI(temperature=0.5, max_tokens=512, client=None) - def get_lang_chain_tool(self): - # get the file use_words.txt - german_teacher_prompt = PromptTemplate.from_template( - """You are a german friend that speaks Deutsch. + + def __init__(self, model): + self.model = ChatOpenAI( + temperature=0.5, max_tokens=512, client=None, model="gpt-4o" + ) + + def get_lang_chain_tool(self): + # get the file use_words.txt + german_teacher_prompt = PromptTemplate.from_template( + """You are a german friend that speaks Deutsch. Make sure your responses are not too long so that the user can understand you. Feel free to talk about any topic of your choice. Your goal is to teach the grammar and vocabulary of the german language through conversation. @@ -47,9 +51,9 @@ def get_lang_chain_tool(self): human: {prompt} response: """ - ) - todo_chain = LLMChain(llm=self.model, prompt=german_teacher_prompt, memory=ConversationBufferMemory()) - return [Tool( + ) + todo_chain = LLMChain(llm=self.model, prompt=german_teacher_prompt, memory=ConversationBufferMemory()) + return [Tool( name="Specialized German Model", description="This tool is a German language model designed for engaging in German conversations. It excels at understanding and generating responses in German. you MUST use this tool when the query contains /a1teacher. also all deutsch conversations MUST use this tool. It takes the user's query as input and provides the best German response.", func=todo_chain.run, diff --git a/backend/plugins/chat_gpt.py b/backend/plugins/chat_gpt.py index 0303c4e..2e6e098 100644 --- a/backend/plugins/chat_gpt.py +++ b/backend/plugins/chat_gpt.py @@ -5,7 +5,7 @@ class ChatGptPlugin(): def __init__(self, model): - self.model = ChatOpenAI(temperature=0.7, client=None) + self.model = ChatOpenAI(temperature=0.7, client=None, model="gpt-4o") def get_lang_chain_tool(self): template = """ diff --git a/backend/plugins/convo.py b/backend/plugins/convo.py index 226a81b..c5b4a0d 100644 --- a/backend/plugins/convo.py +++ b/backend/plugins/convo.py @@ -6,7 +6,7 @@ class ConvoPlugin: def __init__(self, model): - self.model = ChatOpenAI(temperature=0.7, client=None) + self.model = ChatOpenAI(temperature=0.7, client=None, model="gpt-4o") def get_lang_chain_tool(self): template = """ diff --git a/backend/plugins/devotionals.py b/backend/plugins/devotionals.py index 20cae18..102c1a3 100644 --- a/backend/plugins/devotionals.py +++ b/backend/plugins/devotionals.py @@ -7,10 +7,13 @@ from langchain import LLMChain, PromptTemplate class DevotionalsPlugin(): - def __init__(self, model): - self.model = ChatOpenAI(temperature=1.0, max_tokens=1024, client=None) - self.theologian_prompt = PromptTemplate.from_template( - """You are a Christian and theologian + + def __init__(self, model): + self.model = ChatOpenAI( + temperature=1.0, max_tokens=1024, client=None, model="gpt-4o" + ) + self.theologian_prompt = PromptTemplate.from_template( + """You are a Christian and theologian Create a devotional message for the chapter after {previous_chapter}, it should be in an interesting story telling fashion but must try to be as factual as possible. In a another section, add a Reflection and Application section, where you reflect on the chapter and apply it practically to today's world. @@ -22,11 +25,11 @@ def __init__(self, model): Token limit: 1024 """ - ) - self.chain = LLMChain(llm=self.model, prompt=self.theologian_prompt, verbose=True) - - def get_lang_chain_tool(self): - return [DevotionalsPluginTool(chain=self.chain)] + ) + self.chain = LLMChain(llm=self.model, prompt=self.theologian_prompt, verbose=True) + + def get_lang_chain_tool(self): + return [DevotionalsPluginTool(chain=self.chain)] class DevotionalsPluginTool(BaseTool): name = "Daily devotionals generator" diff --git a/backend/plugins/food_to_cook.py b/backend/plugins/food_to_cook.py index d9961ed..2266b75 100644 --- a/backend/plugins/food_to_cook.py +++ b/backend/plugins/food_to_cook.py @@ -9,7 +9,7 @@ class FoodToCookPlugin(): def __init__(self, model): - self.model = ChatOpenAI(temperature=1.0, max_tokens=1024, client=None) + self.model = ChatOpenAI(temperature=1.0, max_tokens=1024, client=None, model="gpt-4o") self.theologian_prompt = PromptTemplate.from_template( """You are my personal chef, here is a list of food i eat. and the last series of food i ate. Suggest the next food i should cook for a meal. diff --git a/backend/plugins/talker.py b/backend/plugins/talker.py index 848918a..ff196c4 100644 --- a/backend/plugins/talker.py +++ b/backend/plugins/talker.py @@ -5,7 +5,7 @@ class TalkerPlugin(): def __init__(self, model): - self.model = ChatOpenAI(temperature=0.7, client=None) + self.model = ChatOpenAI(temperature=0.7, client=None, model="gpt-4o") def get_lang_chain_tool(self): template = """ diff --git a/backend/plugins/used_words_practice.py b/backend/plugins/used_words_practice.py index 7335f71..3fca8a0 100644 --- a/backend/plugins/used_words_practice.py +++ b/backend/plugins/used_words_practice.py @@ -7,7 +7,7 @@ class UsedWordsPracticePlugin: def __init__(self, model): - self.model = ChatOpenAI(temperature=0.5, max_tokens=512, client=None) + self.model = ChatOpenAI(temperature=0.5, max_tokens=512, client=None, model="gpt-4o") def get_lang_chain_tool(self): # get the file use_words.txt