DeepSeek 开源 chat-demo:用静态前端接上 App 同款搜索、读链接和语音
<div class="ce-block ce-block--focused" data-id="yu0Ry9XTZT" ><div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">11.13 DeepSeek 在官方 API 文档里宣布,把 App 中的联网搜索、文件解析、链接阅读、安全审核和语音等能力以 API 形式开放给开发者,并同时开源参考前端 chat-demo。开源三天,Star 已经超 3000 了!</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="Dh7ATFpo6O" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">开源地址:<a href="https://github.com/deepseek-ai/chat-demo" target="_blank" rel="noopener noreferrer nofollow">https://github.com/deepseek-ai/chat-demo</a></div>
</div>
</div><div class="ce-block ce-block--focused" data-id="DkPPXXIcoa" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left"><a href="https://github.com/deepseek-ai/chat-demo" target="_blank" rel="noopener noreferrer nofollow"></a>在线体验:<a href="https://cdn.deepseek.com/chat-demo" target="_blank" rel="noopener noreferrer nofollow">https://cdn.deepseek.com/chat-demo</a></div>
</div>
</div><div class="ce-block" data-id="WYBnDmxZlJ" >
<div class="ce-block__content" style="">
<h2 class="ce-header ce-header--left">没有应用后端的参考客户端</h2>
</div>
</div><div class="ce-block ce-block--focused" data-id="34O7IhNVvZ" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">浏览器直接请求配置的 API,默认是 <a href="https://api.deepseek.com/" target="_blank" rel="noopener noreferrer nofollow">https://api.deepseek.com</a>。可以在线试用,也可以从 Releases 下载压缩包后双击 index.html;本地开发需要 Node.js 22.12+ 和 pnpm。直接用本地文件打开时,浏览器和 API 都要允许 file:// 的存储和跨域。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="OQG4JDqsPU" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">默认模型在代码里写死为 deepseek-flash。聊天走 Anthropic 兼容的 Messages / Files 接口,语音走独立的 ASR 和 TTS。多会话、消息分支、流式回答、深度思考、搜索引用、附件和朗读等,都是为了对齐官方 App 的体验。</div>
</div>
</div><div class="ce-block" data-id="WkfzbakiKO" >
<div class="ce-block__content" style="">
<h2 class="ce-header ce-header--left">搜索和读链接在服务端完成</h2>
</div>
</div><div class="ce-block ce-block--focused" data-id="qfC6IjYOzn" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">客户端负责展示返回的内容块,并在下一轮把该回传的部分原样送回。阅读链接工具始终声明;是否加上 deepseek_web_search,由本地的智能搜索开关决定;深度思考对应 thinking。所有生成请求都固定带 safety_check: high,因此会走带服务端工具的那套协议。系统提示是一句固定身份说明:「该助手为 DeepSeek,由深度求索公司创造。」</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="SanURDQwRY" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">回传时,历史思考和搜索结果不再发送;只有成功读过的链接会带上 signature,供服务端恢复网页正文。若服务端给出安全拒绝,已经流下来的思考和正文要由客户端丢弃,只保留工具块。新对话若还没有标题,结束时会向服务端要一句自动标题。每轮还会插入 latest_reminder,内容是日期、星期、位置、Web 和界面语言,日期按浏览器本地时区计算。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="pjo0NQlhk3" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">API Key 和设置存在 localStorage,会话和附件原件存在 IndexedDB。发送、上传和语音都会把相应内容交给 API;清空本地对话不会删除已经传到服务端的文件。历史导入导出用 ZIP,格式版本是 export_format_version: 3,可导入官方 DeepSeek 导出的记录;导入会替换全部本地会话。导出不含 API Key 和非图片附件原件,导入的回复也不能继续生成。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="1exCzELXuK" >
<div class="ce-block__content">
<div class="cdx-block image-tool image-tool--filled ">
<div class="image-tool__image">
<div class="image-tool__image-preloader" style=""></div>
<img id="aimg_1exCzELXuK" class="image-tool__image-picture _zoom" src="http://idceve.com/data/attachment/forum/202611/20/160737m212561lrn1rxdya.png" title="" alt="" data-aid="210"/>
</div>
<div class="cdx-input image-tool__caption" data-placeholder=""></div>
</div>
</div>
</div><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.ce-paragraph {
line-height: 1.6em;
outline: none;
text-indent: 2em;
font-size: 16px;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}
.ce-paragraph-text-indent {
text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}
/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}
.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}
.ce-paragraph p:first-of-type{
margin-top: 0;
}
.ce-paragraph p:last-of-type{
margin-bottom: 0;
}
.svg-icon {
width: 1em;
height: 1em;
}
.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
fill: #4691f6;
}
.svg-icon circle {
stroke: #4691f6;
stroke-width: 1;
}
</style><style type="text/css">
.ce-block {
margin-top: 20px;
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
/**
* Plugin styles
*/
.ce-header {
position: relative;
padding: 1px 0px 1px 15px;
margin: 0;
line-height: 1.25em;
outline: none;
margin-bottom: 10px;
}
.ce-header p,
.ce-header div {
padding: 0 !important;
margin: 0 !important;
}
.ce-header::before {
content: "";
background-color: #3e8fe3;
width: 6px;
height: 100%;
position: absolute;
left: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/**
* Styles for Plugin icon in Toolbar
*/
.ce-header__icon {
}
.ce-header::before {
position: absolute;
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
display: none;
cursor: text;
}
.ce-header:empty::before {
display: block;
}
.ce-header:empty:focus::before {
display: none;
}
/* FontSize */
h1.ce-header {
font-size: 2.0em;
}
h2.ce-header {
font-size: 1.7em;
}
h3.ce-header {
font-size: 1.4em;
}
h4.ce-header {
font-size: 1.15em;
}
h5.ce-header {
font-size: 0.95em;
}
h6.ce-header {
font-size: 0.8em;
}
/* Alignment*/
.ce-header--right {
text-align: right;
}
.ce-header--center {
text-align: center;
}
.ce-header--left {
text-align: left;
}
.ce-header--justify {
text-align: justify;
}
</style><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.image-tool {
--bg-color: #cdd1e0;
--front-color: #388ae5;
--border-color: #e8e8eb;
}
.image-tool__image {
border-radius: 3px;
overflow: hidden;
margin-bottom: 10px;
}
.image-tool__image-picture {
max-width: 100%;
vertical-align: bottom;
display: block;
margin-left: auto;
margin-right: auto;
}
.image-tool__image-preloader {
width: 50px;
height: 50px;
border-radius: 50%;
background-size: cover;
margin: auto;
position: relative;
background-color: #cdd1e0;
background-position: center center;
}
.image-tool__image-preloader::after {
content: "";
position: absolute;
z-index: 3;
width: 60px;
height: 60px;
border-radius: 50%;
border: 2px solid #cdd1e0;
border-top-color: #388ae5;
left: 50%;
top: 50%;
margin-top: -30px;
margin-left: -30px;
animation: image-preloader-spin 2s infinite linear;
box-sizing: border-box;
}
.image-tool__caption::before {
position: absolute !important;
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
display: none;
}
.image-tool__caption:empty::before {
display: block;
}
.image-tool__caption:empty:focus::before {
display: none;
}
.image-tool--empty .image-tool__image {
display: none;
}
.image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {
display: none;
}
.image-tool .cdx-button {
display: flex;
align-items: center;
justify-content: center;
}
.image-tool .cdx-button svg {
height: auto;
margin: 0 6px 0 0;
}
.image-tool--filled .cdx-button {
display: none;
}
.image-tool--filled .image-tool__image-preloader {
display: none;
}
.image-tool--loading .image-tool__image {
min-height: 200px;
display: flex;
border: 1px solid #e8e8eb;
background-color: #fff;
}
.image-tool--loading .image-tool__image-picture {
display: none;
}
.image-tool--loading .cdx-button {
display: none;
}
/**
* Tunes
* ----------------
*/
.image-tool--withBorder .image-tool__image {
border: 1px solid #e8e8eb;
}
.image-tool--withBackground .image-tool__image {
padding: 15px;
background: #cdd1e0;
}
.image-tool--withBackground .image-tool__image-picture {
max-width: 60%;
margin: 0 auto;
}
.image-tool--stretched .image-tool__image-picture {
width: 100%;
}
.image-tool__caption {
text-align: center;
font-size: 14px;
color: #a3a3a3;
}
@keyframes image-preloader-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style>
页:
[1]