{"id":21670,"date":"2025-04-19T04:56:56","date_gmt":"2025-04-18T20:56:56","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/21670.html"},"modified":"2025-04-19T04:56:56","modified_gmt":"2025-04-18T20:56:56","slug":"%e7%94%a8curl%e5%92%8cpython%e9%80%9a%e8%bf%87%e7%bd%91%e7%bb%9c%e6%b5%8b%e8%af%95ollama%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e9%85%8d%e7%bd%ae%e5%92%8c%e7%8a%b6%e6%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/21670.html","title":{"rendered":"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001"},"content":{"rendered":"<p>\u5f53\u4e00\u4e2aOllama\u670d\u52a1\u5668\u521b\u5efa\u597d\u540e&#xff0c;\u9664\u4e86\u7528ollama\u6307\u4ee4\u6765\u6d4b\u8bd5&#xff0c;\u8fd8\u53ef\u4ee5\u4f7f\u7528curl\u548cpython\u6765\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u7684\u914d\u7f6e\u662f\u5426\u6b63\u786e&#xff0c;\u8fdc\u7a0b\u662f\u5426\u80fd\u6b63\u5e38\u8fde\u4e0a\u5e76\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E5%90%AF%E5%8A%A8Ollama%E6%9C%8D%E5%8A%A1%E5%99%A8-toc\" style=\"margin-left:0px\">\u542f\u52a8Ollama\u670d\u52a1\u5668<\/p>\n<p id=\"%E4%B8%8B%E8%BD%BD%E6%A8%A1%E5%9E%8B-toc\" style=\"margin-left:40px\">\u4e0b\u8f7d\u6a21\u578b<\/p>\n<p id=\"curl%E6%B5%8B%E8%AF%95-toc\" style=\"margin-left:0px\">curl\u6d4b\u8bd5<\/p>\n<p id=\"%E6%A3%80%E6%9F%A5%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%8A%B6%E6%80%81-toc\" style=\"margin-left:40px\">\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001<\/p>\n<p id=\"%E5%88%97%E5%87%BA%E5%B7%B2%E5%AE%89%E8%A3%85%E7%9A%84%E6%A8%A1%E5%9E%8B-toc\" style=\"margin-left:40px\">\u5217\u51fa\u5df2\u5b89\u88c5\u7684\u6a21\u578b<\/p>\n<p id=\"%E8%B0%83%E7%94%A8deepseek-r1%3A1.5b%E6%A8%A1%E5%9E%8B%E6%B5%8B%E8%AF%95-toc\" style=\"margin-left:40px\">\u8c03\u7528deepseek-r1:1.5b\u6a21\u578b\u6d4b\u8bd5<\/p>\n<p id=\"%E6%9F%A5%E7%9C%8B%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81%E5%B7%A5%E5%85%B7%E8%B0%83%E7%94%A8-toc\" style=\"margin-left:40px\">\u67e5\u770b\u662f\u5426\u652f\u6301\u5de5\u5177\u8c03\u7528<\/p>\n<p id=\"-toc\" style=\"margin-left:40px\">\n<p id=\"%C2%A0API%E6%B5%8B%E8%AF%95-toc\" style=\"margin-left:0px\">\u00a0API\u6d4b\u8bd5<\/p>\n<p id=\"%E7%94%9F%E6%88%90%E6%96%87%E6%9C%AC-toc\" style=\"margin-left:40px\">\u751f\u6210\u6587\u672c<\/p>\n<p id=\"%C2%A0%E8%8E%B7%E5%8F%96%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8-toc\" style=\"margin-left:40px\">\u00a0\u83b7\u53d6\u6a21\u578b\u5217\u8868<\/p>\n<p id=\"%E6%98%BE%E7%A4%BA%E6%A8%A1%E5%9E%8B%E4%BF%A1%E6%81%AF-toc\" style=\"margin-left:40px\">\u663e\u793a\u6a21\u578b\u4fe1\u606f<\/p>\n<p id=\"%E6%A3%80%E9%AA%8C%E6%A8%A1%E5%9E%8B%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81MCP-toc\" style=\"margin-left:0px\">\u68c0\u9a8c\u6a21\u578b\u662f\u5426\u652f\u6301MCP<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E5%90%AF%E5%8A%A8Ollama%E6%9C%8D%E5%8A%A1%E5%99%A8\">\u542f\u52a8Ollama\u670d\u52a1\u5668<\/h2>\n<p>\u542f\u52a8\u670d\u52a1\u5668\u4e00\u822c\u4f7f\u7528\u547d\u4ee4&#xff1a;Ollama serve<\/p>\n<p>\u4e00\u822cOllama\u90fd\u8bbe\u7f6e\u4e3a\u5f00\u673a\u5373\u542f\u52a8\u670d\u52a1&#xff0c;\u4e0d\u7528\u518d\u624b\u5de5\u542f\u52a8\u670d\u52a1<\/p>\n<h3 id=\"%E4%B8%8B%E8%BD%BD%E6%A8%A1%E5%9E%8B\">\u4e0b\u8f7d\u6a21\u578b<\/h3>\n<p>\u5982\u679c\u6ca1\u6709\u4e0b\u8f7d\u6a21\u578b&#xff0c;\u7528\u8fd9\u6761\u547d\u4ee4<\/p>\n<p>ollama pull deepseek-r1:1.5b<\/p>\n<h2 id=\"curl%E6%B5%8B%E8%AF%95\">curl\u6d4b\u8bd5<\/h2>\n<h3 id=\"%E6%A3%80%E6%9F%A5%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%8A%B6%E6%80%81\">\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001<\/h3>\n<p>curl http:\/\/localhost:11434<\/p>\n<p>\u8f93\u51fa&#xff1a;Ollama is running<\/p>\n<h3 id=\"%E5%88%97%E5%87%BA%E5%B7%B2%E5%AE%89%E8%A3%85%E7%9A%84%E6%A8%A1%E5%9E%8B\">\u5217\u51fa\u5df2\u5b89\u88c5\u7684\u6a21\u578b<\/h3>\n<p>curl http:\/\/localhost:11434\/api\/tags<\/p>\n<p>\u8f93\u51fa<\/p>\n<p>{&#034;models&#034;:[{&#034;name&#034;:&#034;deepseek-r1:14b&#034;,&#034;model&#034;:&#034;deepseek-r1:14b&#034;,&#034;modified_at&#034;:&#034;2025-02-25T12:33:39.9452166&#043;08:00&#034;,&#034;size&#034;:8988112040,&#034;digest&#034;:&#034;ea35dfe18182f635ee2b214ea30b7520fe1ada68da018f8b395b444b662d4f1a&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;qwen2&#034;,&#034;families&#034;:[&#034;qwen2&#034;],&#034;parameter_size&#034;:&#034;14.8B&#034;,&#034;quantization_level&#034;:&#034;Q4_K_M&#034;}},{&#034;name&#034;:&#034;test:latest&#034;,&#034;model&#034;:&#034;test:latest&#034;,&#034;modified_at&#034;:&#034;2025-02-25T09:54:20.5132579&#043;08:00&#034;,&#034;size&#034;:91739413,&#034;digest&#034;:&#034;b0b2a46174385c0adcaa77ff245ffeced5fc4a61447b6f221b2beb5c5a760133&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;llama&#034;,&#034;families&#034;:[&#034;llama&#034;],&#034;parameter_size&#034;:&#034;134.52M&#034;,&#034;quantization_level&#034;:&#034;Q4_0&#034;}},{&#034;name&#034;:&#034;deepseek-r1:7b&#034;,&#034;model&#034;:&#034;deepseek-r1:7b&#034;,&#034;modified_at&#034;:&#034;2025-02-25T09:01:47.6178023&#043;08:00&#034;,&#034;size&#034;:4683075271,&#034;digest&#034;:&#034;0a8c266910232fd3291e71e5ba1e058cc5af9d411192cf88b6d30e92b6e73163&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;qwen2&#034;,&#034;families&#034;:[&#034;qwen2&#034;],&#034;parameter_size&#034;:&#034;7.6B&#034;,&#034;quantization_level&#034;:&#034;Q4_K_M&#034;}},{&#034;name&#034;:&#034;smollm:135m&#034;,&#034;model&#034;:&#034;smollm:135m&#034;,&#034;modified_at&#034;:&#034;2025-02-20T15:48:18.8525987&#043;08:00&#034;,&#034;size&#034;:91739413,&#034;digest&#034;:&#034;b0b2a46174385c0adcaa77ff245ffeced5fc4a61447b6f221b2beb5c5a760133&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;llama&#034;,&#034;families&#034;:[&#034;llama&#034;],&#034;parameter_size&#034;:&#034;134.52M&#034;,&#034;quantization_level&#034;:&#034;Q4_0&#034;}},{&#034;name&#034;:&#034;snowflake-arctic-embed2:latest&#034;,&#034;model&#034;:&#034;snowflake-arctic-embed2:latest&#034;,&#034;modified_at&#034;:&#034;2025-02-13T22:47:06.1934237&#043;08:00&#034;,&#034;size&#034;:1160296718,&#034;digest&#034;:&#034;5de93a84837d0ff00da872e90830df5d973f616cbf1e5c198731ab19dd7b776b&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;bert&#034;,&#034;families&#034;:[&#034;bert&#034;],&#034;parameter_size&#034;:&#034;566.70M&#034;,&#034;quantization_level&#034;:&#034;F16&#034;}},{&#034;name&#034;:&#034;deepseek-r1:8b&#034;,&#034;model&#034;:&#034;deepseek-r1:8b&#034;,&#034;modified_at&#034;:&#034;2025-02-13T09:09:39.7652506&#043;08:00&#034;,&#034;size&#034;:4920738407,&#034;digest&#034;:&#034;28f8fd6cdc677661426adab9338ce3c013d7e69a5bea9e704b364171a5d61a10&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;llama&#034;,&#034;families&#034;:[&#034;llama&#034;],&#034;parameter_size&#034;:&#034;8.0B&#034;,&#034;quantization_level&#034;:&#034;Q4_K_M&#034;}},{&#034;name&#034;:&#034;EntropyYue\/chatglm3:latest&#034;,&#034;model&#034;:&#034;EntropyYue\/chatglm3:latest&#034;,&#034;modified_at&#034;:&#034;2025-02-08T09:24:07.2296428&#043;08:00&#034;,&#034;size&#034;:3583423760,&#034;digest&#034;:&#034;8f6f34227356b30a94c02b65ab33e2e13b8687a05e0f0ddfce4c75e36c965e25&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;chatglm&#034;,&#034;families&#034;:[&#034;chatglm&#034;],&#034;parameter_size&#034;:&#034;6.2B&#034;,&#034;quantization_level&#034;:&#034;Q4_0&#034;}},{&#034;name&#034;:&#034;nomic-embed-text:latest&#034;,&#034;model&#034;:&#034;nomic-embed-text:latest&#034;,&#034;modified_at&#034;:&#034;2025-02-07T19:57:28.4688464&#043;08:00&#034;,&#034;size&#034;:274302450,&#034;digest&#034;:&#034;0a109f422b47e3a30ba2b10eca18548e944e8a23073ee3f3e947efcf3c45e59f&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;nomic-bert&#034;,&#034;families&#034;:[&#034;nomic-bert&#034;],&#034;parameter_size&#034;:&#034;137M&#034;,&#034;quantization_level&#034;:&#034;F16&#034;}},{&#034;name&#034;:&#034;llama3.2:latest&#034;,&#034;model&#034;:&#034;llama3.2:latest&#034;,&#034;modified_at&#034;:&#034;2025-02-07T19:55:39.7382597&#043;08:00&#034;,&#034;size&#034;:2019393189,&#034;digest&#034;:&#034;a80c4f17acd55265feec403c7aef86be0c25983ab279d83f3bcd3abbcb5b8b72&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;llama&#034;,&#034;families&#034;:[&#034;llama&#034;],&#034;parameter_size&#034;:&#034;3.2B&#034;,&#034;quantization_level&#034;:&#034;Q4_K_M&#034;}},{&#034;name&#034;:&#034;deepseek-r1:1.5b&#034;,&#034;model&#034;:&#034;deepseek-r1:1.5b&#034;,&#034;modified_at&#034;:&#034;2025-02-02T21:38:01.4217684&#043;08:00&#034;,&#034;size&#034;:1117322599,&#034;digest&#034;:&#034;a42b25d8c10a841bd24724309898ae851466696a7d7f3a0a408b895538ccbc96&#034;,&#034;details&#034;:{&#034;parent_model&#034;:&#034;&#034;,&#034;format&#034;:&#034;gguf&#034;,&#034;family&#034;:&#034;qwen2&#034;,&#034;families&#034;:[&#034;qwen2&#034;],&#034;parameter_size&#034;:&#034;1.8B&#034;,&#034;quantization_level&#034;:&#034;Q4_K_M&#034;}}]} <\/p>\n<p>\u00a0\u53ef\u4ee5\u770b\u5230deepseek-r1\u768414b\u30017b\u4ee5\u53ca1.5b\u6a21\u578b\u90fd\u5728\u3002<\/p>\n<h3 id=\"%E8%B0%83%E7%94%A8deepseek-r1%3A1.5b%E6%A8%A1%E5%9E%8B%E6%B5%8B%E8%AF%95\">\u8c03\u7528deepseek-r1:1.5b\u6a21\u578b\u6d4b\u8bd5<\/h3>\n<p># linux<br \/>\ncurl -X POST http:\/\/localhost:11434\/api\/generate \\\\<br \/>\n  -H &#034;Content-Type: application\/json&#034; \\\\<br \/>\n  -d &#039;{<br \/>\n    &#034;model&#034;: &#034;deepseek-r1:1.5b&#034;,<br \/>\n    &#034;prompt&#034;: &#034;hello&#034;,<br \/>\n    &#034;stream&#034;: true<br \/>\n  }&#039;<br \/>\n# Windows \u5355\u884c\u6d41\u8f93\u51fa<br \/>\ncurl -X POST http:\/\/localhost:11434\/api\/generate -H &#034;Content-Type: application\/json&#034; -d &#034;{ \\\\&#034;model\\\\&#034;: \\\\&#034;deepseek-r1:1.5b\\\\&#034;, \\\\&#034;prompt\\\\&#034;: \\\\&#034;hello\\\\&#034;, \\\\&#034;stream\\\\&#034;: true }&#034;<\/p>\n<p># Windows \u591a\u884c\u6d41\u8f93\u51fa<br \/>\ncurl -X POST http:\/\/localhost:11434\/api\/generate ^<br \/>\n  -H &#034;Content-Type: application\/json&#034; ^<br \/>\n  -d &#034;{\\\\&#034;model\\\\&#034;: \\\\&#034;deepseek-r1:1.5b\\\\&#034;, \\\\&#034;prompt\\\\&#034;: \\\\&#034;hello\\\\&#034;, \\\\&#034;stream\\\\&#034;: true }&#034;<\/p>\n<p># Windows \u591a\u884c\u975e\u6d41\u8f93\u51fa<br \/>\ncurl -X POST http:\/\/localhost:11434\/api\/generate ^<br \/>\n  -H &#034;Content-Type: application\/json&#034; ^<br \/>\n  -d &#034;{\\\\&#034;model\\\\&#034;: \\\\&#034;deepseek-r1:1.5b\\\\&#034;, \\\\&#034;prompt\\\\&#034;: \\\\&#034;hello\\\\&#034;, \\\\&#034;stream\\\\&#034;: false}&#034;<\/p>\n<p>\u5982\u679c\u80fd\u8f93\u51fa\u7c7b\u4f3cHello! How can I assist you today?\u8fd9\u6837\u7684\u56de\u7b54&#xff0c;\u5c31\u8bc1\u660eollama\u7684\u8c03\u7528\u6b63\u5e38\u3002<\/p>\n<h3 id=\"%E6%9F%A5%E7%9C%8B%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81%E5%B7%A5%E5%85%B7%E8%B0%83%E7%94%A8\">\u67e5\u770b\u662f\u5426\u652f\u6301\u5de5\u5177\u8c03\u7528<\/h3>\n<p>windows\u4e0b\u7684\u6307\u4ee4&#xff1a;<\/p>\n<p>curl http:\/\/localhost:11434\/api\/generate -d &#034;{\\\\&#034;model\\\\&#034;: \\\\&#034;deepseek-r1:1.5b\\\\&#034;,\\\\&#034;prompt\\\\&#034;: \\\\&#034;\u7528 JSON \u683c\u5f0f\u56de\u7b54&#xff0c;\u5305\u542b\u5317\u4eac\u5f53\u524d\u6e29\u5ea6\\\\&#034;,\\\\&#034;format\\\\&#034;: \\\\&#034;json\\\\&#034;, \\\\&#034;stream\\\\&#034;:false}&#034; <\/p>\n<p>\u00a0\u56de\u7b54\u91cc\u6709\u5982\u4e0b\u4fe1\u606f&#xff0c;\u8bc1\u660e\u4e00\u5207\u6b63\u5e38&#xff1a;<\/p>\n<p>&#034;response&#034;:&#034;{\\\\&#034;temperature\\\\&#034;: \\\\&#034;10\u00b0C\\\\&#034;}&#034;<\/p>\n<p>\u5982\u679c\u65e0\u6cd5\u8f93\u51fa\u7ed3\u6784\u5316 JSON&#xff0c;\u5219\u786e\u8ba4\u6a21\u578b\u4e0d\u652f\u6301\u5de5\u5177\u8c03\u7528\u3002<\/p>\n<\/p>\n<p>\u5f53\u7136&#xff0c;\u652f\u6301\u5de5\u5177\u8c03\u7528\u548c\u652f\u6301MCP\u662f\u4e24\u56de\u4e8b\u3002\u5f53\u524d\u6211\u4eec\u7684\u5de5\u4f5c\u91cd\u5fc3\u662fMCP\u3002<\/p>\n<p>\u5f53\u524d\u8bd5\u51fa\u6765\u652f\u6301MCP\u7684\u662fDeepSeek-v3\u548c<\/p>\n<h3 id=\"\"><\/h3>\n<h2 id=\"%C2%A0API%E6%B5%8B%E8%AF%95\">\u00a0API\u6d4b\u8bd5<\/h2>\n<p>\u5e38\u7528\u7684AI\u96c6\u6210\u8f6f\u4ef6&#xff0c;\u6bd4\u5982Cherry Studio\u30015ire \u7b49&#xff0c;\u90fd\u662f\u901a\u8fc7python api\u6765\u8c03\u7528AI\u5927\u6a21\u578b\u7684&#xff0c;\u6240\u4ee5\u8fd8\u9700\u8981\u6d4b\u8bd5API\u8c03\u7528\u3002<\/p>\n<h3 id=\"%E7%94%9F%E6%88%90%E6%96%87%E6%9C%AC\">\u751f\u6210\u6587\u672c<\/h3>\n<p>import requests<br \/>\nimport json<\/p>\n<p>url_generate &#061; &#034;http:\/\/localhost:11434\/api\/generate&#034;<\/p>\n<p>data &#061; {<br \/>\n    &#034;model&#034;: &#034;deepseek-r1:1.5b&#034;,  # \u66ff\u6362\u4e3a\u4f60\u4f7f\u7528\u7684\u6a21\u578b\u540d\u79f0<br \/>\n    &#034;prompt&#034;: &#034;hello&#034;,<br \/>\n    &#034;stream&#034;: False<br \/>\n}<\/p>\n<p>response &#061; requests.post(url_generate, json&#061;data)<br \/>\nresponse_dict &#061; response.json()<\/p>\n<p>print(&#034;\u751f\u6210\u7684\u6587\u672c:&#034;, response_dict.get(&#034;response&#034;))<\/p>\n<p>\u8f93\u51fa&#xff1a;Hello! How can I assist you today?<\/p>\n<p>\u5176\u5b9e\u53ea\u8981\u8fd9\u53e5\u6d4b\u8bd5\u901a\u8fc7&#xff0c;\u5c31\u8bc1\u660eOllama\u670d\u52a1\u5668\u4e00\u5207\u6b63\u5e38&#xff0c;\u5e76\u4e14\u53ef\u4ee5\u672c\u5730API\u8c03\u7528\u3002<\/p>\n<\/p>\n<h3 id=\"%C2%A0%E8%8E%B7%E5%8F%96%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8\">\u00a0\u83b7\u53d6\u6a21\u578b\u5217\u8868<\/h3>\n<p>url_list &#061; &#034;http:\/\/localhost:11434\/api\/tags&#034;<\/p>\n<p>response &#061; requests.get(url_list)<br \/>\nresponse_dict &#061; response.json()<\/p>\n<p>print(&#034;\u53ef\u7528\u6a21\u578b\u5217\u8868:&#034;)<br \/>\nfor model in response_dict.get(&#034;models&#034;, []):<br \/>\n    print(model[&#034;name&#034;])<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>deepseek-r1:14b test:latest deepseek-r1:7b smollm:135m snowflake-arctic-embed2:latest deepseek-r1:8b EntropyYue\/chatglm3:latest nomic-embed-text:latest llama3.2:latest deepseek-r1:1.5b<\/p>\n<p>\u00a0\u5728\u5f88\u591aAI\u8f6f\u4ef6\u4e2d&#xff0c;\u914d\u7f6e\u6a21\u578b\u90e8\u5206&#xff0c;\u5c31\u662f\u5728\u8bbe\u7f6ebase_url\u548ckey\u4e4b\u540e&#xff0c;\u8c03\u7528\u8fd9\u4e2aurl&#xff1a;http:\/\/localhost:11434\/api\/tags\u00a0\u6765\u83b7\u53d6\u6a21\u578b\u5217\u8868&#xff0c;\u5e76\u8ba9\u7528\u6237\u9009\u62e9\u8981\u4f7f\u7528\u7684\u6a21\u578b\u3002<\/p>\n<\/p>\n<h3 id=\"%E6%98%BE%E7%A4%BA%E6%A8%A1%E5%9E%8B%E4%BF%A1%E6%81%AF\">\u663e\u793a\u6a21\u578b\u4fe1\u606f<\/h3>\n<p>url_show_info &#061; &#034;http:\/\/localhost:11434\/api\/show&#034;<\/p>\n<p>data &#061; {<br \/>\n    &#034;name&#034;: &#034;deepseek-r1:1.5b&#034;  # \u66ff\u6362\u4e3a\u4f60\u60f3\u8981\u67e5\u8be2\u7684\u6a21\u578b\u540d\u79f0<br \/>\n}<\/p>\n<p>response &#061; requests.post(url_show_info, json&#061;data)<br \/>\nresponse_dict &#061; response.json()<\/p>\n<p>print(&#034;\u6a21\u578b\u4fe1\u606f:&#034;, json.dumps(response_dict, indent&#061;2, ensure_ascii&#061;False))<\/p>\n<p>\u8f93\u51fa\u6a21\u578b\u4fe1\u606f&#xff1a;<\/p>\n<p>\u6a21\u578b\u4fe1\u606f: {<br \/>\n  &#034;license&#034;: &#034;MIT License\\\\n\\\\nCopyright (c) 2023 DeepSeek\\\\n\\\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\\\nof this software and associated documentation files (the \\\\&#034;Software\\\\&#034;), to deal\\\\nin the Software without restriction, including without limitation the rights\\\\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\\\\ncopies of the Software, and to permit persons to whom the Software is\\\\nfurnished to do so, subject to the following conditions:\\\\n\\\\nThe above copyright notice and this permission notice shall be included in all\\\\ncopies or substantial portions of the Software.\\\\n\\\\nTHE SOFTWARE IS PROVIDED \\\\&#034;AS IS\\\\&#034;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\\\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\\\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\\\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\\\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\\\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\\\nSOFTWARE.\\\\n&#034;,<br \/>\n  &#034;modelfile&#034;: &#034;# Modelfile generated by \\\\&#034;ollama show\\\\&#034;\\\\n# To build a new Modelfile based on this, replace FROM with:\\\\n# FROM deepseek-r1:1.5b\\\\n\\\\nFROM E:\\\\\\\\ai\\\\\\\\models\\\\\\\\blobs\\\\\\\\sha256-aabd4debf0c8f08881923f2c25fc0fdeed24435271c2b3e92c4af36704040dbc\\\\nTEMPLATE \\\\&#034;\\\\&#034;\\\\&#034;{{- if .System }}{{ .System }}{{ end }}\\\\n{{- range $i, $_ :&#061; .Messages }}\\\\n{{- $last :&#061; eq (len (slice $.Messages $i)) 1}}\\\\n{{- if eq .Role \\\\&#034;user\\\\&#034; }}&lt;&#xff5c;User&#xff5c;&gt;{{ .Content }}\\\\n{{- else if eq .Role \\\\&#034;assistant\\\\&#034; }}&lt;&#xff5c;Assistant&#xff5c;&gt;{{ .Content }}{{- if not $last }}&lt;&#xff5c;end\u2581of\u2581sentence&#xff5c;&gt;{{- end }}\\\\n{{- end }}\\\\n{{- if and $last (ne .Role \\\\&#034;assistant\\\\&#034;) }}&lt;&#xff5c;Assistant&#xff5c;&gt;{{- end }}\\\\n{{- end }}\\\\&#034;\\\\&#034;\\\\&#034;\\\\nPARAMETER stop &lt;&#xff5c;begin\u2581of\u2581sentence&#xff5c;&gt;\\\\nPARAMETER stop &lt;&#xff5c;end\u2581of\u2581sentence&#xff5c;&gt;\\\\nPARAMETER stop &lt;&#xff5c;User&#xff5c;&gt;\\\\nPARAMETER stop &lt;&#xff5c;Assistant&#xff5c;&gt;\\\\nLICENSE \\\\&#034;\\\\&#034;\\\\&#034;MIT License\\\\n\\\\nCopyright (c) 2023 DeepSeek\\\\n\\\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\\\nof this software and associated documentation files (the \\\\&#034;Software\\\\&#034;), to deal\\\\nin the Software without restriction, including without limitation  <\/p>\n<h2 id=\"%E6%A3%80%E9%AA%8C%E6%A8%A1%E5%9E%8B%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81MCP\" style=\"background-color:transparent\">\u68c0\u9a8c\u6a21\u578b\u662f\u5426\u652f\u6301tools\u6216MCP<\/h2>\n<\/p>\n<p>linux\u4e0b\u00a0<\/p>\n<p>curl -X POST \\\\<br \/>\n  http:\/\/localhost:11434\/api\/generate \\\\<br \/>\n  -H &#039;Content-Type: application\/json&#039; \\\\<br \/>\n  -d &#039;{&#034;model&#034;: &#034;deepseek-r1:1.5b&#034;, &#034;prompt&#034;: &#034;\u8ba1\u7b97 2 &#043; 2&#034;, &#034;stream&#034;: false, &#034;tools&#034;: [&#034;calculator&#034;]}&#039;<\/p>\n<p>python\u4ea4\u4e92\u547d\u4ee4&#xff1a;\u00a0<\/p>\n<p>import requests<br \/>\nimport json<\/p>\n<p>url_generate &#061; &#034;http:\/\/localhost:11434\/api\/generate&#034;<\/p>\n<p>data &#061; {<br \/>\n    &#034;model&#034;: &#034;deepseek-r1:1.5b&#034;,  # \u66ff\u6362\u4e3a\u4f60\u4f7f\u7528\u7684\u6a21\u578b\u540d\u79f0<br \/>\n    &#034;prompt&#034;: &#034;\u8ba1\u7b972&#043;2&#034;,<br \/>\n    &#034;stream&#034;: False,<br \/>\n    &#034;tools&#034;: [&#034;calculator&#034;]<br \/>\n}<\/p>\n<p>response &#061; requests.post(url_generate, json&#061;data)<br \/>\nresponse_dict &#061; response.json()<\/p>\n<p>print(&#034;\u751f\u6210\u7684\u6587\u672c:&#034;, response_dict.get(&#034;response&#034;))<\/p>\n<p>\u6765\u4e2a\u83b7\u5f97\u6e29\u5ea6\u7684&#xff1a;\u00a0<\/p>\n<p>import requests<\/p>\n<p># MCP \u534f\u8bae\u6d4b\u8bd5\u7aef\u70b9<br \/>\nurl_generate &#061; &#034;http:\/\/localhost:11434\/api\/generate&#034;<\/p>\n<p># \u6d4b\u8bd5\u63d0\u793a\u8bcd&#xff08;\u660e\u786e\u8981\u6c42\u7b26\u5408 MCP \u534f\u8bae\u7684 JSON \u54cd\u5e94&#xff09;<br \/>\ntest_prompt &#061; &#039;&#039;&#039;\u6839\u636e MCP \u534f\u8bae\u8fd4\u56de\u4ee5\u4e0b\u5de5\u5177\u8c03\u7528\u8bf7\u6c42\u7684\u54cd\u5e94&#xff1a;<br \/>\n{<br \/>\n  &#034;action&#034;: &#034;call_tool&#034;,<br \/>\n  &#034;tool_name&#034;: &#034;get_weather&#034;,<br \/>\n  &#034;params&#034;: {&#034;city&#034;: &#034;\u5317\u4eac&#034;}<br \/>\n}&#039;&#039;&#039;<\/p>\n<p>data &#061; {<br \/>\n    &#034;model&#034;: &#034;deepseek-r1:1.5b&#034;,  # \u66ff\u6362\u4e3a\u5b9e\u9645\u652f\u6301 MCP \u7684\u6a21\u578b\u540d\u79f0<br \/>\n    &#034;prompt&#034;: test_prompt,<br \/>\n    &#034;stream&#034;: False,<br \/>\n    &#034;tools&#034;: [&#034;get_weather&#034;],  # \u5de5\u5177\u540d\u79f0\u9700\u4e0e\u8bf7\u6c42\u4e2d\u7684 tool_name \u4e00\u81f4<br \/>\n    &#034;response_format&#034;: {&#034;type&#034;: &#034;json&#034;}<br \/>\n}<\/p>\n<p>try:<br \/>\n    response &#061; requests.post(url_generate, json&#061;data)<br \/>\n    response.raise_for_status()  # \u68c0\u67e5 HTTP \u72b6\u6001\u7801<br \/>\n    response_dict &#061; response.json()<\/p>\n<p>    # \u63d0\u53d6\u7ed3\u6784\u5316\u54cd\u5e94<br \/>\n    generated_response &#061; response_dict.get(&#034;response&#034;, &#034;&#034;)<br \/>\n    print(&#034;\u751f\u6210\u7684 JSON \u54cd\u5e94:&#034;, generated_response)<\/p>\n<p>    # \u89e3\u6790 JSON \u5b57\u7b26\u4e32\u4e3a\u5b57\u5178&#xff08;\u82e5\u6a21\u578b\u8fd4\u56de\u7684\u662f\u5b57\u7b26\u4e32&#xff09;<br \/>\n    tool_response &#061; json.loads(generated_response) if isinstance(generated_response, str) else generated_response<\/p>\n<p>    # \u65ad\u8a00 MCP \u534f\u8bae\u7684\u5173\u952e\u5b57\u6bb5<br \/>\n    assert tool_response.get(&#034;action&#034;) &#061;&#061; &#034;tool_response&#034;, &#034;\u54cd\u5e94\u52a8\u4f5c\u4e0d\u7b26\u5408 MCP \u534f\u8bae&#034;<br \/>\n    assert &#034;status&#034; in tool_response.get(&#034;tool_response&#034;, {}), &#034;\u7f3a\u5c11\u72b6\u6001\u5b57\u6bb5&#034;<br \/>\n    assert tool_response[&#034;tool_response&#034;][&#034;status&#034;] &#061;&#061; &#034;success&#034;, &#034;\u5de5\u5177\u8c03\u7528\u5931\u8d25&#034;<\/p>\n<p>except requests.exceptions.RequestException as e:<br \/>\n    print(&#034;\u8bf7\u6c42\u5931\u8d25:&#034;, e)<br \/>\nexcept json.JSONDecodeError:<br \/>\n    print(&#034;\u54cd\u5e94\u975e\u5408\u6cd5 JSON \u683c\u5f0f&#034;)<br \/>\nexcept AssertionError as e:<br \/>\n    print(&#034;\u65ad\u8a00\u9519\u8bef:&#034;, e)<\/p>\n<p>\u00a0<\/p>\n<p>\u6d4b\u8bd5\u4e0b\u6765&#xff0c;\u611f\u89c9\u6709\u4e9b\u6a21\u578b\u8fd4\u56de\u7684\u4fe1\u606f\u6709\u5e72\u6270\u4fe1\u606f&#8230;..<\/p>\n<p>deepseek-v3\u548cllama3.2 3b\u6a21\u578b\u90fd\u662f\u652f\u6301MCP\u7684&#xff0c;\u4f46\u65e0\u6cd5\u4fdd\u8bc1\u6bcf\u56de\u90fd\u6b63\u786e\u56de\u5e94\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"768\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418205655-6802bc9737805.png\" width=\"768\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u5f53\u4e00\u4e2aOllama\u670d\u52a1\u5668\u521b\u5efa\u597d\u540e\uff0c\u9664\u4e86\u7528ollama\u6307\u4ee4\u6765\u6d4b\u8bd5\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528curl\u548cpython\u6765\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u7684\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u8fdc\u7a0b\u662f\u5426\u80fd\u6b63\u5e38\u8fde\u4e0a\u5e76\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u3002_python\u67e5\u770bollama\u662f\u5426\u6b63\u5e38<\/p>\n","protected":false},"author":2,"featured_media":21669,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[73,126,50,43,44],"topic":[],"class_list":["post-21670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-mcp","tag-ollama","tag-50","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001 - \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\/21670.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u5f53\u4e00\u4e2aOllama\u670d\u52a1\u5668\u521b\u5efa\u597d\u540e\uff0c\u9664\u4e86\u7528ollama\u6307\u4ee4\u6765\u6d4b\u8bd5\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528curl\u548cpython\u6765\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u7684\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u8fdc\u7a0b\u662f\u5426\u80fd\u6b63\u5e38\u8fde\u4e0a\u5e76\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u3002_python\u67e5\u770bollama\u662f\u5426\u6b63\u5e38\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/21670.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T20:56:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418205655-6802bc9737805.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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/21670.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/21670.html\",\"name\":\"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T20:56:56+00:00\",\"dateModified\":\"2025-04-18T20:56:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/21670.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/21670.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/21670.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001\"}]},{\"@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":"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001 - \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\/21670.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u5f53\u4e00\u4e2aOllama\u670d\u52a1\u5668\u521b\u5efa\u597d\u540e\uff0c\u9664\u4e86\u7528ollama\u6307\u4ee4\u6765\u6d4b\u8bd5\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528curl\u548cpython\u6765\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u7684\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u8fdc\u7a0b\u662f\u5426\u80fd\u6b63\u5e38\u8fde\u4e0a\u5e76\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u3002_python\u67e5\u770bollama\u662f\u5426\u6b63\u5e38","og_url":"https:\/\/www.wsisp.com\/helps\/21670.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T20:56:56+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418205655-6802bc9737805.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/21670.html","url":"https:\/\/www.wsisp.com\/helps\/21670.html","name":"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T20:56:56+00:00","dateModified":"2025-04-18T20:56:56+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/21670.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/21670.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/21670.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7528curl\u548cpython\u901a\u8fc7\u7f51\u7edc\u6d4b\u8bd5Ollama\u670d\u52a1\u5668\u7684\u914d\u7f6e\u548c\u72b6\u6001"}]},{"@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\/21670","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=21670"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/21670\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/21669"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=21670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=21670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=21670"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=21670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}