diff --git a/docs/features/plugin/migration/index.mdx b/docs/features/plugin/migration/index.mdx index 8499935..60b932a 100644 --- a/docs/features/plugin/migration/index.mdx +++ b/docs/features/plugin/migration/index.mdx @@ -123,6 +123,7 @@ Depending on your use case, you can choose between: 2. **`open_webui.utils.chat.generate_chat_completion`:** - Directly makes a POST request without handling extra parsing or tasks. + - This is the **direct successor** to the previous `ollama.generate_chat_completion` and `openai.generate_chat_completion` functions in Open WebUI 0.4. - Best for simplified and more lightweight scenarios. #### Example: @@ -136,14 +137,18 @@ from open_webui.utils.chat import generate_chat_completion --- -### 📋 3. Adapting to Updated Function Signatures +### 📋 3. Adapting to Updated Function Signatures -We’ve updated the **function signatures** to better fit the new architecture. +We’ve updated the **function signatures** to better fit the new architecture. If you're looking for a direct replacement, start with the lightweight utility function `generate_chat_completion` from `open_webui.utils.chat`. For the full API flow, use the new unified `chat_completion` function in `open_webui.main`. -#### Function Signature Changes: -| **Old** | **New** | -|-----------------------------------------|-----------------------------------------| -| `openai.generate_chat_completion(form_data: dict, user: UserModel)` | `chat_completion(request: Request, form_data: dict, user: UserModel)` | +#### Function Signature Changes: + +| **Old** | **Direct Successor (New)** | **Unified Option (New)** | +|-----------------------------------------|-----------------------------------------|-----------------------------------------| +| `openai.generate_chat_completion(form_data: dict, user: UserModel)` | `generate_chat_completion(request: Request, form_data: dict, user: UserModel)` | `chat_completion(request: Request, form_data: dict, user: UserModel)` | + +- **Direct Successor (`generate_chat_completion`)**: A lightweight, 1:1 replacement for previous `ollama`/`openai` methods. +- **Unified Option (`chat_completion`)**: Use this for the complete API flow, including file parsing and additional functionality. #### Example: