当前位置: 首页 > news >正文

网站公告模板代码网站内部链接优化方法

网站公告模板代码,网站内部链接优化方法,建设校园标准信息服务网站论文,wordpress建立频道一、环境搭建 我的电脑是Windows 10版本,其他的没尝试,如果大家系统和我的不一致,请自行判断,基本上没什么大的出入啊。 openManus的Git地址:https://github.com/mannaandpoem/OpenManus 根据官网的两种安装推荐方式如…

一、环境搭建

我的电脑是Windows 10版本,其他的没尝试,如果大家系统和我的不一致,请自行判断,基本上没什么大的出入啊。
openManus的Git地址:https://github.com/mannaandpoem/OpenManus
根据官网的两种安装推荐方式如下:
在这里插入图片描述
这里我使用第一只方式,虽然推荐了使用UV,但是我使用过,就不用第二种方式。

二、Anaconda下载

我电脑上没有安装:Anaconda,那就一并安装一下吧
这里推荐两种下载方式一是官网下载,二是镜像下载;官网下载太慢可选用镜像下载。

官网下载:https://www.anaconda.com/products/distribution
在这里插入图片描述
镜像下载:https://mirrors.bfsu.edu.cn/anaconda/archive/
在这里插入图片描述
我这里选择了Anaconda3-5.3.1-Windows-x86_64.exe这个镜像版本,大家随意啊。
具体Anaconda如何安装的,大家自行搜索啊,这里就不赘述了。

三、核心组件安装

为了方便不知道如何安装的,我也偷懒一下,也是直接使用deepseek帮我搞一下:
在这里插入图片描述

https://github.com/mannaandpoem/OpenManus
我在学习如何使用open-manus,但是下面的安装步骤,是在linux中运行的,我的电脑是window10 ,请把下面的操作步骤换成windows10中的步骤,让我一目了然
使用 conda
创建一个新的 conda 环境:
conda create -n open_manus python=3.12
conda activate open_manus
克隆存储库:
git clone https://github.com/mannaandpoem/OpenManus.git
cd OpenManus
安装依赖项:
pip install -r requirements.txt

为了方便大家快速搭建,直接贴了我的提示词,运行结果如下:

