mirror of
https://github.com/open-webui/docs
synced 2025-05-19 10:52:14 +00:00
fix: more missing syntax colouring
Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com>
This commit is contained in:
parent
ff0419d9ab
commit
0ff06a7912
@ -27,7 +27,7 @@ Actions have a single main component called an action function. This component t
|
||||
<details>
|
||||
<summary>Example</summary>
|
||||
|
||||
```
|
||||
```python
|
||||
async def action(
|
||||
self,
|
||||
body: dict,
|
||||
|
@ -177,10 +177,10 @@ def stream(self, event: dict) -> dict:
|
||||
```
|
||||
|
||||
> **Example Streamed Events:**
|
||||
```json
|
||||
{'id': 'chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb','choices': [{'delta': {'content': 'Hi'}}]}
|
||||
{'id': 'chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb','choices': [{'delta': {'content': '!'}}]}
|
||||
{'id': 'chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb','choices': [{'delta': {'content': ' 😊'}}]}
|
||||
```jsonl
|
||||
{"id": "chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb","choices": [{"delta": {"content": "Hi"}}]}
|
||||
{"id": "chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb","choices": [{"delta": {"content": "!"}}]}
|
||||
{"id": "chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb","choices": [{"delta": {"content": " 😊"}}]}
|
||||
```
|
||||
📖 **What Happens?**
|
||||
- Each line represents a **small fragment** of the model's streamed response.
|
||||
|
@ -13,7 +13,7 @@ When adding valves to your pipeline, include a way to ensure that valves can be
|
||||
|
||||
- Use `os.getenv()` to set an environment variable to use for the pipeline, and a default value to use if the environment variable isn't set. An example can be seen below:
|
||||
|
||||
```
|
||||
```python
|
||||
self.valves = self.Valves(
|
||||
**{
|
||||
"LLAMAINDEX_OLLAMA_BASE_URL": os.getenv("LLAMAINDEX_OLLAMA_BASE_URL", "http://localhost:11434"),
|
||||
@ -25,7 +25,7 @@ self.valves = self.Valves(
|
||||
|
||||
- Set the valve to the `Optional` type, which will allow the pipeline to load even if no value is set for the valve.
|
||||
|
||||
```
|
||||
```python
|
||||
class Pipeline:
|
||||
class Valves(BaseModel):
|
||||
target_user_roles: List[str] = ["user"]
|
||||
|
Loading…
Reference in New Issue
Block a user