Lang2Creator๋ FastAPI ๊ธฐ๋ฐ MCP Server์ Flask ๊ธฐ๋ฐ ์ ํ๋ธ ํธ๋ ๋ Agent๋ก ๊ตฌ์ฑ๋ ๋ฉํฐ์ฑ๋ ์ฒ๋ฆฌ ํ๋ซํผ์
๋๋ค.
์ถ๊ฐ๋ก Streamlit ๊ธฐ๋ฐ UI ๋๋ ์ธ๋ถ ํด๋ผ์ด์ธํธ๋ฅผ ๋ถ์ฌ ์ฌ์ฉํ ์ ์์ต๋๋ค.
ํด๋ | ์ค๋ช |
---|---|
mcp_server/ |
์ฌ์ฉ์ ๋ฐํ ์์ โ OpenAI โ ๋ผ์ฐํ (FastAPI) |
youtube_agent/ |
์ ํ๋ธ ์ธ๋ค์ผ/์กฐํ์ ๋ถ์ ๊ธฐ๋ฅ ์ ๊ณต (Flask) |
cd mcp_server
cp .env.example .env # OPENAI_API_KEY ์
๋ ฅ
pip install -r requirements.txt
uvicorn main:app --reload
โ ์๋ฒ๋ http://localhost:8000/ask
์์ ์ฌ์ฉ์ ๋ฐํ๋ฅผ ์์ ํฉ๋๋ค.
cd youtube_agent
cp .env.example .env # YOUTUBE_API_KEY ์
๋ ฅ
pip install -r requirements.txt
python agent.py
โ ์๋ฒ๋ http://localhost:5001/youtube
์์ ์์ฒญ์ ์์ ํฉ๋๋ค.
curl -X POST http://localhost:8000/ask \
-H "Content-Type: application/json" \
-d '{"user": "jinsoo", "text": "Creator_001์ ์ธ๋ค์ผ ๋ณด์ฌ์ค"}'
Streamlit UI๋ ๋ณ๋๋ก ๊ฐ๋ฐํ์ฌ MCP Server ๋๋ YouTube Agent๋ฅผ ํธ์ถํ๋ ํด๋ผ์ด์ธํธ ์ญํ ์ ํ ์ ์์ต๋๋ค.
์์:
streamlit run streamlit_ui.py
๋๋ ๊ธฐ์กด ํ๋ก์ ํธ๋ฅผ streamlitํ ํ๋ ค๋ฉด agent.py ๊ธฐ๋ฅ์ ๊ทธ๋๋ก ์ฎ๊ฒจ UI๋ก ํํํ๋ฉด ๋ฉ๋๋ค.
OPENAI_API_KEY=sk-xxxxx
YOUTUBE_API_KEY=AIzaSyxxxxx
- Redis ๊ธฐ๋ฐ ์ธ์ ๊ด๋ฆฌ
- LangChain ๊ธฐ๋ฐ ๋ฉํฐ Agent Router
- Streamlit Cloud / Render.com ๋ฐฐํฌ
- Discord / Voice ์ฑ๋ ํตํฉ
Made with โค๏ธ by jsshin2022