Skip to content

Commit 52b8756

Browse files
authored
Merge pull request #17 from CSID-DGU/15-feat-BE-agent-persona
feat: [BE] python env config
2 parents 5652090 + 9c6b4f9 commit 52b8756

File tree

7 files changed

+52
-2
lines changed

7 files changed

+52
-2
lines changed

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/2024-2-SCS4031-jjambbong-3.iml

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/server.main.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/main/python/app.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from flask import Flask, request, jsonify
2+
from langchain.prompts import PromptTemplate
3+
from langchain.chains import LLMChain
4+
from langchain.llms import OpenAI
5+
6+
app = Flask(__name__)
7+
8+
# OpenAI 설정
9+
llm = OpenAI(api_key="your_openai_api_key")
10+
11+
questions = [
12+
"여행 목적이 무엇인가요?",
13+
"언제부터 언제까지 며칠 동안 다녀오실 계획인가요?",
14+
"몇 명이 함께 가나요?",`
15+
"예산은 어느 정도로 계획하고 계신가요?"
16+
]
17+
18+
current_question_index = 0
19+
20+
@app.route('/ask_question', methods=['POST'])
21+
def ask_question():
22+
global current_question_index
23+
if current_question_index < len(questions):
24+
question = questions[current_question_index]
25+
current_question_index += 1
26+
else:
27+
question = "모든 질문이 완료되었습니다. 감사합니다!"
28+
29+
return jsonify({"question": question})
30+
31+
if __name__ == "__main__":
32+
app.run(port=5000)
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
flask
2+
langchain
3+
openai

0 commit comments

Comments
 (0)