mirror of
https://github.com/open-webui/docs
synced 2025-05-19 18:58:41 +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>
|
<details>
|
||||||
<summary>Example</summary>
|
<summary>Example</summary>
|
||||||
|
|
||||||
```
|
```python
|
||||||
async def action(
|
async def action(
|
||||||
self,
|
self,
|
||||||
body: dict,
|
body: dict,
|
||||||
|
@ -177,10 +177,10 @@ def stream(self, event: dict) -> dict:
|
|||||||
```
|
```
|
||||||
|
|
||||||
> **Example Streamed Events:**
|
> **Example Streamed Events:**
|
||||||
```json
|
```jsonl
|
||||||
{'id': 'chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb','choices': [{'delta': {'content': 'Hi'}}]}
|
{"id": "chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb","choices": [{"delta": {"content": "Hi"}}]}
|
||||||
{'id': 'chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb','choices': [{'delta': {'content': '!'}}]}
|
{"id": "chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb","choices": [{"delta": {"content": "!"}}]}
|
||||||
{'id': 'chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb','choices': [{'delta': {'content': ' 😊'}}]}
|
{"id": "chatcmpl-B4l99MMaP3QLGU5uV7BaBM0eDS0jb","choices": [{"delta": {"content": " 😊"}}]}
|
||||||
```
|
```
|
||||||
📖 **What Happens?**
|
📖 **What Happens?**
|
||||||
- Each line represents a **small fragment** of the model's streamed response.
|
- 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:
|
- 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(
|
self.valves = self.Valves(
|
||||||
**{
|
**{
|
||||||
"LLAMAINDEX_OLLAMA_BASE_URL": os.getenv("LLAMAINDEX_OLLAMA_BASE_URL", "http://localhost:11434"),
|
"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.
|
- 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 Pipeline:
|
||||||
class Valves(BaseModel):
|
class Valves(BaseModel):
|
||||||
target_user_roles: List[str] = ["user"]
|
target_user_roles: List[str] = ["user"]
|
||||||
|
Loading…
Reference in New Issue
Block a user