浏览代码

Merge branch 'master' into gemini

alexchenzl 5 月之前
父节点
当前提交
91a4ee5b36
共有 2 个文件被更改,包括 35 次插入2 次删除
  1. 33 0
      README.md
  2. 2 2
      pages/options/src/components/ModelSettings.tsx

+ 33 - 0
README.md

@@ -66,6 +66,39 @@ Looking for a powerful AI web agent without the $200/month price tag of OpenAI O
     *   Add your LLM API keys.
     *   Choose which model to use for different agents (Navigator, Planner, Validator)
 
+## 🛠️ Build from Source
+
+If you prefer to build Nanobrowser yourself, follow these steps:
+
+1. **Prerequisites**:
+   * [Node.js](https://nodejs.org/) (v22.12.0 or higher)
+   * [pnpm](https://pnpm.io/installation) (v9.15.1 or higher)
+
+2. **Clone the Repository**:
+   ```bash
+   git clone https://github.com/nanobrowser/nanobrowser.git
+   cd nanobrowser
+   ```
+
+3. **Install Dependencies**:
+   ```bash
+   pnpm install
+   ```
+
+4. **Build the Extension**:
+   ```bash
+   pnpm build
+   ```
+
+5. **Load the Extension**:
+   * The built extension will be in the `dist` directory
+   * Follow the installation steps from the Quick Start section to load the extension into your browser
+
+6. **Development Mode** (optional):
+   ```bash
+   pnpm dev
+   ```
+
 ## 💡 See It In Action
 
 Here are some powerful tasks you can accomplish with just a sentence:

+ 2 - 2
pages/options/src/components/ModelSettings.tsx

@@ -75,8 +75,8 @@ export const ModelSettings = () => {
     setApiKeys(prev => ({
       ...prev,
       [provider]: {
-        apiKey,
-        baseUrl: baseUrl !== undefined ? baseUrl : prev[provider]?.baseUrl,
+        apiKey: apiKey.trim(),
+        baseUrl: baseUrl !== undefined ? baseUrl.trim() : prev[provider]?.baseUrl,
       },
     }));
   };