Skip to content

Instantly share code, notes, and snippets.

@youtube-jocoding
Created August 26, 2023 06:49
Show Gist options
  • Save youtube-jocoding/b4a9f2080e730c6818d53aeb7a21062d to your computer and use it in GitHub Desktop.
Save youtube-jocoding/b4a9f2080e730c6818d53aeb7a21062d to your computer and use it in GitHub Desktop.
from dotenv import load_dotenv
load_dotenv()
import streamlit as st
from langchain.chat_models import ChatOpenAI
chat_model = ChatOpenAI()
st.title('인공지능 시인')
content = st.text_input('시의 주제를 제시해주세요.')
if st.button('시 작성 요청하기'):
with st.spinner('시 작성 중...'):
result = chat_model.predict(content + "에 대한 시를 써줘")
st.write(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment