audia.ui — Web UI (FastAPI)
audia.ui.app — FastAPI application
FastAPI application factory for the audia web UI.
audia.ui.jobs — Background job store
Shared in-memory job store for background conversion tasks.
Both /api/convert/enqueue and /api/research/enqueue write here. The status endpoint and the cancel endpoint read/write here.
Routes
audia.ui.routes.convert
/api/convert – Upload PDF → run pipeline → return audio file path. Includes background-job endpoints for granular progress tracking. All endpoints accept an optional ?project= query parameter (defaults to “default”).
- async audia.ui.routes.convert.upload_and_convert(file=fastapi.File, voice=fastapi.Form, llm_provider=fastapi.Form, llm_model=fastapi.Form, tts_backend=fastapi.Form, project=fastapi.Form)
Synchronous upload + convert. Returns the download URL when done.
- async audia.ui.routes.convert.enqueue_conversion(file=fastapi.File, voice=fastapi.Form, llm_provider=fastapi.Form, llm_model=fastapi.Form, tts_backend=fastapi.Form, project=fastapi.Form)
Upload a PDF and return a job_id immediately; poll /status/{job_id} for progress.
- async audia.ui.routes.convert.get_job_status(job_id)
Return current status, stage, progress, log, result when done.
- Parameters:
job_id (str)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.convert.cancel_job(job_id)
Signal the job runner to stop after the current stage.
- Parameters:
job_id (str)
- Return type:
fastapi.responses.JSONResponse
audia.ui.routes.research
/api/research – Search ArXiv and convert selected papers to audio. All endpoints accept an optional ?project= query parameter (defaults to “default”).
- class audia.ui.routes.research.SearchRequest(*, query, max_results=10)[source]
Bases:
BaseModel- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class audia.ui.routes.research.NormalizeRequest(*, query, llm_provider=None, llm_model=None)[source]
Bases:
BaseModel- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class audia.ui.routes.research.ConvertResearchRequest(*, arxiv_ids, project=None)[source]
Bases:
BaseModel- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class audia.ui.routes.research.EnqueueRequest(*, arxiv_ids, query=None, llm_provider=None, llm_model=None, tts_backend=None, tts_voice=None, project=None)[source]
Bases:
BaseModel- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- async audia.ui.routes.research.normalize(body)
- Parameters:
body (NormalizeRequest)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.research.search(body)
- Parameters:
body (SearchRequest)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.research.convert_papers(body)
- Parameters:
body (ConvertResearchRequest)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.research.enqueue_research(body)
- Parameters:
body (EnqueueRequest)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.research.transcribe_audio(file=fastapi.File)
Accept a browser audio recording and return the Whisper transcription.
- Parameters:
file (fastapi.UploadFile)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.research.get_job_status(job_id)
- Parameters:
job_id (str)
- Return type:
fastapi.responses.JSONResponse
audia.ui.routes.library
/api/library – Query the local SQLite library of papers and audio files. All endpoints accept an optional ?project= query parameter (defaults to “default”).
- async audia.ui.routes.library.list_papers(project=fastapi.Query)
- Parameters:
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.list_audio(project=fastapi.Query)
- Parameters:
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.list_research_sessions(project=fastapi.Query)
- Parameters:
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.list_user_settings(project=fastapi.Query)
- Parameters:
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- class audia.ui.routes.library.PaperPatch(*, title=None, authors=None, abstract=None, arxiv_id=None, pdf_url=None)[source]
Bases:
BaseModel- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class audia.ui.routes.library.AudioPatch(*, filename=None, file_path=None, duration_seconds=None, tts_backend=None, tts_voice=None, paper_id=None)[source]
Bases:
BaseModel- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class audia.ui.routes.library.ResearchSessionPatch(*, query=None)[source]
Bases:
BaseModel- Parameters:
query (str | None)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class audia.ui.routes.library.UserSettingPatch(*, value)[source]
Bases:
BaseModel- Parameters:
value (str)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- async audia.ui.routes.library.patch_paper(paper_id, body, project=fastapi.Query)
- Parameters:
paper_id (int)
body (PaperPatch)
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.patch_audio(audio_id, body, project=fastapi.Query)
- Parameters:
audio_id (int)
body (AudioPatch)
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.patch_research_session(session_id, body, project=fastapi.Query)
- Parameters:
session_id (int)
body (ResearchSessionPatch)
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.patch_user_setting(key, body, project=fastapi.Query)
- Parameters:
key (str)
body (UserSettingPatch)
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.library.delete_audio(audio_id, project=fastapi.Query)
- async audia.ui.routes.library.get_paper(paper_id, project=fastapi.Query)
- async audia.ui.routes.library.delete_paper(paper_id, project=fastapi.Query)
- async audia.ui.routes.library.serve_pdf(paper_id, project=fastapi.Query)
- class audia.ui.routes.library.MovePaperBody(*, target_project)[source]
Bases:
BaseModel- Parameters:
target_project (str)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- async audia.ui.routes.library.move_paper(paper_id, body, project=fastapi.Query)
- Parameters:
paper_id (int)
body (MovePaperBody)
project (str | None)
- Return type:
fastapi.responses.JSONResponse
audia.ui.routes.settings
/api/settings – Persist and retrieve user-configured pipeline settings. Settings are stored in the SQLite DB as key-value pairs so they survive server restarts and are pre-loaded by the frontend on every page open. All endpoints accept an optional ?project= query parameter (defaults to “default”).
- class audia.ui.routes.settings.SettingsBody(*, stt_model=None, llm1_provider=None, llm1_model=None, llm2_provider=None, llm2_model=None, tts_backend=None, tts_voice=None)[source]
Bases:
BaseModel- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- async audia.ui.routes.settings.get_ui_settings(project=fastapi.Query)
Return the user-saved pipeline settings merged with defaults.
- Parameters:
project (str | None)
- Return type:
fastapi.responses.JSONResponse
- async audia.ui.routes.settings.save_ui_settings(body, project=fastapi.Query)
Persist the provided settings; omitted fields are left unchanged.
- Parameters:
body (SettingsBody)
project (str | None)
- Return type:
fastapi.responses.JSONResponse