Merge pull request #318 from K-tang-mkv/tx_dev
feat: improve input handling
This commit is contained in:
commit
abb2516bc3
34
README.md
34
README.md
@ -22,6 +22,10 @@ We're also excited to introduce [OpenManus-RL](https://github.com/OpenManus/Open
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
We provide two installation methods. Method 2 (using uv) is recommended for faster installation and better dependency management.
|
||||||
|
|
||||||
|
### Method 1: Using conda
|
||||||
|
|
||||||
1. Create a new conda environment:
|
1. Create a new conda environment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -42,6 +46,36 @@ cd OpenManus
|
|||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Method 2: Using uv (Recommended)
|
||||||
|
|
||||||
|
1. Install uv (A fast Python package installer and resolver):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Clone the repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/mannaandpoem/OpenManus.git
|
||||||
|
cd OpenManus
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Create a new virtual environment and activate it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv venv
|
||||||
|
source .venv/bin/activate # On Unix/macOS
|
||||||
|
# Or on Windows:
|
||||||
|
# .venv\Scripts\activate
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Install dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
OpenManus requires configuration for the LLM APIs it uses. Follow these steps to set up your configuration:
|
OpenManus requires configuration for the LLM APIs it uses. Follow these steps to set up your configuration:
|
||||||
|
34
README_zh.md
34
README_zh.md
@ -22,6 +22,10 @@ Manus 非常棒,但 OpenManus 无需邀请码即可实现任何创意 🛫!
|
|||||||
|
|
||||||
## 安装指南
|
## 安装指南
|
||||||
|
|
||||||
|
我们提供两种安装方式。推荐使用方式二(uv),因为它能提供更快的安装速度和更好的依赖管理。
|
||||||
|
|
||||||
|
### 方式一:使用 conda
|
||||||
|
|
||||||
1. 创建新的 conda 环境:
|
1. 创建新的 conda 环境:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -42,6 +46,36 @@ cd OpenManus
|
|||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 方式二:使用 uv(推荐)
|
||||||
|
|
||||||
|
1. 安装 uv(一个快速的 Python 包管理器):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 克隆仓库:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/mannaandpoem/OpenManus.git
|
||||||
|
cd OpenManus
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 创建并激活虚拟环境:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv venv
|
||||||
|
source .venv/bin/activate # Unix/macOS 系统
|
||||||
|
# Windows 系统使用:
|
||||||
|
# .venv\Scripts\activate
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 安装依赖:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
## 配置说明
|
## 配置说明
|
||||||
|
|
||||||
OpenManus 需要配置使用的 LLM API,请按以下步骤设置:
|
OpenManus 需要配置使用的 LLM API,请按以下步骤设置:
|
||||||
|
7
main.py
7
main.py
@ -8,11 +8,12 @@ async def main():
|
|||||||
agent = Manus()
|
agent = Manus()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
prompt = input("Enter your prompt (or 'exit' to quit): ")
|
prompt = input("Enter your prompt (or 'exit'/'quit' to quit): ")
|
||||||
if prompt.lower() == "exit":
|
prompt_lower = prompt.lower()
|
||||||
|
if prompt_lower in ["exit", "quit"]:
|
||||||
logger.info("Goodbye!")
|
logger.info("Goodbye!")
|
||||||
break
|
break
|
||||||
if prompt.strip().isspace():
|
if not prompt.strip():
|
||||||
logger.warning("Skipping empty prompt.")
|
logger.warning("Skipping empty prompt.")
|
||||||
continue
|
continue
|
||||||
logger.warning("Processing your request...")
|
logger.warning("Processing your request...")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user