mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-30 20:39:55 +00:00
New front-end Launch Chat API Manage Sources Enable re-embedding of all contents Sources can be added without a notebook now Improved settings Enable model selector on all chats Background processing for better experience Dark mode Improved Notes Improved Docs: - Remove all Streamlit references from documentation - Update deployment guides with React frontend setup - Fix Docker environment variables format (SURREAL_URL, SURREAL_PASSWORD) - Update docker image tag from :latest to :v1-latest - Change navigation references (Settings → Models to just Models) - Update development setup to include frontend npm commands - Add MIGRATION.md guide for users upgrading from Streamlit - Update quick-start guide with correct environment variables - Add port 5055 documentation for API access - Update project structure to reflect frontend/ directory - Remove outdated source-chat documentation files
25 lines
No EOL
639 B
Python
25 lines
No EOL
639 B
Python
"""
|
|
Embedding service layer using API.
|
|
"""
|
|
|
|
from typing import Any, Dict, List, Union
|
|
|
|
from loguru import logger
|
|
|
|
from api.client import api_client
|
|
|
|
|
|
class EmbeddingService:
|
|
"""Service layer for embedding operations using API."""
|
|
|
|
def __init__(self):
|
|
logger.info("Using API for embedding operations")
|
|
|
|
def embed_content(self, item_id: str, item_type: str) -> Union[Dict[Any, Any], List[Dict[Any, Any]]]:
|
|
"""Embed content for vector search."""
|
|
result = api_client.embed_content(item_id=item_id, item_type=item_type)
|
|
return result
|
|
|
|
|
|
# Global service instance
|
|
embedding_service = EmbeddingService() |