与AI共生20250326:想建构自己的MCP服务
I: 你好,我在本地离线部署了一些人工智能大模型,用我电脑上的显卡运行,使用ollama作为启动工具,可以通过API调用在自己写的应用程序中与这些大模型进行交互。现在我想在本地电脑上离线(也可以访问网络)构建自己 MCP服务,以自动化操纵指定的网站为例子:我的想法是,先向本地大模型提供要操纵的网页的内容(实时的html源内容),要求本地大模型提供一个可以执行的javascript或者python脚本文件代码,用于操纵这个网页指定的部分(比如抓取主要内容),如果执行这一步之后,网页内容又有了新的变化 ,又提供新的实时Html源代码给大模型,要求继续完成后续操作。我的设想的主要部分在于:让本地大模型写出调用Playwright库的js代码脚本或python代码脚本,我也不清楚,Playwright库是否用js可用的库以上是我的初步设想,没有经过验证,或者你有更好的想法? Gemini2.0Flash: 你的想法很有意思,可行性较高,并且结合了本地大模型和 Playwright 的优势,可以在一定程度上实现自动化网页操作。下面我将分析你的设想,提出一些建议和补充,并探讨更好的方法: 对...
与AI共生20250326:想建构自己的MCP服务
I: 你好,我在本地离线部署了一些人工智能大模型,用我电脑上的显卡运行,使用ollama作为启动工具,可以通过API调用在自己写的应用程序中与这些大模型进行交互。现在我想在本地电脑上离线(也可以访问网络)构建自己 MCP服务,以自动化操纵指定的网站为例子:我的想法是,先向本地大模型提供要操纵的网页的内容(实时的html源内容),要求本地大模型提供一个可以执行的javascript或者python脚本文件代码,用于操纵这个网页指定的部分(比如抓取主要内容),如果执行这一步之后,网页内容又有了新的变化 ,又提供新的实时Html源代码给大模型,要求继续完成后续操作。我的设想的主要部分在于:让本地大模型写出调用Playwright库的js代码脚本或python代码脚本,我也不清楚,Playwright库是否用js可用的库以上是我的初步设想,没有经过验证,或者你有更好的想法? Gemini2.0Flash: 你的想法很有意思,可行性较高,并且结合了本地大模型和 Playwright 的优势,可以在一定程度上实现自动化网页操作。下面我将分析你的设想,提出一些建议和补充,并探讨更好的方法: 对...

Forest
As the sun sinks below the horizon, dusk settles over the forest. Sparse moonlight filters through the trees, casting a mottled silver glow on the ground. A gentle breeze blows by, rustling the leaves with a serene melody. Occasional bird calls ring out clearly in the stillness. The forest creatures gradually settle in for the night, with only the drone of insects continuing unabated. Walking along the forest path, surrounded by dark tranquility, one feels a sense of mystery and comfort. Look...

Forest
As the sun sinks below the horizon, dusk settles over the forest. Sparse moonlight filters through the trees, casting a mottled silver glow on the ground. A gentle breeze blows by, rustling the leaves with a serene melody. Occasional bird calls ring out clearly in the stillness. The forest creatures gradually settle in for the night, with only the drone of insects continuing unabated. Walking along the forest path, surrounded by dark tranquility, one feels a sense of mystery and comfort. Look...