Umer797 commited on
Commit
71f7f0b
·
verified ·
1 Parent(s): f8734b3

Update llm_node.py

Browse files
Files changed (1) hide show
  1. llm_node.py +4 -7
llm_node.py CHANGED
@@ -1,10 +1,7 @@
1
  from langchain_community.chat_models import ChatOpenAI
2
- from langchain.prompts import PromptTemplate
3
- from langchain.chains import LLMChain
4
- from prompts import PROMPT_TEMPLATE
5
 
6
- def llm_node():
7
  llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
8
- prompt = PromptTemplate.from_template(PROMPT_TEMPLATE)
9
- chain = LLMChain(llm=llm, prompt=prompt)
10
- return chain
 
1
  from langchain_community.chat_models import ChatOpenAI
 
 
 
2
 
3
+ def llm_node(question):
4
  llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
5
+ prompt = f"Answer this carefully and exactly:\n{question}"
6
+ response = llm.invoke(prompt)
7
+ return response.content.strip()