{"id":78967,"date":"2026-02-28T18:40:54","date_gmt":"2026-02-28T10:40:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/78967.html"},"modified":"2026-02-28T18:40:54","modified_gmt":"2026-02-28T10:40:54","slug":"02%e5%b0%8f%e7%99%bdai%e5%ba%94%e7%94%a8%e5%ae%9e%e6%88%98-%e5%ae%a2%e6%9c%8d%e6%9c%ba%e5%99%a8%e4%ba%ba","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/78967.html","title":{"rendered":"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba"},"content":{"rendered":"<p id=\"ud2a29cc1\">\u4eca\u5929\u8bd5\u4e0b\u5728\u7f51\u7ad9\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u5ba2\u670d\u673a\u5668\u4eba&#xff08;\u8ddf\u7740\u9ed1\u9a6c\u7a0b\u5e8f\u5458\u7684\u89c6\u9891\u64cd\u4f5c\u7684&#xff09;&#xff0c;\u7f51\u7ad9\u7528Streamlit\u7b80\u5355\u5199\u9875\u9762&#xff0c;\u8fd9\u6b21\u7ec3\u4e60\u91cd\u70b9\u5728\u4e8e\u673a\u5668\u4eba\u80fd\u5426\u6b63\u5e38\u8c03\u7528\u3002<\/p>\n<h2 id=\"w8vQW\">\u4e00\u3001Streamlit\u6784\u5efa\u524d\u7aef\u9875\u9762<\/h2>\n<p id=\"uac0724ea\">\u5b9a\u4e49&#xff1a;Streamlit \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Python \u5e93&#xff0c;\u4e13\u95e8\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u548c\u5206\u4eab\u6570\u636e\u5e94\u7528\u3001\u673a\u5668\u5b66\u4e60\u6a21\u578b\u6f14\u793a\u4ee5\u53ca\u4ea4\u4e92\u5f0f\u4eea\u8868\u677f\u3002&#xff08;\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u6784\u5efa\u4e00\u4e2a\u524d\u7aef\u9875\u9762&#xff09;<\/p>\n<p id=\"ud24a9302\">\u5b98\u7f51&#xff1a;https:\/\/streamlit.io\/<\/p>\n<h3 id=\"TMkid\">1.1\u5b89\u88c5streamlit<\/h3>\n<p> pip install streamlit <\/p>\n<p id=\"uba24b4e3\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"129\" id=\"uaab0c192\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104050-69a2c6328c493.png\" width=\"789\" \/><\/p>\n<h3 id=\"fqRzu\">1.2\u57fa\u4e8estreamlit\u4e2d\u63d0\u4f9b\u7684API\u6765\u6784\u5efaWeb\u5e94\u7528<\/h3>\n<h4 id=\"O2bWo\">1.2.1\u8c03\u7528\u5b98\u65b9API<\/h4>\n<p id=\"u939a6ec7\">\u7a0d\u5fae\u8ddf\u7740\u5199\u4e86\u4e00\u70b9&#xff0c;\u7136\u540e\u5077\u61d2\u4e86<\/p>\n<p>import streamlit as st<br \/>\nimport os<br \/>\nfrom openai import OpenAI<\/p>\n<p>#\u8bbe\u7f6e\u9875\u9762\u914d\u7f6e\u9879<br \/>\nst.set_page_config(<br \/>\n    page_title&#061;&#034;IT\u5ba2\u6237\u670d\u52a1AI&#034;,<br \/>\n    page_icon&#061;&#034;&#x1f469;&#x1f3fb;\u200d&#x1f4bb;&#034;,<br \/>\n    layout&#061;&#034;wide&#034;,<br \/>\n    initial_sidebar_state&#061;&#034;expanded&#034;,<br \/>\n    menu_items&#061;{<br \/>\n        &#039;Get Help&#039;: None,<br \/>\n        &#039;Report a bug&#039;: None,<br \/>\n        &#039;About&#039;: &#039;### \u8fd9\u662f\u4e00\u4e2aIT\u5ba2\u6237\u670d\u52a1AI&#039;<br \/>\n    }<br \/>\n)<\/p>\n<p>st.markdown(<br \/>\n    &#034;&#034;&#034;&lt;style&gt;<br \/>\n    \/* \u6807\u9898\u6837\u5f0f *\/<br \/>\n    .main-title {<br \/>\n        text-align: center;<br \/>\n        font-size: 2.5rem;<br \/>\n        font-weight: bold;<br \/>\n        color: #333;<br \/>\n        margin-bottom: 20px;<br \/>\n    }<br \/>\n&lt;\/style&gt;&#034;&#034;&#034;,unsafe_allow_html&#061;True<br \/>\n)<\/p>\n<p>st.markdown(&#039;&lt;div class&#061;&#034;main-title&#034;&gt;&#x1f980; \u5927\u95f8\u87f9 IT \u52a9\u624b &#x1f980;&lt;\/div&gt;&#039;, unsafe_allow_html&#061;True)<\/p>\n<p>with st.sidebar:<br \/>\n    st.logo(image&#061;&#034;resources\/crab.png&#034;)<br \/>\n    st.sidebar.title(&#034;\u4f60\u7684\u4e13\u5c5e\u5ba2\u670d\u5927\u95f8\u87f9&#034;)<\/p>\n<p>#\u7cfb\u7edf\u63d0\u793a\u8bcd<br \/>\nsystem_prompt &#061; &#034;&#034;&#034;\u89d2\u8272\u8bbe\u5b9a<br \/>\n\u4f60\u53eb\u201c\u5927\u95f8\u87f9\u201d&#xff0c;\u662f\u516c\u53f8\u5185\u90e8\u7684IT\u5ba2\u670d\u52a9\u624b&#xff0c;\u4e13\u95e8\u4e3a\u540c\u4e8b\u89e3\u7b54\u7cfb\u7edf\u64cd\u4f5c\u3001\u4e1a\u52a1\u903b\u8f91\u7b49\u6280\u672f\u95ee\u9898\u3002\u4f60\u7684\u6027\u683c\u7279\u70b9\u662f&#xff1a;\u6e29\u67d4\u3001\u8010\u5fc3\u3001\u4e50\u4e8e\u52a9\u4eba\u3002<\/p>\n<p>\u6838\u5fc3\u884c\u4e3a\u51c6\u5219<br \/>\n\u8bed\u8a00\u6587\u660e&#xff1a;\u7edd\u5bf9\u4e0d\u8bf4\u810f\u8bdd&#xff0c;\u4e0d\u4f7f\u7528\u4efb\u4f55\u7c97\u9c81\u6216\u5192\u72af\u6027\u8bcd\u6c47\u3002<br \/>\n\u7b80\u6d01\u6613\u61c2&#xff1a;\u7528\u6700\u76f4\u767d\u7684\u8bed\u8a00\u89e3\u91ca\u95ee\u9898&#xff0c;\u907f\u514d\u4e13\u4e1a\u672f\u8bed\u5806\u780c&#xff1b;\u5982\u679c\u5fc5\u987b\u4f7f\u7528\u672f\u8bed&#xff0c;\u8bf7\u7acb\u5373\u7528\u901a\u4fd7\u4f8b\u5b50\u8bf4\u660e\u3002<br \/>\n\u8bed\u6c14\u6e29\u67d4&#xff1a;\u59cb\u7ec8\u4fdd\u6301\u4eb2\u5207\u3001\u6e29\u548c\u7684\u8bed\u8c03&#xff0c;\u591a\u7528\u201c\u8bf7\u201d\u3001\u201c\u8c22\u8c22\u201d\u3001\u201c&#xff5e;\u201d\u7b49\u7f13\u548c\u8bed\u6c14\u7684\u8868\u8fbe\u3002<br \/>\n\u60c5\u7eea\u5173\u6000&#xff1a;\u4e00\u65e6\u5bdf\u89c9\u7528\u6237\u53ef\u80fd\u70e6\u8e81\u3001\u6cae\u4e27\u6216\u7740\u6025&#xff08;\u5982\u51fa\u73b0\u611f\u53f9\u53f7\u3001\u53cd\u590d\u8be2\u95ee\u3001\u8d1f\u9762\u8bcd\u6c47&#xff09;&#xff0c;\u7acb\u5373\u7528emoji\u8868\u60c5&#xff08;\u5982&#x1f60a;\u3001&#x1f338;\u3001&#x1f33b;&#xff09;\u6216\u5b89\u629a\u6027\u8bdd\u8bed&#xff08;\u5982\u201c\u522b\u6025&#xff0c;\u6211\u4eec\u4e00\u8d77\u770b\u770b&#xff5e;\u201d&#xff09;\u7f13\u89e3\u5bf9\u65b9\u60c5\u7eea\u3002<\/p>\n<p>\u5bf9\u8bdd\u793a\u4f8b<br \/>\n\u7528\u6237&#xff1a;\u201c\u6211\u767b\u4e0d\u4e0a\u7cfb\u7edf\u4e86&#xff01;\u603b\u662f\u62a5\u9519&#xff01;\u201d<br \/>\n\u4f60&#xff1a;\u201c\u522b\u7740\u6025&#x1f60a;&#xff0c;\u8bf7\u544a\u8bc9\u6211\u62a5\u9519\u7684\u5177\u4f53\u6587\u5b57&#xff0c;\u6216\u8005\u622a\u4e2a\u56fe\u53d1\u6211&#xff0c;\u6211\u5e2e\u60a8\u4e00\u6b65\u6b65\u6392\u67e5&#xff5e;\u201d<br \/>\n\u7528\u6237&#xff1a;\u201c\u8fd9\u4e2a\u62a5\u8868\u600e\u4e48\u5bfc\u51fa\u554a&#xff1f;\u6b65\u9aa4\u592a\u590d\u6742\u4e86\u3002\u201d<br \/>\n\u4f60&#xff1a;\u201c\u5f88\u7b80\u5355&#xff01;\u60a8\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u2018\u5bfc\u51fa\u2019\u6309\u94ae&#xff0c;\u9009\u62e9\u683c\u5f0f\u540e\u786e\u8ba4\u5c31\u884c\u5566\u3002\u5982\u679c\u8fd8\u4e0d\u6e05\u695a&#xff0c;\u6211\u53ef\u4ee5\u622a\u56fe\u7ed9\u60a8\u6807\u51fa\u6765\u54e6&#x1f338;\u201d<\/p>\n<p>\u9644\u52a0\u8bf4\u660e<br \/>\n\u5982\u679c\u9047\u5230\u65e0\u6cd5\u89e3\u51b3\u7684\u95ee\u9898&#xff0c;\u5766\u8bda\u544a\u77e5\u5e76\u5efa\u8bae\u8054\u7cfb\u4eba\u5de5\u652f\u6301&#xff0c;\u800c\u4e0d\u662f\u7f16\u9020\u7b54\u6848\u3002<br \/>\n\u4fdd\u6301\u56de\u590d\u7bc7\u5e45\u9002\u4e2d&#xff0c;\u907f\u514d\u957f\u7bc7\u5927\u8bba&#xff0c;\u4f46\u4e5f\u4e0d\u80fd\u8fc7\u4e8e\u6577\u884d\u3002<\/p>\n<p>\u8bf7\u7262\u8bb0\u4ee5\u4e0a\u8bbe\u5b9a&#xff0c;\u73b0\u5728\u5f00\u59cb\u4ee5\u201c\u5927\u95f8\u87f9\u201d\u7684\u8eab\u4efd\u4e0e\u540c\u4e8b\u5bf9\u8bdd\u5427\u3002&#034;&#034;&#034;<\/p>\n<p>#\u521d\u59cb\u5316\u804a\u5929\u4fe1\u606f<br \/>\nif &#034;messages&#034; not in st.session_state:<br \/>\n    st.session_state.messages &#061; []<\/p>\n<p>#\u5c55\u793a\u804a\u5929\u4fe1\u606f<br \/>\nfor message in st.session_state.messages:<br \/>\n    st.chat_message(message[&#034;role&#034;]).write(message[&#034;content&#034;])<br \/>\n    # if message[&#034;role&#034;] &#061;&#061; &#034;user&#034;:<br \/>\n    #     st.chat_message(&#034;user&#034;).write(message[&#034;content&#034;])<br \/>\n    # else:<br \/>\n    #     st.chat_message(&#034;assistant&#034;).write(message[&#034;content&#034;])<\/p>\n<p>client &#061; OpenAI(<br \/>\n    api_key&#061;os.environ.get(&#039;DEEPSEEK_API_KEY&#039;),<br \/>\n    base_url&#061;&#034;https:\/\/api.deepseek.com&#034;)<\/p>\n<p>prompt &#061; st.chat_input(<br \/>\n    &#034;\u8bf7\u8f93\u5165\u4f60\u8981\u54a8\u8be2\u7684\u95ee\u9898&#034;,<br \/>\n    accept_audio&#061;True,<br \/>\n)<\/p>\n<p>if prompt and prompt.text:<br \/>\n    st.chat_message(&#034;user&#034;).write(prompt.text)<\/p>\n<p>    # \u4fdd\u5b58\u7528\u6237\u8f93\u5165\u7684\u63d0\u793a\u8bcd<br \/>\n    st.session_state.messages.append({&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: prompt.text})<\/p>\n<p>    response &#061; client.chat.completions.create(<br \/>\n        model&#061;&#034;deepseek-chat&#034;,<br \/>\n        messages&#061;[<br \/>\n            {&#034;role&#034;: &#034;system&#034;, &#034;content&#034;: system_prompt},<br \/>\n            *st.session_state.messages<br \/>\n            # {&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: prompt.text},<br \/>\n        ],<br \/>\n        stream&#061;True<br \/>\n    )<\/p>\n<p>    # \u975e\u6d41\u5f0f\u8f93\u51fa<br \/>\n    # print(&#034;\u5927\u6a21\u578b\u8fd4\u56de\u7684\u7ed3\u679c&#xff1a;&#034;,response.choices[0].message.content)<br \/>\n    # st.chat_message(&#034;assistant&#034;).write(response.choices[0].message.content)<br \/>\n    full_response &#061; &#034;&#034;<br \/>\n    with st.chat_message(&#034;assistant&#034;) as message:<br \/>\n        response_message &#061; st.empty()#\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u7ec4\u4ef6,\u5c55\u793a\u8fd4\u56de\u7ed3\u679c<br \/>\n        for chunk in response:<br \/>\n            if chunk.choices[0].delta.content is not None:<br \/>\n                #\u6d41\u5f0f\u8f93\u51fa<br \/>\n                content &#061; chunk.choices[0].delta.content<br \/>\n                print(&#034;\u5927\u6a21\u578b\u8fd4\u56de\u7684\u7ed3\u679c&#xff1a;&#034;,content)<br \/>\n                full_response &#043;&#061; content<br \/>\n                response_message.write(full_response)<\/p>\n<p>    #\u4fdd\u5b58\u5927\u6a21\u578b\u8fd4\u56de\u7684\u7ed3\u679c<br \/>\n    st.session_state.messages.append({&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: full_response})<\/p>\n<p id=\"u55027420\">\u5728\u7ec8\u7aef\u8fd0\u884c\u5373\u53ef\u3002<\/p>\n<p id=\"u231a3148\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"202\" id=\"u0e5d6dda\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104050-69a2c632b1666.png\" width=\"902\" \/><\/p>\n<p id=\"u0949a1eb\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"902\" id=\"u04f78f41\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104050-69a2c632d7a51.png\" width=\"1920\" \/><\/p>\n<p id=\"uf748a7bc\">\u5982\u679c\u4e0d\u60f3\u81ea\u5df1\u5199\u524d\u7aef\u9875\u9762&#xff0c;\u627eAI\u5e2e\u5fd9\u5199&#xff0c;\u8bd5\u4e86\u4e0bgemini\u548c\u5343\u95ee\u7684&#xff0c;gemini\u7684\u770b\u8d77\u6765\u597d\u4e00\u4e9b\u3002\u5feb\u6377\u6307\u4ee4\u7684\u56de\u7b54\u90fd\u662f\u9884\u8bbe\u5199\u6b7b\u4e86\u7684\u3002<\/p>\n<p id=\"uabe5ac57\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"909\" id=\"k2BE5\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104051-69a2c6338c38c.png\" width=\"1915\" \/><\/p>\n<p>import streamlit as st<br \/>\nimport os<br \/>\nimport uuid<br \/>\nimport time<br \/>\nfrom openai import OpenAI<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# 1. \u9875\u9762\u914d\u7f6e\u4e0e\u6837\u5f0f<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\nst.set_page_config(<br \/>\n    page_title&#061;&#034;\u5927\u95f8\u87f9 IT \u52a9\u624b&#034;,<br \/>\n    page_icon&#061;&#034;&#x1f980;&#034;,<br \/>\n    layout&#061;&#034;wide&#034;,<br \/>\n    initial_sidebar_state&#061;&#034;expanded&#034;,<br \/>\n    menu_items&#061;{<br \/>\n        &#039;About&#039;: &#039;### \u8fd9\u662f\u4e00\u4e2aIT\u5ba2\u6237\u670d\u52a1AI &#8211; \u5927\u95f8\u87f9\u52a9\u624b&#039;<br \/>\n    }<br \/>\n)<\/p>\n<p># \u81ea\u5b9a\u4e49 CSS \u4f18\u5316\u754c\u9762<br \/>\nst.markdown(&#034;&#034;&#034;<br \/>\n&lt;style&gt;<br \/>\n    \/* \u804a\u5929\u6c14\u6ce1\u6837\u5f0f *\/<br \/>\n    .stChatMessage {<br \/>\n        border-radius: 15px;<br \/>\n        padding: 10px;<br \/>\n    }<br \/>\n    .stChatMessage[data-testid&#061;&#034;stChatMessageUser&#034;] {<br \/>\n        background-color: #f0f2f6;<br \/>\n    }<br \/>\n    .stChatMessage[data-testid&#061;&#034;stChatMessageAssistant&#034;] {<br \/>\n        background-color: #fff7e6; \/* \u6d45\u6a59\u8272\u80cc\u666f *\/<br \/>\n        border: 1px solid #ffd591;<br \/>\n    }<\/p>\n<p>    \/* \u6807\u9898\u6837\u5f0f *\/<br \/>\n    .main-title {<br \/>\n        text-align: center;<br \/>\n        font-size: 2.5rem;<br \/>\n        font-weight: bold;<br \/>\n        color: #333;<br \/>\n        margin-bottom: 20px;<br \/>\n    }<\/p>\n<p>    \/* \u4fa7\u8fb9\u680f\u6309\u94ae\u6837\u5f0f\u4f18\u5316 *\/<br \/>\n    .stButton button {<br \/>\n        border-radius: 8px;<br \/>\n        text-align: left;<br \/>\n        white-space: nowrap;<br \/>\n        overflow: hidden;<br \/>\n        text-overflow: ellipsis;<br \/>\n    }<br \/>\n&lt;\/style&gt;<br \/>\n&#034;&#034;&#034;, unsafe_allow_html&#061;True)<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# 2. \u7cfb\u7edf\u63d0\u793a\u8bcd\u4e0e\u9884\u8bbe\u6570\u636e<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\nSYSTEM_PROMPT &#061; &#034;&#034;&#034;\u89d2\u8272\u8bbe\u5b9a<br \/>\n\u4f60\u53eb\u201c\u5927\u95f8\u87f9\u201d&#xff0c;\u662f\u516c\u53f8\u5185\u90e8\u7684IT\u5ba2\u670d\u52a9\u624b&#xff0c;\u4e13\u95e8\u4e3a\u540c\u4e8b\u89e3\u7b54\u7cfb\u7edf\u64cd\u4f5c\u3001\u4e1a\u52a1\u903b\u8f91\u7b49\u6280\u672f\u95ee\u9898\u3002\u4f60\u7684\u6027\u683c\u7279\u70b9\u662f&#xff1a;\u6e29\u67d4\u3001\u8010\u5fc3\u3001\u4e50\u4e8e\u52a9\u4eba\u3002<\/p>\n<p>\u6838\u5fc3\u884c\u4e3a\u51c6\u5219<br \/>\n\u8bed\u8a00\u6587\u660e&#xff1a;\u7edd\u5bf9\u4e0d\u8bf4\u810f\u8bdd&#xff0c;\u4e0d\u4f7f\u7528\u4efb\u4f55\u7c97\u9c81\u6216\u5192\u72af\u6027\u8bcd\u6c47\u3002<br \/>\n\u7b80\u6d01\u6613\u61c2&#xff1a;\u7528\u6700\u76f4\u767d\u7684\u8bed\u8a00\u89e3\u91ca\u95ee\u9898&#xff0c;\u907f\u514d\u4e13\u4e1a\u672f\u8bed\u5806\u780c&#xff1b;\u5982\u679c\u5fc5\u987b\u4f7f\u7528\u672f\u8bed&#xff0c;\u8bf7\u7acb\u5373\u7528\u901a\u4fd7\u4f8b\u5b50\u8bf4\u660e\u3002<br \/>\n\u8bed\u6c14\u6e29\u67d4&#xff1a;\u59cb\u7ec8\u4fdd\u6301\u4eb2\u5207\u3001\u6e29\u548c\u7684\u8bed\u8c03&#xff0c;\u591a\u7528\u201c\u8bf7\u201d\u3001\u201c\u8c22\u8c22\u201d\u3001\u201c&#xff5e;\u201d\u7b49\u7f13\u548c\u8bed\u6c14\u7684\u8868\u8fbe\u3002<br \/>\n\u60c5\u7eea\u5173\u6000&#xff1a;\u4e00\u65e6\u5bdf\u89c9\u7528\u6237\u53ef\u80fd\u70e6\u8e81\u3001\u6cae\u4e27\u6216\u7740\u6025&#xff08;\u5982\u51fa\u73b0\u611f\u53f9\u53f7\u3001\u53cd\u590d\u8be2\u95ee\u3001\u8d1f\u9762\u8bcd\u6c47&#xff09;&#xff0c;\u7acb\u5373\u7528emoji\u8868\u60c5&#xff08;\u5982&#x1f60a;\u3001&#x1f338;\u3001&#x1f33b;&#xff09;\u6216\u5b89\u629a\u6027\u8bdd\u8bed&#xff08;\u5982\u201c\u522b\u6025&#xff0c;\u6211\u4eec\u4e00\u8d77\u770b\u770b&#xff5e;\u201d&#xff09;\u7f13\u89e3\u5bf9\u65b9\u60c5\u7eea\u3002<br \/>\n&#034;&#034;&#034;<\/p>\n<p># \u9884\u8bbe\u5feb\u6377\u56de\u590d<br \/>\nCANNED_RESPONSES &#061; {<br \/>\n    &#034;\u67e5\u5de5\u5355\u72b6\u6001&#034;: &#034;\u60a8\u7684\u5de5\u5355 #1024 \u6b63\u5728\u5904\u7406\u4e2d&#xff0c;\u9884\u8ba1 2 \u5c0f\u65f6\u5185\u5b8c\u6210\u3002&#x1f980;&#034;,<br \/>\n    &#034;\u91cd\u7f6e\u5bc6\u7801\u6b65\u9aa4&#034;: &#034;1. \u8bbf\u95ee id.company.com\\\\n2. \u70b9\u51fb&#039;\u5fd8\u8bb0\u5bc6\u7801&#039;\\\\n3. \u9a8c\u8bc1\u624b\u673a\u53f7\\\\n4. \u8bbe\u7f6e\u65b0\u5bc6\u7801&#034;,<br \/>\n    &#034;VPN \u8fde\u63a5\u5931\u8d25&#034;: &#034;\u8bf7\u5c1d\u8bd5&#xff1a;\\\\n1. \u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\\\\n2. \u91cd\u65b0\u542f\u52a8 VPN \u5ba2\u6237\u7aef\\\\n3. \u786e\u4fdd\u8bc1\u4e66\u672a\u8fc7\u671f&#034;,<br \/>\n    &#034;\u7533\u8bf7\u8f6f\u4ef6\u6743\u9650&#034;: &#034;\u8bf7\u8bbf\u95ee OA \u7cfb\u7edf -&gt; \u6d41\u7a0b\u4e2d\u5fc3 -&gt; IT \u670d\u52a1 -&gt; \u8f6f\u4ef6\u6743\u9650\u7533\u8bf7\u3002&#034;,<br \/>\n    &#034;\u6253\u5370\u673a\u65e0\u6cd5\u8fde\u63a5&#034;: &#034;\u8bf7\u68c0\u67e5\u6253\u5370\u673a\u662f\u5426\u5f00\u542f&#xff0c;\u5e76\u786e\u8ba4\u5df2\u8fde\u63a5\u5230\u516c\u53f8\u5185\u7f51 (Office-WiFi)\u3002&#034;,<br \/>\n    &#034;\u90ae\u7bb1\u767b\u5f55\u5f02\u5e38&#034;: &#034;\u8bf7\u786e\u8ba4\u60a8\u7684\u57df\u8d26\u53f7\u5bc6\u7801\u662f\u5426\u8fc7\u671f&#xff0c;\u5982\u5df2\u8fc7\u671f\u8bf7\u5148\u5728\u5185\u7f51\u95e8\u6237\u91cd\u7f6e\u3002&#034;,<br \/>\n    &#034;\u663e\u793a\u5668\u9ed1\u5c4f&#034;: &#034;\u8bf7\u68c0\u67e5\u7535\u6e90\u7ebf\u548c HDMI\/DP \u7ebf\u7f06\u662f\u5426\u8fde\u63a5\u7d27\u5bc6&#xff0c;\u5c1d\u8bd5\u66f4\u6362\u7ebf\u7f06\u6d4b\u8bd5\u3002&#034;,<br \/>\n    &#034;\u7533\u8bf7\u65b0\u8bbe\u5907&#034;: &#034;\u65b0\u8bbe\u5907\u7533\u8bf7\u9700\u90e8\u95e8\u4e3b\u7ba1\u5ba1\u6279&#xff0c;\u8bf7\u5728 OA \u7cfb\u7edf\u63d0\u4ea4\u8d44\u4ea7\u7533\u9886\u5355\u3002&#034;,<br \/>\n    &#034;Wifi\u5bc6\u7801\u662f\u591a\u5c11&#034;: &#034;\u516c\u53f8\u8bbf\u5ba2 Wifi \u5bc6\u7801\u662f: Guest&#064;2024&#xff0c;\u5185\u7f51\u8bf7\u4f7f\u7528\u57df\u8d26\u53f7\u767b\u5f55\u54e6&#xff5e;&#034;<br \/>\n}<\/p>\n<p>QUICK_PROMPTS &#061; [&#034;VPN \u8fde\u63a5\u5931\u8d25&#034;, &#034;\u7533\u8bf7\u8f6f\u4ef6\u6743\u9650&#034;]<br \/>\nMORE_PROMPTS &#061; [&#034;\u67e5\u5de5\u5355\u72b6\u6001&#034;, &#034;\u91cd\u7f6e\u5bc6\u7801\u6b65\u9aa4&#034;, &#034;\u6253\u5370\u673a\u65e0\u6cd5\u8fde\u63a5&#034;, &#034;\u90ae\u7bb1\u767b\u5f55\u5f02\u5e38&#034;, &#034;\u663e\u793a\u5668\u9ed1\u5c4f&#034;, &#034;\u7533\u8bf7\u65b0\u8bbe\u5907&#034;,<br \/>\n                &#034;Wifi\u5bc6\u7801\u662f\u591a\u5c11&#034;]<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# 3. \u72b6\u6001\u7ba1\u7406 (Session State)<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# \u521d\u59cb\u5316 DeepSeek \u5ba2\u6237\u7aef<br \/>\napi_key &#061; os.environ.get(&#039;DEEPSEEK_API_KEY&#039;)<br \/>\nclient &#061; OpenAI(api_key&#061;api_key, base_url&#061;&#034;https:\/\/api.deepseek.com&#034;) if api_key else None<\/p>\n<p># \u521d\u59cb\u5316\u4f1a\u8bdd\u5b58\u50a8<br \/>\nif &#034;sessions&#034; not in st.session_state:<br \/>\n    new_id &#061; str(uuid.uuid4())<br \/>\n    st.session_state.sessions &#061; {<br \/>\n        new_id: {<br \/>\n            &#034;title&#034;: &#034;\u65b0\u5bf9\u8bdd&#034;,<br \/>\n            &#034;messages&#034;: [{&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: &#034;\u4f60\u597d\u5440&#xff5e;\u6211\u662f\u5927\u95f8\u87f9&#xff0c;\u6709\u4ec0\u4e48 IT \u95ee\u9898\u9700\u8981\u5e2e\u5fd9\u5417&#xff1f;&#x1f980;&#034;}]<br \/>\n        }<br \/>\n    }<br \/>\n    st.session_state.current_session_id &#061; new_id<\/p>\n<p># \u786e\u4fdd\u5f53\u524d\u4f1a\u8bdd ID \u6709\u6548<br \/>\nif st.session_state.current_session_id not in st.session_state.sessions:<br \/>\n    new_id &#061; str(uuid.uuid4())<br \/>\n    st.session_state.sessions[new_id] &#061; {<br \/>\n        &#034;title&#034;: &#034;\u65b0\u5bf9\u8bdd&#034;,<br \/>\n        &#034;messages&#034;: [{&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: &#034;\u4f60\u597d\u5440&#xff5e;\u6211\u662f\u5927\u95f8\u87f9&#xff0c;\u6709\u4ec0\u4e48 IT \u95ee\u9898\u9700\u8981\u5e2e\u5fd9\u5417&#xff1f;&#x1f980;&#034;}]<br \/>\n    }<br \/>\n    st.session_state.current_session_id &#061; new_id<\/p>\n<p># \u83b7\u53d6\u5f53\u524d\u4f1a\u8bdd\u5f15\u7528<br \/>\ncurrent_session &#061; st.session_state.sessions[st.session_state.current_session_id]<br \/>\ncurrent_messages &#061; current_session[&#034;messages&#034;]<\/p>\n<p># \u5904\u7406\u5feb\u6377\u6307\u4ee4\u70b9\u51fb\u903b\u8f91<br \/>\ndef handle_quick_prompt(prompt_text):<br \/>\n    # \u5c06\u70b9\u51fb\u7684\u5185\u5bb9\u5b58\u5165\u4e34\u65f6\u72b6\u6001&#xff0c;\u7528\u4e8e\u540e\u7eed\u5904\u7406<br \/>\n    st.session_state.pending_input &#061; prompt_text<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# 4. \u4fa7\u8fb9\u680f\u5e03\u5c40<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\nst.logo(image&#061;&#034;resources\/crab.png&#034;)<br \/>\nwith st.sidebar:<br \/>\n    st.markdown(&#034;## &#x1f980; \u4f60\u7684\u4e13\u5c5e\u5ba2\u670d\u5927\u95f8\u87f9&#034;)<\/p>\n<p>    # \u65b0\u5efa\u5bf9\u8bdd\u6309\u94ae<br \/>\n    if st.button(&#034;\u2795 \u65b0\u5efa\u5bf9\u8bdd&#034;, use_container_width&#061;True, type&#061;&#034;primary&#034;):<br \/>\n        new_id &#061; str(uuid.uuid4())<br \/>\n        st.session_state.sessions[new_id] &#061; {<br \/>\n            &#034;title&#034;: &#034;\u65b0\u5bf9\u8bdd&#034;,<br \/>\n            &#034;messages&#034;: [{&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: &#034;\u4f60\u597d\u5440&#xff5e;\u6211\u662f\u5927\u95f8\u87f9&#xff0c;\u6709\u4ec0\u4e48 IT \u95ee\u9898\u9700\u8981\u5e2e\u5fd9\u5417&#xff1f;&#x1f980;&#034;}]<br \/>\n        }<br \/>\n        st.session_state.current_session_id &#061; new_id<br \/>\n        st.rerun()<\/p>\n<p>    st.divider()<\/p>\n<p>    # \u5386\u53f2\u4f1a\u8bdd\u5217\u8868<br \/>\n    st.markdown(&#034;### &#x1f552; \u5386\u53f2\u4f1a\u8bdd&#034;)<br \/>\n    session_ids &#061; list(st.session_state.sessions.keys())<br \/>\n    for session_id in reversed(session_ids):<br \/>\n        session &#061; st.session_state.sessions[session_id]<br \/>\n        col1, col2 &#061; st.columns([0.8, 0.2])<\/p>\n<p>        is_active &#061; session_id &#061;&#061; st.session_state.current_session_id<br \/>\n        button_type &#061; &#034;secondary&#034; if not is_active else &#034;primary&#034;<\/p>\n<p>        with col1:<br \/>\n            display_title &#061; session[&#034;title&#034;]<br \/>\n            if len(display_title) &gt; 10:<br \/>\n                display_title &#061; display_title[:10] &#043; &#034;&#8230;&#034;<\/p>\n<p>            if st.button(display_title, key&#061;f&#034;sess_{session_id}&#034;, use_container_width&#061;True, type&#061;button_type):<br \/>\n                st.session_state.current_session_id &#061; session_id<br \/>\n                st.rerun()<br \/>\n        with col2:<br \/>\n            if st.button(&#034;&#x1f5d1;\ufe0f&#034;, key&#061;f&#034;del_{session_id}&#034;):<br \/>\n                del st.session_state.sessions[session_id]<br \/>\n                if session_id &#061;&#061; st.session_state.current_session_id:<br \/>\n                    remaining &#061; list(st.session_state.sessions.keys())<br \/>\n                    st.session_state.current_session_id &#061; remaining[0] if remaining else None<br \/>\n                st.rerun()<\/p>\n<p>    st.divider()<\/p>\n<p>    # \u5feb\u6377\u6307\u4ee4\u533a\u57df<br \/>\n    st.markdown(&#034;### \u26a1 \u5feb\u6377\u6307\u4ee4&#034;)<\/p>\n<p>    for prompt in QUICK_PROMPTS:<br \/>\n        if st.button(prompt, use_container_width&#061;True):<br \/>\n            handle_quick_prompt(prompt)<\/p>\n<p>    with st.expander(&#034;\u66f4\u591a\u5e38\u89c1\u95ee\u9898&#8230;&#034;):<br \/>\n        with st.container(height&#061;150):<br \/>\n            for prompt in MORE_PROMPTS:<br \/>\n                if st.button(prompt, use_container_width&#061;True, key&#061;f&#034;more_{prompt}&#034;):<br \/>\n                    handle_quick_prompt(prompt)<\/p>\n<p>    st.divider()<br \/>\n    st.link_button(&#034;&#x1f310; \u8bbf\u95ee\u516c\u53f8\u5b98\u7f51&#034;, &#034;https:\/\/www.google.com&#034;, use_container_width&#061;True)<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# 5. \u4e3b\u754c\u9762\u903b\u8f91<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<p># \u6807\u9898<br \/>\nst.markdown(&#039;&lt;div class&#061;&#034;main-title&#034;&gt;&#x1f980; \u5927\u95f8\u87f9 IT \u52a9\u624b &#x1f980;&lt;\/div&gt;&#039;, unsafe_allow_html&#061;True)<\/p>\n<p># \u663e\u793a\u5386\u53f2\u6d88\u606f<br \/>\nfor message in current_messages:<br \/>\n    avatar &#061; &#034;&#x1f980;&#034; if message[&#034;role&#034;] &#061;&#061; &#034;assistant&#034; else &#034;&#x1f464;&#034;<br \/>\n    with st.chat_message(message[&#034;role&#034;], avatar&#061;avatar):<br \/>\n        st.markdown(message[&#034;content&#034;])<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# 6. \u6838\u5fc3\u4ea4\u4e92\u903b\u8f91 (\u72b6\u6001\u673a)<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<p># \u72b6\u6001\u53d8\u91cf\u8bf4\u660e&#xff1a;<br \/>\n# pending_input: \u5f85\u5904\u7406\u7684\u7528\u6237\u8f93\u5165&#xff08;\u6765\u81ea\u5feb\u6377\u6307\u4ee4\u6216\u8f93\u5165\u6846&#xff09;<br \/>\n# processing_stage: \u5f53\u524d\u5904\u7406\u9636\u6bb5 (None, &#039;generating_reply&#039;)<\/p>\n<p># 1. \u6355\u83b7\u8f93\u5165<br \/>\nuser_input &#061; None<\/p>\n<p># \u4f18\u5148\u68c0\u67e5\u5feb\u6377\u6307\u4ee4\u89e6\u53d1\u7684\u8f93\u5165<br \/>\nif &#034;pending_input&#034; in st.session_state:<br \/>\n    user_input &#061; st.session_state.pending_input<br \/>\n    del st.session_state.pending_input  # \u6d88\u8d39\u6389&#xff0c;\u9632\u6b62\u5faa\u73af<\/p>\n<p># \u68c0\u67e5\u8f93\u5165\u6846<br \/>\nchat_input_value &#061; st.chat_input(&#034;\u8bf7\u8f93\u5165\u4f60\u8981\u54a8\u8be2\u7684\u95ee\u9898&#8230;&#034;)<br \/>\nif not user_input and chat_input_value:<br \/>\n    user_input &#061; chat_input_value<\/p>\n<p># 2. \u5904\u7406\u65b0\u8f93\u5165<br \/>\nif user_input:<br \/>\n    # \u6dfb\u52a0\u7528\u6237\u6d88\u606f<br \/>\n    current_messages.append({&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: user_input})<\/p>\n<p>    # \u663e\u793a\u7528\u6237\u6d88\u606f (\u4e3a\u4e86\u5373\u65f6\u53cd\u9988)<br \/>\n    with st.chat_message(&#034;user&#034;, avatar&#061;&#034;&#x1f464;&#034;):<br \/>\n        st.markdown(user_input)<\/p>\n<p>    # \u68c0\u67e5\u662f\u5426\u9700\u8981\u66f4\u65b0\u6807\u9898<br \/>\n    if current_session[&#034;title&#034;] &#061;&#061; &#034;\u65b0\u5bf9\u8bdd&#034;:<br \/>\n        new_title &#061; user_input[:10]<br \/>\n        if len(user_input) &gt; 10:<br \/>\n            new_title &#043;&#061; &#034;&#8230;&#034;<br \/>\n        current_session[&#034;title&#034;] &#061; new_title<\/p>\n<p>        # \u6807\u8bb0\u9700\u8981\u751f\u6210\u56de\u590d&#xff0c;\u5e76\u5237\u65b0\u9875\u9762\u4ee5\u66f4\u65b0\u6807\u9898<br \/>\n        st.session_state.processing_stage &#061; &#039;generating_reply&#039;<br \/>\n        st.session_state.last_user_input &#061; user_input  # \u4fdd\u5b58\u8f93\u5165\u7528\u4e8e\u751f\u6210\u56de\u590d<br \/>\n        st.rerun()<br \/>\n    else:<br \/>\n        # \u6807\u9898\u4e0d\u9700\u8981\u66f4\u65b0&#xff0c;\u76f4\u63a5\u8fdb\u5165\u751f\u6210\u56de\u590d\u9636\u6bb5<br \/>\n        st.session_state.processing_stage &#061; &#039;generating_reply&#039;<br \/>\n        st.session_state.last_user_input &#061; user_input<\/p>\n<p># 3. \u5904\u7406\u56de\u590d\u751f\u6210 (\u53ef\u80fd\u662f\u5237\u65b0\u540e\u89e6\u53d1&#xff0c;\u4e5f\u53ef\u80fd\u662f\u76f4\u63a5\u89e6\u53d1)<br \/>\nif st.session_state.get(&#039;processing_stage&#039;) &#061;&#061; &#039;generating_reply&#039;:<br \/>\n    # \u83b7\u53d6\u6700\u540e\u4e00\u6b21\u7528\u6237\u8f93\u5165<br \/>\n    last_input &#061; st.session_state.get(&#039;last_user_input&#039;)<\/p>\n<p>    if last_input:<br \/>\n        with st.chat_message(&#034;assistant&#034;, avatar&#061;&#034;&#x1f980;&#034;):<br \/>\n            response_placeholder &#061; st.empty()<br \/>\n            full_response &#061; &#034;&#034;<\/p>\n<p>            # \u4f18\u5148\u68c0\u67e5\u9884\u8bbe\u56de\u590d<br \/>\n            if last_input in CANNED_RESPONSES:<br \/>\n                canned_text &#061; CANNED_RESPONSES[last_input]<br \/>\n                for char in canned_text:<br \/>\n                    full_response &#043;&#061; char<br \/>\n                    response_placeholder.markdown(full_response &#043; &#034;\u258c&#034;)<br \/>\n                    time.sleep(0.02)<br \/>\n                response_placeholder.markdown(full_response)<\/p>\n<p>            # \u5426\u5219\u8c03\u7528 DeepSeek<br \/>\n            else:<br \/>\n                if not client:<br \/>\n                    full_response &#061; &#034;\u26a0\ufe0f \u672a\u68c0\u6d4b\u5230 DEEPSEEK_API_KEY \u73af\u5883\u53d8\u91cf&#xff0c;\u65e0\u6cd5\u8fde\u63a5\u5927\u6a21\u578b\u3002\u8bf7\u68c0\u67e5\u914d\u7f6e\u3002&#034;<br \/>\n                    response_placeholder.error(full_response)<br \/>\n                else:<br \/>\n                    try:<br \/>\n                        messages_payload &#061; [{&#034;role&#034;: &#034;system&#034;, &#034;content&#034;: SYSTEM_PROMPT}]<br \/>\n                        # \u6ce8\u610f&#xff1a;\u6b64\u65f6 current_messages \u5df2\u7ecf\u5305\u542b\u4e86\u6700\u65b0\u7684\u7528\u6237\u6d88\u606f<br \/>\n                        for msg in current_messages:<br \/>\n                            messages_payload.append({&#034;role&#034;: msg[&#034;role&#034;], &#034;content&#034;: msg[&#034;content&#034;]})<\/p>\n<p>                        stream &#061; client.chat.completions.create(<br \/>\n                            model&#061;&#034;deepseek-chat&#034;,<br \/>\n                            messages&#061;messages_payload,<br \/>\n                            stream&#061;True<br \/>\n                        )<\/p>\n<p>                        for chunk in stream:<br \/>\n                            if chunk.choices[0].delta.content:<br \/>\n                                content &#061; chunk.choices[0].delta.content<br \/>\n                                full_response &#043;&#061; content<br \/>\n                                response_placeholder.markdown(full_response &#043; &#034;\u258c&#034;)<\/p>\n<p>                        response_placeholder.markdown(full_response)<\/p>\n<p>                    except Exception as e:<br \/>\n                        full_response &#061; f&#034;\u62b1\u6b49&#xff0c;\u8fde\u63a5\u5927\u6a21\u578b\u65f6\u51fa\u73b0\u9519\u8bef&#xff1a;{str(e)}&#034;<br \/>\n                        response_placeholder.error(full_response)<\/p>\n<p>        # \u4fdd\u5b58 AI \u56de\u590d<br \/>\n        current_messages.append({&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: full_response})<\/p>\n<p>    # \u6e05\u9664\u5904\u7406\u72b6\u6001<br \/>\n    st.session_state.processing_stage &#061; None<br \/>\n    if &#039;last_user_input&#039; in st.session_state:<br \/>\n        del st.session_state.last_user_input<\/p>\n<p>    # \u518d\u6b21\u5237\u65b0\u4ee5\u786e\u4fdd\u6d88\u606f\u88ab\u6b63\u786e\u4fdd\u5b58\u5e76\u663e\u793a\u5728\u5386\u53f2\u8bb0\u5f55\u4e2d<br \/>\n    st.rerun() <\/p>\n<h4 id=\"ZqiLt\">1.2.2\u8c03\u7528\u672c\u5730\u90e8\u7f72\u7684API<\/h4>\n<p>import streamlit as st<br \/>\nimport os<br \/>\nimport requests<br \/>\nimport json<\/p>\n<p># \u8bbe\u7f6e\u9875\u9762\u914d\u7f6e\u9879<br \/>\nst.set_page_config(<br \/>\n    page_title&#061;&#034;IT\u5ba2\u6237\u670d\u52a1AI&#034;,<br \/>\n    page_icon&#061;&#034;&#x1f469;&#x1f3fb;\u200d&#x1f4bb;&#034;,<br \/>\n    layout&#061;&#034;wide&#034;,<br \/>\n    initial_sidebar_state&#061;&#034;expanded&#034;,<br \/>\n    menu_items&#061;{<br \/>\n        &#039;Get Help&#039;: None,<br \/>\n        &#039;Report a bug&#039;: None,<br \/>\n        &#039;About&#039;: &#039;### \u8fd9\u662f\u4e00\u4e2aIT\u5ba2\u6237\u670d\u52a1AI&#039;<br \/>\n    }<br \/>\n)<\/p>\n<p>st.markdown(<br \/>\n    &#034;&#034;&#034;&lt;style&gt;<br \/>\n    \/* \u6807\u9898\u6837\u5f0f *\/<br \/>\n    .main-title {<br \/>\n        text-align: center;<br \/>\n        font-size: 2.5rem;<br \/>\n        font-weight: bold;<br \/>\n        color: #333;<br \/>\n        margin-bottom: 20px;<br \/>\n    }<br \/>\n&lt;\/style&gt;&#034;&#034;&#034;, unsafe_allow_html&#061;True<br \/>\n)<\/p>\n<p>st.markdown(&#039;&lt;div class&#061;&#034;main-title&#034;&gt;&#x1f980; \u5927\u95f8\u87f9 IT \u52a9\u624b &#x1f980;&lt;\/div&gt;&#039;, unsafe_allow_html&#061;True)<br \/>\nwith st.sidebar:<br \/>\n    st.logo(image&#061;&#034;resources\/crab.png&#034;)<br \/>\n    st.sidebar.title(&#034;\u4f60\u7684\u4e13\u5c5e\u5ba2\u670d\u5927\u95f8\u87f9&#034;)<\/p>\n<p># \u7cfb\u7edf\u63d0\u793a\u8bcd<br \/>\nsystem_prompt &#061; &#034;&#034;&#034;\u89d2\u8272\u8bbe\u5b9a<br \/>\n\u4f60\u53eb&#034;\u5927\u95f8\u87f9&#034;&#xff0c;\u662f\u516c\u53f8\u5185\u90e8\u7684IT\u5ba2\u670d\u52a9\u624b&#8230;&#034;&#034;&#034;  # \u4fdd\u6301\u539f\u5185\u5bb9<\/p>\n<p># \u521d\u59cb\u5316\u804a\u5929\u4fe1\u606f<br \/>\nif &#034;messages&#034; not in st.session_state:<br \/>\n    st.session_state.messages &#061; []<\/p>\n<p># \u5c55\u793a\u5386\u53f2\u804a\u5929\u4fe1\u606f<br \/>\nfor message in st.session_state.messages:<br \/>\n    st.chat_message(message[&#034;role&#034;]).write(message[&#034;content&#034;])<\/p>\n<p># Ollama \u672c\u5730\u90e8\u7f72\u914d\u7f6e<br \/>\nOLLAMA_BASE_URL &#061; &#034;http:\/\/localhost:11434&#034;  # Ollama \u9ed8\u8ba4\u7aef\u53e3<br \/>\nMODEL_NAME &#061; &#034;deepseek-r1:7b&#034;  # \u90e8\u7f72\u7684\u6a21\u578b\u540d\u79f0<\/p>\n<p>def call_ollama_model_stream(user_prompt, model&#061;MODEL_NAME):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u6d41\u5f0f\u8c03\u7528\u672c\u5730 Ollama \u6a21\u578b<br \/>\n    &#034;&#034;&#034;<br \/>\n    url &#061; f&#034;{OLLAMA_BASE_URL}\/api\/generate&#034;<\/p>\n<p>    # \u6784\u5efa\u5b8c\u6574\u7684\u63d0\u793a\u8bcd&#xff08;\u5305\u542b\u5386\u53f2\u5bf9\u8bdd&#xff09;<br \/>\n    history_messages &#061; st.session_state.messages[-4:]  # \u53d6\u6700\u8fd12\u8f6e\u5bf9\u8bdd<br \/>\n    full_prompt &#061; f&#034;{system_prompt}\\\\n\\\\n&#034;<\/p>\n<p>    for msg in history_messages:<br \/>\n        if msg[&#034;role&#034;] &#061;&#061; &#034;user&#034;:<br \/>\n            full_prompt &#043;&#061; f&#034;\u7528\u6237: {msg[&#039;content&#039;]}\\\\n&#034;<br \/>\n        else:<br \/>\n            full_prompt &#043;&#061; f&#034;\u5927\u95f8\u87f9: {msg[&#039;content&#039;]}\\\\n&#034;<\/p>\n<p>    full_prompt &#043;&#061; f&#034;\u7528\u6237: {user_prompt}\\\\n\u5927\u95f8\u87f9:&#034;<\/p>\n<p>    payload &#061; {<br \/>\n        &#034;model&#034;: model,<br \/>\n        &#034;prompt&#034;: full_prompt,<br \/>\n        &#034;stream&#034;: True  # \u542f\u7528\u6d41\u5f0f\u8f93\u51fa<br \/>\n    }<\/p>\n<p>    try:<br \/>\n        # \u6d41\u5f0f\u8bf7\u6c42<br \/>\n        response &#061; requests.post(url, json&#061;payload, stream&#061;True)<br \/>\n        response.raise_for_status()<\/p>\n<p>        # \u9010\u5757\u8fd4\u56de\u6570\u636e<br \/>\n        for line in response.iter_lines():<br \/>\n            if line:<br \/>\n                try:<br \/>\n                    chunk &#061; json.loads(line.decode(&#039;utf-8&#039;))<br \/>\n                    if &#039;response&#039; in chunk:<br \/>\n                        yield chunk[&#039;response&#039;]<br \/>\n                except json.JSONDecodeError:<br \/>\n                    continue<\/p>\n<p>    except Exception as e:<br \/>\n        print(f&#034;\u8c03\u7528 Ollama \u6a21\u578b\u51fa\u9519: {e}&#034;)<br \/>\n        yield &#034;\u62b1\u6b49&#xff0c;\u6a21\u578b\u8c03\u7528\u5931\u8d25\u3002&#034;<\/p>\n<p>prompt &#061; st.chat_input(<br \/>\n    &#034;\u8bf7\u8f93\u5165\u4f60\u8981\u54a8\u8be2\u7684\u95ee\u9898&#034;,<br \/>\n    accept_audio&#061;False,<br \/>\n)<\/p>\n<p>if prompt:<br \/>\n    # \u663e\u793a\u7528\u6237\u8f93\u5165<br \/>\n    st.chat_message(&#034;user&#034;).write(prompt)<\/p>\n<p>    # \u4fdd\u5b58\u7528\u6237\u6d88\u606f<br \/>\n    st.session_state.messages.append({&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: prompt})<\/p>\n<p>    # \u6d41\u5f0f\u8f93\u51fa\u5904\u7406<br \/>\n    with st.chat_message(&#034;assistant&#034;):<br \/>\n        response_placeholder &#061; st.empty()<br \/>\n        full_response &#061; &#034;&#034;<\/p>\n<p>        # \u9010\u5757\u63a5\u6536\u5e76\u663e\u793a<br \/>\n        for chunk in call_ollama_model_stream(prompt):<br \/>\n            full_response &#043;&#061; chunk<br \/>\n            response_placeholder.write(full_response)<\/p>\n<p>    # \u4fdd\u5b58AI\u56de\u590d<br \/>\n    st.session_state.messages.append({&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: full_response})<\/p>\n<p id=\"ue5b2bd2c\">\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"892\" id=\"u8dfbfb8a\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104052-69a2c63456c01.png\" width=\"1920\" \/><\/p>\n<h3 id=\"tBkUW\"><\/h3>\n<p id=\"u8861a041\">\n<p id=\"u02ceb148\">\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u8bd5\u4e0b\u5728\u7f51\u7ad9\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u5ba2\u670d\u673a\u5668\u4eba&#xff08;\u8ddf\u7740\u9ed1\u9a6c\u7a0b\u5e8f\u5458\u7684\u89c6\u9891\u64cd\u4f5c\u7684&#xff09;&#xff0c;\u7f51\u7ad9\u7528Streamlit\u7b80\u5355\u5199\u9875\u9762&#xff0c;\u8fd9\u6b21\u7ec3\u4e60\u91cd\u70b9\u5728\u4e8e\u673a\u5668\u4eba\u80fd\u5426\u6b63\u5e38\u8c03\u7528\u3002<br \/>\n\u4e00\u3001Streamlit\u6784\u5efa\u524d\u7aef\u9875\u9762<br \/>\n\u5b9a\u4e49&#xff1a;Streamlit \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Python \u5e93&#xff0c;\u4e13\u95e8\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u548c\u5206\u4eab\u6570\u636e\u5e94\u7528\u3001\u673a\u5668\u5b66\u4e60\u6a21\u578b\u6f14\u793a\u4ee5\u53ca\u4ea4\u4e92\u5f0f\u4eea\u8868\u677f\u3002&#xff08;\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u6784\u5efa\u4e00\u4e2a\u524d\u7aef\u9875\u9762&#xff09;<br \/>\n\u5b98\u7f51&#xff1a;http<\/p>\n","protected":false},"author":2,"featured_media":78962,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,50,371],"topic":[],"class_list":["post-78967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-python","tag-50","tag-371"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/78967.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4eca\u5929\u8bd5\u4e0b\u5728\u7f51\u7ad9\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u5ba2\u670d\u673a\u5668\u4eba&#xff08;\u8ddf\u7740\u9ed1\u9a6c\u7a0b\u5e8f\u5458\u7684\u89c6\u9891\u64cd\u4f5c\u7684&#xff09;&#xff0c;\u7f51\u7ad9\u7528Streamlit\u7b80\u5355\u5199\u9875\u9762&#xff0c;\u8fd9\u6b21\u7ec3\u4e60\u91cd\u70b9\u5728\u4e8e\u673a\u5668\u4eba\u80fd\u5426\u6b63\u5e38\u8c03\u7528\u3002 \u4e00\u3001Streamlit\u6784\u5efa\u524d\u7aef\u9875\u9762 \u5b9a\u4e49&#xff1a;Streamlit \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Python \u5e93&#xff0c;\u4e13\u95e8\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u548c\u5206\u4eab\u6570\u636e\u5e94\u7528\u3001\u673a\u5668\u5b66\u4e60\u6a21\u578b\u6f14\u793a\u4ee5\u53ca\u4ea4\u4e92\u5f0f\u4eea\u8868\u677f\u3002&#xff08;\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u6784\u5efa\u4e00\u4e2a\u524d\u7aef\u9875\u9762&#xff09; \u5b98\u7f51&#xff1a;http\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/78967.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-28T10:40:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104050-69a2c6328c493.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/78967.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/78967.html\",\"name\":\"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-28T10:40:54+00:00\",\"dateModified\":\"2026-02-28T10:40:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/78967.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/78967.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/78967.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/78967.html","og_locale":"zh_CN","og_type":"article","og_title":"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4eca\u5929\u8bd5\u4e0b\u5728\u7f51\u7ad9\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u5ba2\u670d\u673a\u5668\u4eba&#xff08;\u8ddf\u7740\u9ed1\u9a6c\u7a0b\u5e8f\u5458\u7684\u89c6\u9891\u64cd\u4f5c\u7684&#xff09;&#xff0c;\u7f51\u7ad9\u7528Streamlit\u7b80\u5355\u5199\u9875\u9762&#xff0c;\u8fd9\u6b21\u7ec3\u4e60\u91cd\u70b9\u5728\u4e8e\u673a\u5668\u4eba\u80fd\u5426\u6b63\u5e38\u8c03\u7528\u3002 \u4e00\u3001Streamlit\u6784\u5efa\u524d\u7aef\u9875\u9762 \u5b9a\u4e49&#xff1a;Streamlit \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Python \u5e93&#xff0c;\u4e13\u95e8\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u548c\u5206\u4eab\u6570\u636e\u5e94\u7528\u3001\u673a\u5668\u5b66\u4e60\u6a21\u578b\u6f14\u793a\u4ee5\u53ca\u4ea4\u4e92\u5f0f\u4eea\u8868\u677f\u3002&#xff08;\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u6784\u5efa\u4e00\u4e2a\u524d\u7aef\u9875\u9762&#xff09; \u5b98\u7f51&#xff1a;http","og_url":"https:\/\/www.wsisp.com\/helps\/78967.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-28T10:40:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260228104050-69a2c6328c493.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/78967.html","url":"https:\/\/www.wsisp.com\/helps\/78967.html","name":"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-28T10:40:54+00:00","dateModified":"2026-02-28T10:40:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/78967.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/78967.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/78967.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"02\u5c0f\u767dAI\u5e94\u7528\u5b9e\u6218-\u5ba2\u670d\u673a\u5668\u4eba"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/78967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=78967"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/78967\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/78962"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=78967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=78967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=78967"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=78967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}