���deepseek���ȫ�������˕��뵽�����ֱ����һ�����ε�h5���Ϳ����M���ᆖ������Ҫdeepseek�L���W(w��ng)վ��app�������������������չʾ��Ч���ʹ��a
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>DeepSeek����ʾ��</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.container {
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
margin-top: 20px;
}
input, button {
padding: 10px;
margin: 5px;
border-radius: 4px;
}
input {
width: 70%;
border: 1px solid #ddd;
}
button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
padding: 15px;
border: 1px solid #eee;
border-radius: 4px;
min-height: 100px;
}
.loading {
color: #666;
font-style: italic;
}
</style>
</head>
<body>
<div class="container">
<h2>DeepSeek ������ʾ</h2>
<input type="text" id="questionInput" placeholder="ݔ�����Ć��}...">
<button onclick="askDeepSeek()">�ᆖ</button>
<div id="result"></div>
</div>
<script>
// ��Q�������HAPI���
const API_KEY = 'YOUR_DEEPSEEK_API_KEY';
const API_URL = 'https://api.deepseek.com/v1/chat/completions'; // ���O(sh��)��API��ַ
async function askDeepSeek() {
const question = document.getElementById('questionInput').value;
const resultDiv = document.getElementById('result');
if (!question) {
alert('Ոݔ�놖�}');
return;
}
resultDiv.innerHTML = '<div class="loading">˼����...</div>';
try {
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
},
body: JSON.stringify({
model: "deepseek-chat", // ����(j��)���Hģ����
messages: [{
role: "user",
content: question
}]
})
});
const data = await response.json();
if (response.ok) {
const answer = data.choices[0].message.content;
resultDiv.innerHTML = `<strong>�𰸣�</strong>${answer}`;
} else {
resultDiv.innerHTML = `�e�`��${data.error.message}`;
}
} catch (error) {
resultDiv.innerHTML = `Ո��ʧ����${error.message}`;
}
}
</script>
</body>
</html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>DeepSeek����ʾ��</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.container {
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
margin-top: 20px;
}
input, button {
padding: 10px;
margin: 5px;
border-radius: 4px;
}
input {
width: 70%;
border: 1px solid #ddd;
}
button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
padding: 15px;
border: 1px solid #eee;
border-radius: 4px;
min-height: 100px;
}
.loading {
color: #666;
font-style: italic;
}
</style>
</head>
<body>
<div class="container">
<h2>DeepSeek ������ʾ</h2>
<input type="text" id="questionInput" placeholder="ݔ�����Ć��}...">
<button onclick="askDeepSeek()">�ᆖ</button>
<div id="result"></div>
</div>
<script>
// ��Q�������HAPI���
const API_KEY = 'YOUR_DEEPSEEK_API_KEY';
const API_URL = 'https://api.deepseek.com/v1/chat/completions'; // ���O(sh��)��API��ַ
async function askDeepSeek() {
const question = document.getElementById('questionInput').value;
const resultDiv = document.getElementById('result');
if (!question) {
alert('Ոݔ�놖�}');
return;
}
resultDiv.innerHTML = '<div class="loading">˼����...</div>';
try {
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
},
body: JSON.stringify({
model: "deepseek-chat", // ����(j��)���Hģ����
messages: [{
role: "user",
content: question
}]
})
});
const data = await response.json();
if (response.ok) {
const answer = data.choices[0].message.content;
resultDiv.innerHTML = `<strong>�𰸣�</strong>${answer}`;
} else {
resultDiv.innerHTML = `�e�`��${data.error.message}`;
}
} catch (error) {
resultDiv.innerHTML = `Ո��ʧ����${error.message}`;
}
}
</script>
</body>
</html>
��Ҫ�f����
-
��Ҫ��Q�ă�(n��i)�ݣ�
-
��
YOUR_DEEPSEEK_API_KEY
��Q�������H��API���
api����L�������¾W(w��ng)ַ�M�Ы@ȡhttps://www.deepseek.com�����_�W(w��ng)ַ�x��api�_��ƽ�_��
���D��ʾ


�Г��������О����(d��o)�µķ���؟����
��վ�Й�(qu��n)������h���Р��h�uՓ��
���c���uՓ���������ѽ�(j��ng)��x������
�����l����