mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-05-01 21:00:43 +00:00
Api podcast migration (#93)
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
This commit is contained in:
parent
9814103cc8
commit
d7b0fff954
125 changed files with 16177 additions and 3296 deletions
32
api/context_service.py
Normal file
32
api/context_service.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
"""
|
||||
Context service layer using API.
|
||||
"""
|
||||
|
||||
from typing import Dict, Optional
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from api.client import api_client
|
||||
|
||||
|
||||
class ContextService:
|
||||
"""Service layer for context operations using API."""
|
||||
|
||||
def __init__(self):
|
||||
logger.info("Using API for context operations")
|
||||
|
||||
def get_notebook_context(
|
||||
self,
|
||||
notebook_id: str,
|
||||
context_config: Optional[Dict] = None
|
||||
) -> Dict:
|
||||
"""Get context for a notebook."""
|
||||
result = api_client.get_notebook_context(
|
||||
notebook_id=notebook_id,
|
||||
context_config=context_config
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
# Global service instance
|
||||
context_service = ContextService()
|
||||
Loading…
Add table
Add a link
Reference in a new issue