Openweb UI is very great although I know it is still under development.
I encountered an issue (I'm not sure if it a bug or not) in using the Action Function. Can anyone can help to solve my issue?
Thank you.
Description
Bug Summary:
When I tried to use the "Action", it doesn't work. There is a javascript error shown on chrome console.
Threw an error "Ie.messages is not iterable" in Chat.svelte. See my screenshots below.
The javascript object is a empty object. I guess (I traced the code) it is because that web api call gave a empty object.
Operating System: Window 11 (But I run on WSL2 on docker cgroup2)
Browser (if applicable): 131.0.6778.205
Confirmation:
[v ] I have read and followed all the instructions provided in the README.md.
[v ] I am on the latest version of both Open WebUI and Ollama.
[v ] I have included the browser console logs.
[v] I have included the Docker container logs.
[v ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
Expected Behavior:
I expected there is something (e.g. status shown) changed on the user interface after clicking the "Action" click on the dialog. besides, there should be an new message added into the dialog.
Actual Behavior:
There is no effect on user interface and there is javascript error.
Throw error "Ie.messages is not iterable" in Chat.svelte.
Reproduction Details
Steps to Reproduce:
Create a Function "Action"
"""
title: Example Action
author: open-webui
author_url: https://github.com/open-webui
funding_url: https://github.com/open-webui
version: 0.1.0
required_open_webui_version: 0.3.9
"""frompydanticimportBaseModel,FieldfromtypingimportOptional,Union,Generator,IteratorimportosimportrequestsimportasyncioclassAction:classValves(BaseModel):passdef__init__(self):self.valves=self.Valves()passasyncdefaction(self,body:dict,__user__=None,__event_emitter__=None,__event_call__=None,)->Optional[dict]:print(f"action:{__name__}")# response = await __event_call__(# {# "type": "input",# "data": {# "title": "write a message",# "message": "here write a message to append",# "placeholder": "enter your message",# },# }# )# print(response)if__event_emitter__:await__event_emitter__({"type":"status","data":{"description":"adding message","done":False},})awaitasyncio.sleep(1)await__event_emitter__({"type":"message","data":{"content":"Testing message here"}})await__event_emitter__({"type":"status","data":{"description":"added message","done":True},})
Enable the Action for the Model
Click the "Action"'s button in a message on the conversation dialog
You will find there is no effect and there is javascript error
Originally created by @thfai2000 on GitHub (Dec 30, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8202
# Bug Report
Openweb UI is very great although I know it is still under development.
I encountered an issue (I'm not sure if it a bug or not) in using the Action Function. Can anyone can help to solve my issue?
Thank you.
## Description
**Bug Summary:**
When I tried to use the "Action", it doesn't work. There is a javascript error shown on chrome console.

Threw an error "Ie.messages is not iterable" in Chat.svelte. See my screenshots below.
The javascript object is a empty object. I guess (I traced the code) it is because that web api call gave a empty object.

## Installation Method
Start using docker
```bash
docker compose up
```
```
#docker-compose.yaml
services:
ollama:
volumes:
- ollama:/root/.ollama
container_name: ollama
pull_policy: always
tty: true
restart: unless-stopped
image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
deploy:
resources:
reservations:
devices:
- driver: ${OLLAMA_GPU_DRIVER-nvidia}
count: ${OLLAMA_GPU_COUNT-1}
capabilities:
- gpu
open-webui:
build:
context: .
args:
OLLAMA_BASE_URL: '/ollama'
dockerfile: Dockerfile
image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
container_name: open-webui
volumes:
- open-webui:/app/backend/data
depends_on:
- ollama
ports:
- ${OPEN_WEBUI_PORT-3000}:8080
environment:
- 'OLLAMA_BASE_URL=http://ollama:11434'
- 'WEBUI_SECRET_KEY='
extra_hosts:
- host.docker.internal:host-gateway
restart: unless-stopped
privileged: true
volumes:
ollama: {}
open-webui: {}
```
## Environment
- **Open WebUI Version:** v0.5.2
- **Ollama (if applicable):** 0.5.4-0-g2ddc32d-dirty
- **Operating System:** Window 11 (But I run on WSL2 on docker cgroup2)
- **Browser (if applicable):** 131.0.6778.205
**Confirmation:**
- [v ] I have read and followed all the instructions provided in the README.md.
- [v ] I am on the latest version of both Open WebUI and Ollama.
- [v ] I have included the browser console logs.
- [v] I have included the Docker container logs.
- [v ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
## Expected Behavior:
I expected there is something (e.g. status shown) changed on the user interface after clicking the "Action" click on the dialog. besides, there should be an new message added into the dialog.

## Actual Behavior:
There is no effect on user interface and there is javascript error.
Throw error "Ie.messages is not iterable" in Chat.svelte.
## Reproduction Details
**Steps to Reproduce:**
1. Create a Function "Action"
```python
"""
title: Example Action
author: open-webui
author_url: https://github.com/open-webui
funding_url: https://github.com/open-webui
version: 0.1.0
required_open_webui_version: 0.3.9
"""
from pydantic import BaseModel, Field
from typing import Optional, Union, Generator, Iterator
import os
import requests
import asyncio
class Action:
class Valves(BaseModel):
pass
def __init__(self):
self.valves = self.Valves()
pass
async def action(
self,
body: dict,
__user__=None,
__event_emitter__=None,
__event_call__=None,
) -> Optional[dict]:
print(f"action:{__name__}")
# response = await __event_call__(
# {
# "type": "input",
# "data": {
# "title": "write a message",
# "message": "here write a message to append",
# "placeholder": "enter your message",
# },
# }
# )
# print(response)
if __event_emitter__:
await __event_emitter__(
{
"type": "status",
"data": {"description": "adding message", "done": False},
}
)
await asyncio.sleep(1)
await __event_emitter__(
{"type": "message", "data": {"content": "Testing message here"}}
)
await __event_emitter__(
{
"type": "status",
"data": {"description": "added message", "done": True},
}
)
```
2. Enable the Action for the Model

3. Click the "Action"'s button in a message on the conversation dialog
4. You will find there is no effect and there is javascript error
## Logs and Screenshots
**Browser Console Logs:**




**Docker Container Logs:**

**Screenshots/Screen Recordings (if applicable):**
## Additional Information
n/a
## Note
n/a
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @thfai2000 on GitHub (Dec 30, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8202
Bug Report
Openweb UI is very great although I know it is still under development.
I encountered an issue (I'm not sure if it a bug or not) in using the Action Function. Can anyone can help to solve my issue?
Thank you.
Description
Bug Summary:

When I tried to use the "Action", it doesn't work. There is a javascript error shown on chrome console.
Threw an error "Ie.messages is not iterable" in Chat.svelte. See my screenshots below.

The javascript object is a empty object. I guess (I traced the code) it is because that web api call gave a empty object.
Installation Method
Start using docker
Environment
Open WebUI Version: v0.5.2
Ollama (if applicable): 0.5.4-0-g2ddc32d-dirty
Operating System: Window 11 (But I run on WSL2 on docker cgroup2)
Browser (if applicable): 131.0.6778.205
Confirmation:
Expected Behavior:
I expected there is something (e.g. status shown) changed on the user interface after clicking the "Action" click on the dialog. besides, there should be an new message added into the dialog.

Actual Behavior:
There is no effect on user interface and there is javascript error.
Throw error "Ie.messages is not iterable" in Chat.svelte.
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
Browser Console Logs:
Docker Container Logs:

Screenshots/Screen Recordings (if applicable):
Additional Information
n/a
Note
n/a
@tjbck commented on GitHub (Dec 30, 2024):
Fixed on dev.