From 0d4970afe8f55ebc545532071c534d55dfb5029c Mon Sep 17 00:00:00 2001 From: Ayyub I Date: Tue, 7 Nov 2023 20:39:58 -0600 Subject: [PATCH] replaced openai import w chatopenai in helper.py script --- packages/googlecloud/functions/getanswer/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/googlecloud/functions/getanswer/helper.py b/packages/googlecloud/functions/getanswer/helper.py index 97df05cf..0d77e6eb 100644 --- a/packages/googlecloud/functions/getanswer/helper.py +++ b/packages/googlecloud/functions/getanswer/helper.py @@ -3,7 +3,7 @@ from langchain.embeddings.openai import OpenAIEmbeddings from langchain.chains import LLMChain, HypotheticalDocumentEmbedder from langchain.prompts import PromptTemplate -from langchain.llms import OpenAI +from langchain.chat_models import ChatOpenAI import logging import pandas as pd @@ -37,7 +37,7 @@ def get_dbs(): def create_embeddings(): - llm = OpenAI() + llm = ChatOpenAI() general_prompt_template = """ As an AI assistant tasked with generating brief general summaries, your role is to provide succinct, balanced information from the transcripts of New Orleans City Council meetings in response to the question "{question}". The response should not exceed one paragraph in length. If the available information from the transcripts is insufficient to accurately summarize the issue, please respond with 'Insufficient information available.' If the question extends beyond the scope of information contained in the transcripts, state 'I don't know.'