mirror of
https://github.com/open-webui/docs
synced 2025-06-14 02:20:34 +00:00
Update index.mdx
This commit is contained in:
parent
d8c4cd4da1
commit
36e5db0572
@ -25,8 +25,19 @@ Here’s an overview of what changed:
|
|||||||
2. **Main app structure simplified.**
|
2. **Main app structure simplified.**
|
||||||
- The old `open_webui.apps.webui` has been transformed into `open_webui.main`, making it the central entry point for the project.
|
- The old `open_webui.apps.webui` has been transformed into `open_webui.main`, making it the central entry point for the project.
|
||||||
|
|
||||||
3. **Unified API Endpoint.**
|
3. **Unified API Endpoint**
|
||||||
- Instead of separate functions for models like `ollama` and `openai`, we now offer a **unified function** (`chat_completion`) in `open_webui.main` for a consistent API experience.
|
- Open WebUI 0.5 introduces a **unified function**, `chat_completion`, in `open_webui.main`, replacing separate functions for models like `ollama` and `openai`. This offers a consistent and streamlined API experience. However, the **direct successor** of these individual functions is `generate_chat_completion` from `open_webui.utils.chat`. If you prefer a lightweight POST request without handling additional parsing (e.g., files, tools, or misc), this utility function is likely what you want.
|
||||||
|
|
||||||
|
#### Example:
|
||||||
|
```python
|
||||||
|
# Full API flow with parsing (new function):
|
||||||
|
from open_webui.main import chat_completion
|
||||||
|
|
||||||
|
# Lightweight, direct POST request (direct successor):
|
||||||
|
from open_webui.utils.chat import generate_chat_completion
|
||||||
|
```
|
||||||
|
|
||||||
|
Choose the approach that best fits your use case!
|
||||||
|
|
||||||
4. **Updated Function Signatures.**
|
4. **Updated Function Signatures.**
|
||||||
- Function signatures now adhere to a new format, requiring a `request` object.
|
- Function signatures now adhere to a new format, requiring a `request` object.
|
||||||
|
Loading…
Reference in New Issue
Block a user