From 0899b3f12ba7fe92f15df51d7bc9aed8fd685dd5 Mon Sep 17 00:00:00 2001 From: Marc Khoury Date: Fri, 8 Mar 2024 22:22:25 -0500 Subject: [PATCH] Remove OpenAI import and add ChatOpenAI import --- entrypoint.py | 5 +++-- requirements.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/entrypoint.py b/entrypoint.py index 4c4acf8..770b774 100755 --- a/entrypoint.py +++ b/entrypoint.py @@ -15,7 +15,8 @@ import click import requests -from langchain import OpenAI, LLMChain, PromptTemplate +from langchain import LLMChain, PromptTemplate +from langchain_openai import ChatOpenAI from loguru import logger @@ -76,7 +77,7 @@ def get_review( chunked_diff_list = chunk_string(input_string=diff, chunk_size=prompt_chunk_size) # Get summary by chunk chunked_reviews = [] - llm = OpenAI( + llm = ChatOpenAI( openai_api_key=os.getenv("OPENAI_API_KEY"), model="gpt-3.5-turbo", temperature=0.2 diff --git a/requirements.txt b/requirements.txt index 8ea2681..9f8271b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,5 +16,6 @@ loguru==0.7.0 requests==2.28.2 langchain==0.1.11 +langchain-openai==0.0.8 huggingface_hub==0.16.4 openai==1.13.3 \ No newline at end of file