mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-05-02 05:10:34 +00:00
Creates the API layer for Open Notebook Creates a services API gateway for the Streamlit front-end Migrates the SurrealDB SDK to the official one Change all database calls to async New podcast framework supporting multiple speaker configurations Implement the surreal-commands library for async processing Improve docker image and docker-compose configurations
25 lines
No EOL
600 B
Python
25 lines
No EOL
600 B
Python
"""
|
|
Embedding service layer using API.
|
|
"""
|
|
|
|
from typing import Dict
|
|
|
|
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) -> Dict[str, str]:
|
|
"""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() |