### Use SimpleManus as a Documentation Assistant Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Examples of prompts to guide SimpleManus in generating various types of documentation, including technical guides, API docs, and user manuals. ```Text >>> 撰写技术文档,包括架构说明和使用指南 >>> 生成API文档和示例代码 >>> 创建用户手册和FAQ ``` -------------------------------- ### Start SimpleManus Web Server Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Commands to launch the SimpleManus web server, including options for specifying host, port, and enabling development mode with auto-reload. ```Bash # 基本启动(默认 127.0.0.1:8000) python start_web_server.py # 指定主机和端口 python start_web_server.py --host 0.0.0.0 --port 8080 # 开发模式(文件修改后自动重载) python start_web_server.py --reload ``` -------------------------------- ### Use SimpleManus as a Code Development Assistant Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Examples of prompts to guide SimpleManus in software development tasks, such as designing API structures, generating code, and writing tests. ```Text >>> 设计一个REST API的项目结构 >>> 生成基础代码框架和配置文件 >>> 编写单元测试和文档 ``` -------------------------------- ### Use SimpleManus as a Data Analysis Assistant Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Examples of prompts to guide SimpleManus in performing data analysis tasks, including trend identification, visualization, and predictive modeling. ```Text >>> 分析这个CSV文件,找出销售趋势和异常值 >>> 生成可视化图表并保存报告 >>> 建立预测模型评估下季度表现 ``` -------------------------------- ### Call SimpleManus API with OpenAI Python Client Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md An example showing how to use the official OpenAI Python client library to interact with the SimpleManus API, leveraging its OpenAI compatibility. ```Python from openai import OpenAI # 使用OpenAI官方客户端库 client = OpenAI( api_key="not-needed", # SimpleManus不需要API密钥 base_url="http://localhost:8000/v1" ) response = client.chat.completions.create( model="simple-agent-v1", messages=[ {"role": "user", "content": "执行系统维护任务"} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Call SimpleManus API with cURL Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Examples demonstrating how to make non-streaming and streaming chat completion requests to the SimpleManus API using cURL commands. ```Bash # 非流式请求 curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "simple-agent-v1", "messages": [ {"role": "user", "content": "分析项目目录结构并生成报告"} ], "stream": false }' # 流式请求 curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "simple-agent-v1", "messages": [ {"role": "user", "content": "创建一个Python项目的基础结构"} ], "stream": true }' ``` -------------------------------- ### Call SimpleManus API with Python Requests Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md A Python example demonstrating how to interact with the SimpleManus chat completion API using the `requests` library for basic non-streaming calls. ```Python import requests # 基础客户端 def chat_with_agent(message: str): response = requests.post( "http://localhost:8000/v1/chat/completions", json={ "model": "simple-agent-v1", "messages": [{"role": "user", "content": message}], "stream": False } ) return response.json() # 示例使用 result = chat_with_agent("帮我整理这个文件夹的内容") print(result['choices'][0]['message']['content']) ``` -------------------------------- ### Deploy SimpleManus in Production Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Commands for deploying the SimpleManus web server in a production environment using `uvicorn` or `gunicorn` for robust performance. ```Bash # 使用 uvicorn 直接启动 uvicorn web_interface.server:app --host 0.0.0.0 --port 8000 --workers 4 # 或使用 gunicorn (需要安装) gunicorn web_interface.server:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 ``` -------------------------------- ### Manage Data with SketchPad Commands Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Demonstrates basic SketchPad commands for storing project configuration, tagging data, and searching for tagged items. ```Shell >>> /pad_store project_config {"name": "SimpleManus", "version": "1.0"} >>> /pad_tag project_config config,json,metadata >>> /pad_search config ``` -------------------------------- ### SimpleManus Frequently Asked Questions Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Answers to common questions regarding extending SimpleManus, including adding tools, modifying agent behavior, data storage, and LLM model configuration. ```APIDOC Q: How to add new tools? A: Refer to the existing tools in the 'tools/' directory, use the '@tool' decorator to create new tools, and then add them to the toolset in 'agent/global_agent.py'. Q: How to modify the agent's behavior? A: Edit the system prompt of the 'chat_impl' function in 'agent/BaseAgent.py'. Q: Where is SketchPad data stored? A: SketchPad data is stored in memory and supports persistence to the file system. Q: How to configure different LLM models? A: Modify the model configuration in 'config/config.py' and select different interfaces. ``` -------------------------------- ### SimpleManus Development Guidelines Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Guidelines for contributing to SimpleManus, covering coding standards, documentation, testing, and project updates. ```APIDOC Follow Python PEP 8 coding standards Add appropriate type annotations Write clear docstrings Add test cases for new features Update README documentation ``` -------------------------------- ### Deploy SimpleManus in Development Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Command for running the SimpleManus web server in a development environment with auto-reload enabled. ```Bash python start_web_server.py --reload --host 127.0.0.1 ``` -------------------------------- ### SimpleManus Web API Endpoints Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Overview of the HTTP API endpoints provided by SimpleManus, including basic server information, health checks, documentation links, and OpenAI-compatible chat completion endpoints. ```APIDOC Basic Endpoints: - GET / Server information - GET /health Health check - GET /docs Swagger API documentation - GET /redoc ReDoc API documentation OpenAI Compatible Endpoints: - GET /v1/models List available models - POST /v1/chat/completions Chat completion (supports streaming and non-streaming) ``` -------------------------------- ### SimpleManus Web API Features Source: https://github.com/nijingzhe/simplemanus/blob/master/README.md Key features of the SimpleManus Web API, including OpenAI compatibility, streaming output, CORS support, automatic documentation, and robust error handling. ```APIDOC OpenAI Compatible: Fully compatible with OpenAI Chat Completions API Streaming Output: Supports Server-Sent Events (SSE) streaming responses CORS Support: Allows cross-origin access for frontend integration Automatic Documentation: Automatically generates Swagger and ReDoc documentation Error Handling: Standardized error response format Health Check: Provides service status monitoring endpoint Singleton Management: Uses a global Agent singleton to ensure state consistency ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.