올라마 실습
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
async function logJSONData() {
|
||||
const response = await fetch("http://localhost:11434/api/chat", {
|
||||
method:"post",
|
||||
headers:{"Content-Type":"application/json"},
|
||||
body:JSON.stringify({
|
||||
model:'qwen2.5',
|
||||
message: [
|
||||
{"role": "system", "content": "당신은 친절한 AI 어시스턴트입니다."},
|
||||
{"role": "user", "content": "파이썬의 장점을 3가지 알려주세요."},
|
||||
],
|
||||
stream:false
|
||||
})
|
||||
});
|
||||
const jsonData = await response.json();
|
||||
console.log(jsonData.message.content);
|
||||
}
|
||||
|
||||
logJSONData
|
||||
Reference in New Issue
Block a user