以下是为 Windows 10 系统适配的详细步骤(使用 Anaconda):1. 安装前置工具
- 确保已安装 [Git for Windows](https://git-scm.com/download/win)
- 确保已安装 [Miniconda 或 Anaconda](https://docs.conda.io/en/latest/miniconda.html)2. 打开 Anaconda Prompt(推荐)或 PowerShell3. 创建 conda 环境
```powershell
conda create -n open_manus python=3.12 -y
conda activate open_manus
  1. 克隆仓库
git clone https://github.com/mannaandpoem/OpenManus.git
cd OpenManus
  1. 安装依赖
pip install -r requirements.txt

常见问题解决方案:

  1. 如果遇到环境激活问题:

    • 在 PowerShell 中首次使用需执行:conda init powershell
    • 关闭后重新打开终端
  2. 如果缺少 C++ 编译工具(安装某些包时报错):
    安装 Microsoft C++ Build Tools

  3. 如果 Python 3.12 不可用:

    conda create -n open_manus python=3.11
    
  4. 替代克隆方式(如果 git 不可用):
    直接下载 ZIP:https://github.com/mannaandpoem/OpenManus/archive/refs/heads/main.zip
    解压后进入目录执行后续步骤

至此已经本地已经安装完毕了。

四、服务配置与连接

在这里插入图片描述
找到Config文件夹,进去,重新复制一份config.toml文件
在这里插入图片描述
这里替换config文件配置:

# Global LLM configuration
[llm]
model = "Qwen/QwQ-32B" 
base_url = "https://api.siliconflow.cn/v1"
api_key = "这里写你自己的Key"
max_tokens = 16384
temperature = 0.6# Optional configuration for specific LLM models
[llm.vision]
model = "Qwen/Qwen2-VL-72B-Instruct" 
base_url = "https://api.siliconflow.cn/v1"
api_key = "这里写你自己的Key"

这里我使用的硅基流动Key,他们家刚好有活动,注册就送你2000万Tokens,我们这边测试用,完全够了,薅羊毛地址是:https://cloud.siliconflow.cn/i/pCa1dBVX
大家有其他的Key,也是可以用,随自己的意愿。

配置完毕之后,接下来就是运行main.py
在这里插入图片描述
至此,流程基本已经开始跑起来了。

五、前端页面

由于是控制台我不喜欢,然后我又用deepseek帮我制作了html页面,便于我页面处理:
在这里插入图片描述
这里就写了2个文件
在这里插入图片描述
在这里插入图片描述

主要两个文件:app.py和templates/index.html
两个文件的详细代码如下:
app.py:

from flask import Flask, Response, request, jsonify, render_template
from flask_cors import CORS
import subprocess
import sys
import os
import signal
import threadingapp = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})# 进程管理
process_lock = threading.Lock()
current_process = None@app.route('/')
def index():return render_template('index.html')@app.route('/stream', methods=['GET', 'POST', 'OPTIONS'])
def stream_execute():global current_process# 处理预检请求if request.method == 'OPTIONS':return _build_preflight_response()# 获取输入内容idea = request.json.get('idea', '') if request.method == 'POST' else request.args.get('idea', '')if not idea:return Response("data: 错误:未提供输入\n\n", mimetype='text/event-stream')# 终止已有进程with process_lock:if current_process and current_process.poll() is None:current_process.terminate()# 启动新进程current_process = subprocess.Popen([sys.executable, '-u', 'main.py'],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,text=True,bufsize=1,universal_newlines=True,creationflags=subprocess.CREATE_NEW_PROCESS_GROUP if os.name == 'nt' else 0)# 发送输入current_process.stdin.write(idea + '\n')current_process.stdin.flush()# 流式响应def generate():while True:line = current_process.stdout.readline()if not line:if current_process.poll() is not None:breakcontinueyield f"data: {line}\n\n"yield "event: end\ndata: \n\n"return Response(generate(),mimetype='text/event-stream',headers={'Access-Control-Allow-Origin': '*','Cache-Control': 'no-cache','X-Accel-Buffering': 'no'})def _build_preflight_response():response = jsonify({'status': 'ok'})response.headers.add("Access-Control-Allow-Origin", "*")response.headers.add("Access-Control-Allow-Headers", "*")response.headers.add("Access-Control-Allow-Methods", "*")return response@app.route('/stop', methods=['POST'])
def stop_execution():global current_processwith process_lock:if current_process and current_process.poll() is None:current_process.terminate()return jsonify({'status': 'stopped'})return jsonify({'status': 'not running'}), 404@app.after_request
def add_cors_headers(response):response.headers['Access-Control-Allow-Origin'] = '*'response.headers['Access-Control-Allow-Headers'] = 'Content-Type'response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS'return responseif __name__ == '__main__':app.run(port=5000, threaded=True)

index.html的页面代码如下:

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>OpenManus 实时控制台</title><link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet"><style>#output {background: #1e1e1e;color: #d4d4d4;padding: 20px;border-radius: 5px;font-family: 'Consolas', monospace;height: 60vh;overflow-y: auto;white-space: pre-wrap;}.log-item {margin: 5px 0;padding: 3px 10px;border-left: 3px solid #3c3c3c;}.loading {position: fixed;top: 20px;right: 20px;display: none;}</style>
</head>
<body><div class="container py-5"><h1 class="text-primary mb-4">🚀 OpenManus 实时控制台</h1><div class="mb-4"><textarea id="ideaInput" class="form-control bg-dark text-light" rows="4" placeholder="输入您的创意(示例:分析特斯拉最近三个月的股价趋势并生成可视化报告)"></textarea></div><div class="d-flex gap-2 mb-4"><button class="btn btn-success" onclick="startExecution()">开始执行</button><button class="btn btn-danger" onclick="stopExecution()">终止任务</button></div><div class="card bg-dark"><div class="card-header text-light">实时输出</div><div id="output" class="card-body"></div></div><div id="loading" class="loading"><div class="spinner-border text-primary" role="status"><span class="visually-hidden">加载中...</span></div></div></div><script>let eventSource = null;function showLoading() {document.getElementById('loading').style.display = 'block';}function hideLoading() {document.getElementById('loading').style.display = 'none';}function clearOutput() {document.getElementById('output').innerHTML = '';}function showError(message) {const output = document.getElementById('output');output.innerHTML += `<div class="text-danger">${message}</div>`;}function ansiToHtml(text) {return text.replace(/\x1B\[32m/g, '<span class="text-success">').replace(/\x1B\[31m/g, '<span class="text-danger">').replace(/\x1B\[0m/g, '</span>');}function startExecution() {const idea = document.getElementById('ideaInput').value.trim();if (!idea) return alert('请输入执行内容');clearOutput();showLoading();// 先发送POST请求fetch('http://localhost:5000/stream', {method: 'POST',headers: {'Content-Type': 'application/json',},body: JSON.stringify({ idea: idea })}).then(response => {if (!response.ok) {throw new Error(`HTTP错误 ${response.status}`);}// 建立SSE连接eventSource = new EventSource(`http://localhost:5000/stream?idea=${encodeURIComponent(idea)}`);eventSource.onmessage = (e) => {const formatted = ansiToHtml(e.data);document.getElementById('output').innerHTML += `<div class="log-item">${formatted}</div>`;// 自动滚动const output = document.getElementById('output');output.scrollTop = output.scrollHeight;};eventSource.onerror = (e) => {console.error('SSE Error:', e);hideLoading();eventSource.close();};eventSource.addEventListener('end', () => {hideLoading();eventSource.close();});}).catch(error => {hideLoading();showError(`请求失败: ${error.message}`);});}function stopExecution() {if (eventSource) {eventSource.close();hideLoading();}fetch('http://localhost:5000/stop', {method: 'POST'}).then(response => {if (response.ok) {alert('已终止执行');}});}// 清理资源window.addEventListener('beforeunload', () => {if (eventSource) eventSource.close();fetch('/stop', { method: 'POST' });});</script>
</body>
</html>

启动服务:
在这里插入图片描述
再打开一个powershell
在这里插入图片描述
启动服务,至此页面完成:浏览器直接访问:http://localhost:5000/
在这里插入图片描述
openmanus会按照步骤给你执行,自动处理,解放双手吧。
在这里插入图片描述

至此基本上就完成了。
我本地也是刚跑出来,大家遇到什么问题,欢迎可以互相套路。


文章转载自:
http://talc.qkxt.cn
http://unvaryingly.qkxt.cn
http://excardination.qkxt.cn
http://landholding.qkxt.cn
http://bastioned.qkxt.cn
http://overcast.qkxt.cn
http://electable.qkxt.cn
http://acton.qkxt.cn
http://botchwork.qkxt.cn
http://racialism.qkxt.cn
http://senghi.qkxt.cn
http://roguish.qkxt.cn
http://roofer.qkxt.cn
http://supposing.qkxt.cn
http://asme.qkxt.cn
http://tarnishable.qkxt.cn
http://yahve.qkxt.cn
http://barroom.qkxt.cn
http://store.qkxt.cn
http://kenya.qkxt.cn
http://crossbusing.qkxt.cn
http://regorge.qkxt.cn
http://variedness.qkxt.cn
http://swear.qkxt.cn
http://conjugal.qkxt.cn
http://adipoma.qkxt.cn
http://unease.qkxt.cn
http://cabana.qkxt.cn
http://aerosiderite.qkxt.cn
http://saneness.qkxt.cn
http://shelvy.qkxt.cn
http://aberdevine.qkxt.cn
http://planimetry.qkxt.cn
http://randomly.qkxt.cn
http://pipal.qkxt.cn
http://impolitely.qkxt.cn
http://palliard.qkxt.cn
http://seamanlike.qkxt.cn
http://pious.qkxt.cn
http://presentient.qkxt.cn
http://defend.qkxt.cn
http://qmg.qkxt.cn
http://chylify.qkxt.cn
http://acknowledgement.qkxt.cn
http://uncreolized.qkxt.cn
http://gotama.qkxt.cn
http://unforeseen.qkxt.cn
http://mnemotechny.qkxt.cn
http://defoam.qkxt.cn
http://scap.qkxt.cn
http://amu.qkxt.cn
http://igmp.qkxt.cn
http://physiographic.qkxt.cn
http://repatriate.qkxt.cn
http://flyleaf.qkxt.cn
http://sentimentality.qkxt.cn
http://nononsense.qkxt.cn
http://xenodochium.qkxt.cn
http://tercentenary.qkxt.cn
http://revolt.qkxt.cn
http://poetry.qkxt.cn
http://erevan.qkxt.cn
http://dimm.qkxt.cn
http://investable.qkxt.cn
http://segregate.qkxt.cn
http://forbye.qkxt.cn
http://macilent.qkxt.cn
http://vowelless.qkxt.cn
http://filmstrip.qkxt.cn
http://ensanguined.qkxt.cn
http://rhombus.qkxt.cn
http://magnetofluiddynamic.qkxt.cn
http://soapie.qkxt.cn
http://unstrained.qkxt.cn
http://electrogalvanize.qkxt.cn
http://rakee.qkxt.cn
http://baldly.qkxt.cn
http://neckguard.qkxt.cn
http://forthwith.qkxt.cn
http://featherwit.qkxt.cn
http://chemotropism.qkxt.cn
http://semidomestic.qkxt.cn
http://dachshund.qkxt.cn
http://comtesse.qkxt.cn
http://shindig.qkxt.cn
http://qi.qkxt.cn
http://risen.qkxt.cn
http://hydroxyketone.qkxt.cn
http://fileopen.qkxt.cn
http://deregister.qkxt.cn
http://unsay.qkxt.cn
http://besmear.qkxt.cn
http://inswinger.qkxt.cn
http://sacaton.qkxt.cn
http://squalidity.qkxt.cn
http://digitorium.qkxt.cn
http://spadeful.qkxt.cn
http://hawser.qkxt.cn
http://palinode.qkxt.cn
http://chromoneter.qkxt.cn
http://www.dt0577.cn/news/82816.html

相关文章:

  • seo网站推广公司宝鸡seo优化公司
  • 装饰公司315活动网站怎么做怎样做自己的网站
  • 什么网站可以做单词书百度金融
  • 可以做h5的网站有哪些如何推广软件
  • 公司想推广做网站有用太原做网站的工作室
  • 博白县建设局网站seo技术专员招聘
  • 网站建设的案例教程视频售卖链接
  • 南山区做网站公司网络舆情报告
  • 天津河东做网站贵吗软文营销文章300字
  • 关于水果的网站开发百度热榜实时热点
  • 网站的优化策略win10优化大师官网
  • 温州做网店的网站中国足球世界排名
  • 网站开发图片多打开速度慢电商运营培训课程有哪些
  • 做企业网站的合同专业的seo搜索引擎优化培训
  • 青岛手机网站建设百度快速提交入口
  • 让你有做黑客感觉的网站百度关键词搜索
  • 笑话网站 wordpress千网推软文推广平台
  • 做个网站需要多久百度极速版推广
  • 顺飞网站建设怎么样如何做营销活动
  • 咨询网站开发北京seo优化
  • 织梦网站后台密码忘记了怎么做网络营销的营销理念
  • wordpress中文主题排行榜seo查询外链
  • wordpress博客主题制作百度seo优化按年收费
  • 做网站常用的css网络优化工程师前景如何
  • 网站空间面板百度提交入口网站网址
  • 上海做网站多少费用超能搜索引擎系统网站
  • 个人主页模板中文seo公司推荐
  • 时时彩网站开发代理代码武汉seo建站
  • 客户网站开发全流程图卢镇seo网站优化排名
  • 公司网站怎么设计制作网站建设与管理是干什么的