Merge pull request #318 from K-tang-mkv/tx_dev

feat: improve input handling
This commit is contained in:
mannaandpoem 2025-03-09 13:40:24 +08:00 committed by GitHub
commit abb2516bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 72 additions and 3 deletions

View File

@ -22,6 +22,10 @@ We're also excited to introduce [OpenManus-RL](https://github.com/OpenManus/Open
## 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:
```bash
@ -42,6 +46,36 @@ cd OpenManus
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
OpenManus requires configuration for the LLM APIs it uses. Follow these steps to set up your configuration:

View File

@ -22,6 +22,10 @@ Manus 非常棒,但 OpenManus 无需邀请码即可实现任何创意 🛫!
## 安装指南
我们提供两种安装方式。推荐使用方式二uv因为它能提供更快的安装速度和更好的依赖管理。
### 方式一:使用 conda
1. 创建新的 conda 环境:
```bash
@ -42,6 +46,36 @@ cd OpenManus
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请按以下步骤设置

View File

@ -8,11 +8,12 @@ async def main():
agent = Manus()
while True:
try:
prompt = input("Enter your prompt (or 'exit' to quit): ")
if prompt.lower() == "exit":
prompt = input("Enter your prompt (or 'exit'/'quit' to quit): ")
prompt_lower = prompt.lower()
if prompt_lower in ["exit", "quit"]:
logger.info("Goodbye!")
break
if prompt.strip().isspace():
if not prompt.strip():
logger.warning("Skipping empty prompt.")
continue
logger.warning("Processing your request...")