diff --git a/docs/features/plugin/functions/action.mdx b/docs/features/plugin/functions/action.mdx index e276763..67fc828 100644 --- a/docs/features/plugin/functions/action.mdx +++ b/docs/features/plugin/functions/action.mdx @@ -27,7 +27,7 @@ Actions have a single main component called an action function. This component t
Example -``` +```python async def action( self, body: dict, diff --git a/docs/features/plugin/functions/filter.mdx b/docs/features/plugin/functions/filter.mdx index 15e48a3..21e1356 100644 --- a/docs/features/plugin/functions/filter.mdx +++ b/docs/features/plugin/functions/filter.mdx @@ -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. @@ -289,4 +289,4 @@ By now, you’ve learned: 🚀 **Your Turn**: Start experimenting! What small tweak or context addition could elevate your Open WebUI experience? Filters are fun to build, flexible to use, and can take your models to the next level! -Happy coding! ✨ \ No newline at end of file +Happy coding! ✨ diff --git a/docs/pipelines/valves.md b/docs/pipelines/valves.md index de4bbc4..eff3229 100644 --- a/docs/pipelines/valves.md +++ b/docs/pipelines/valves.md @@ -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"]