Skip to content

Instantly share code, notes, and snippets.

@fsndzomga
Created September 19, 2023 14:17
Show Gist options
  • Save fsndzomga/0501cbfbdae38439789639f9ac1fc03c to your computer and use it in GitHub Desktop.
Save fsndzomga/0501cbfbdae38439789639f9ac1fc03c to your computer and use it in GitHub Desktop.
prompt maker from the langchain hub
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
prompt_maker_template = hub.pull("hardkothari/prompt-maker")
llm = ChatOpenAI()
llm_chain = LLMChain(llm=llm, prompt=prompt_maker_template)
while True:
task = input("What is your task ? Type quit to leave the chat.\n\n")
if task == 'quit':
break
lazy_prompt = input("What is your current prompt? Type quit to leave the chat.\n\n")
if lazy_prompt == 'quit':
break
print("\n Response:")
response = llm_chain({'lazy_prompt': lazy_prompt, 'task': task})
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment