Skip to content

Update embedding function from sync to async with 0.6.37#5

Open
GlisseManTV wants to merge 2 commits into
mtayfur:mainfrom
GlisseManTV:main
Open

Update embedding function from sync to async with 0.6.37#5
GlisseManTV wants to merge 2 commits into
mtayfur:mainfrom
GlisseManTV:main

Conversation

@GlisseManTV
Copy link
Copy Markdown
Contributor

Why?

OpenWebUI 0.6.37 changed EMBEDDING_FUNCTION from sync to async
The Memory System was still calling it synchronously, causing crashes

How?

Created a unified _call_embedding_function() wrapper that detects async/sync automatically
Made _detect_embedding_dimension() async-aware
Updated all embedding calls to use the new wrapper
Maintained backward compatibility with older versions

Result?

✅ Memory System works with OpenWebUI 0.6.37+
✅ Backward compatible with older versions
✅ Better error handling and logging
✅ No breaking changes for users

GlisseManTV and others added 2 commits November 24, 2025 10:14
… support

- Replace synchronous embedding function call with async-aware wrapper
- Add _call_embedding_function to handle both sync and async embedding functions
- Update _detect_embedding_dimension to use async call with proper error handling
- Improve embedding dimension detection with better type checking and error messages
- Maintain backward compatibility with existing sync embedding functions

This change enables compatibility with OpenWebUI 0.6.37+ where embedding functions are async, while preserving support for legacy sync functions through a threadpool fallback. The update ensures robustness and future-proofing of the memory system's embedding pipeline.
@GlisseManTV
Copy link
Copy Markdown
Contributor Author

@mtayfur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant