ch06_chatbot.py
import streamlit as st
# (1) main() 함수 선언
def main():
# (2) 메인 화면 구성
st.set_page_config(layout="wide")
st.title("친근한 AI 챗봇")
st.caption("스트림릿과 OpenAI API를 활용한 간단한 챗봇")
# (3) 사이드바 구성
with st.sidebar:
st.subheader("OpenAI API Key 설정")
#(4) 입력 위젯 유형 설정(비밀번호)
openai_api_key = st.text_input("OpenAI API Key", type="password")
st.write("[OpenAI API Key 받기](https://platform.openai.com/account/api-keys)")
# (5) main() 함수 실행
if __name__ == "__main__":
main()