Created
September 19, 2023 14:04
-
-
Save fsndzomga/9458e6049f5bbf3d5f8e15d555765a5f to your computer and use it in GitHub Desktop.
Assumption checker using langchain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from langchain import hub, LLMChain | |
from langchain.chat_models import ChatOpenAI | |
from keys import OPENAI_API_KEY | |
import os | |
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY | |
assumption_template = hub.pull("smithing-gold/assumption-checker") | |
llm = ChatOpenAI() | |
llm_chain = LLMChain(llm=llm, prompt=assumption_template) | |
while True: | |
question = input("What is your question ? Type quit to leave the chat.\n\n") | |
if question == 'quit': | |
break | |
print("\n Response:") | |
response = llm_chain(question) | |
print(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment