### What problem does this PR solve? Fix: can't upload image in ollama model #10447 ### Type of change - [X] Bug Fix (non-breaking change which fixes an issue) ### Change all `image=[]` to `image = None` Changing `image=[]` to `images=None` avoids Python’s mutable default parameter issue. If you keep `images=[]`, all calls share the same list, so modifying it (e.g., images.append()) will affect later calls. Using images=None and creating a new list inside the function ensures each call is independent. This change does not affect current behavior — it simply makes the code safer and more predictable. 把 `images=[]` 改成 `images=None` 是为了避免 Python 默认参数的可变对象问题。 如果保留 `images=[]`,所有调用都会共用同一个列表,一旦修改就会影响后续调用。 改成 None 并在函数内部重新创建列表,可以确保每次调用都是独立的。 这个修改不会影响现有运行结果,只是让代码更安全、更可控。 |
||
|---|---|---|
| .. | ||
| auth | ||
| sdk | ||
| __init__.py | ||
| api_app.py | ||
| canvas_app.py | ||
| chunk_app.py | ||
| conversation_app.py | ||
| dialog_app.py | ||
| document_app.py | ||
| file2document_app.py | ||
| file_app.py | ||
| kb_app.py | ||
| langfuse_app.py | ||
| llm_app.py | ||
| mcp_server_app.py | ||
| plugin_app.py | ||
| search_app.py | ||
| system_app.py | ||
| tenant_app.py | ||
| user_app.py | ||