Files
Source/project/CREDIT_APP/backend/static/js/analysis.js
T
cooney 06eb3c57ab fastAPI 심화
- Chart.js
- pdf, csv 파일 업로드 후 데이터 정제하여 llm으로 처리 후 결과 도출
- sqlite로 데이터 저장
- ORM - SQLAlchemy
2026-06-16 18:03:02 +09:00

18 lines
610 B
JavaScript

document.querySelector("button").addEventListener("click", ask)
async function ask() {
// 사용자가 질문 입력 시 질문을 서버로 전송
const question = document.querySelector('#question').value
const response = await fetch("/api/card/analysis", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({question : question})
})
// 전송 후 answer 도착 시 answer 화면에 보여주기
const answer = await response.json()
document.querySelector('#answer').textContent = answer.message
}