Commit Graph

274 Commits

Author SHA1 Message Date
ajaysi
7f626d47b4 Respect GPT_PROVIDER env var for text generation
- Add GPT_PROVIDER wavespeed/openai support in main_text_generation.py
- wavespeed_text_response now called when GPT_PROVIDER=wavespeed
- Fallback to tenant config when no GPT_PROVIDER set
- Add wavespeed provider mapping in provider_enum
- Fix generate_image() call to use options dict in podcast analysis
2026-03-31 18:20:56 +05:30
ajaysi
004506cf9a fix: Add missing strict_provider_mode variable definition 2026-03-31 07:34:14 +05:30
ajaysi
92bbe1d878 Merge PR #456: Add forced user_id lint check and demo router gating 2026-03-30 08:18:50 +05:30
ي
636989f75b Add forced user_id lint check and demo router gating 2026-03-30 08:13:48 +05:30
ajaysi
5706b85a4e Merge PR #455: Use tenant sessions for API key context and add startup key readiness check 2026-03-30 08:11:35 +05:30
ي
3a92c4af1a Use tenant sessions for API key context and add startup key readiness check 2026-03-30 08:09:28 +05:30
ajaysi
cbcb896d24 Merge PR #451: Fail demo startup when required API routes are missing 2026-03-30 07:56:43 +05:30
ي
ef7874dcdc Fail demo startup when required API routes are missing 2026-03-30 07:56:05 +05:30
ي
4e0f176842 Add strict Stripe checkout guard via env flag 2026-03-30 07:51:45 +05:30
ajaysi
557f700f68 fix: Resolve APIProvider enum mismatch causing dashboard errors
- Fix import path in subscriptions.py (pricing_service location)
- Add values_callable to APIUsageLog.provider enum column
- Normalize provider values to lowercase in usage trends helpers
- Add migration script for existing databases
2026-03-29 12:50:50 +05:30
ajaysi
d6ad903e3d feat: Improve image generation prompts with visual data extraction
- Add dedicated image_generation module with statistical extraction
- Support 16 industry domains with visual concept detection
- Add model-specific guidance for Ideogram, FLUX, GLM, Qwen, MAI
- Extract statistics, rankings, comparisons, and trends automatically
- Refactor backend/api/images.py to use new module
2026-03-29 10:16:40 +05:30
ajaysi
f503a24b3b feat: Add Auto-Dubbing feature for Podcast Maker
This commit adds the Auto-Dubbing feature for Podcast Maker with support
for translating podcast audio to different languages with optional voice
cloning to preserve the original speaker's voice.

New Features:
- Translation Service (common module): DeepL integration for low-cost
  translation, WaveSpeed integration for high-quality translation
- Audio Dubbing Service: STT -> Translate -> TTS pipeline with
  voice cloning support
- 9 new API endpoints for dubbing and voice cloning
- Support for 34+ languages
- Cost estimation utilities
- Comprehensive documentation

Files Added:
- services/translation/ (5 files): Translation service module
- services/dubbing/: Audio dubbing service
- api/podcast/handlers/dubbing.py: API endpoints
- docs/AUTO_DUBBING.md: Feature documentation
- CHANGELOG.md: Change log

Files Modified:
- api/podcast/models.py: Added dubbing request/response models
- api/podcast/router.py: Added dubbing routes
- services/__init__.py: Export translation and dubbing services
- scene_animation.py: Fixed missing Path import
2026-03-24 15:45:51 +05:30
ajaysi
51bc76345f Add new analytics modules from PR #436
- backend/services/analytics/opportunity_scorer.py: Functions for scoring and ranking
  opportunities from search queries (high_impression_low_ctr_queries,
  rising_queries, declining_pages, score_and_rank_opportunities,
  categorize_opportunities)
- backend/services/gsc_service.py: GSC (Google Search Console) service
2026-03-22 11:36:38 +05:30
ajaysi
b28dc4b5f6 Add startup health module and readiness endpoint from PR #434
- Add services/startup_health.py with health check functions:
  - get_startup_status(): Returns current startup status
  - readiness_under_auth_context(): Validates tenant DB under auth context
  - run_startup_health_routine(): Runs all startup health checks
- Add /health/readiness endpoint for tenant DB validation
- Update startup_event() to use run_startup_health_routine()
- Add raise to startup_event to fail fast on errors
2026-03-22 11:33:20 +05:30
ajaysi
e8f282b7a9 Enhance main_text_generation with APIKeyManager and improved provider routing
- Import APIKeyManager for provider key checking
- Use APIKeyManager.get_api_key() instead of get_api_key() function
- Add wavespeed provider to available_providers check
- Add detailed provider preflight logging with flow_type tag
- Improve fallback logic when preferred provider is unavailable

These improvements come from PRs #423-#431 while maintaining the modular textgen_utils structure.
2026-03-22 11:23:38 +05:30
ajaysi
a26fa84263 Extract useful LLM provider improvements from PRs #423-#429
huggingface_provider.py:
- Add retry logic with _should_retry_hf_error and _is_non_retryable_hf_error
- Update default models from :groq to :cerebras (HF_FALLBACK_MODELS)
- Add fallback_models parameter to huggingface_text_response
- Add get_available_models with updated model list

main_text_generation.py:
- Add GPT_PROVIDER and TEXTGEN_AI_MODELS env var support
- Add preferred_provider and flow_type parameters to llm_text_gen
- Add HF_MODEL_MAPPING for short model name resolution
- Add flow_type logging tag for better observability

sif_agents.py:
- Add LOW_COST_SHARED_REMOTE_MODELS for SIF agents
- Update SharedLLMWrapper to use preferred_hf_models and flow_type

These changes preserve the modular textgen_utils structure while incorporating
the useful routing and retry logic improvements from the pending PRs.
2026-03-22 11:16:48 +05:30
ajaysi
16be2b21f4 Fix user data endpoints to require authenticated user ID
- Add get_current_user authentication to all user data endpoints
- Pass authenticated user_id from auth context to service methods
- Add proper HTTPException handling for missing data
- Fix user_id type from int to str in service methods
- Ensure endpoints only return data for authenticated user
2026-03-22 11:02:35 +05:30
ajaysi
d557bd4918 Fix merge conflicts and resolve circular import issues
- Resolve conflict markers in logging_config.py, main.py, app.py
- Fix circular imports in story_writer services (image/audio/video generation)
  by using lazy imports for get_story_media_write_dir
- Restore clean versions of:
  - sif_agents.py
  - tenant_provider_config.py
  - personalization_service.py
  - huggingface_provider.py
  - main_text_generation.py
  - logger_utils.py
- Use setup_clean_logging() consistently across app.py and main.py
- Restore verbose_mode handling in start_alwrity_backend.py
2026-03-22 10:45:05 +05:30
ajaysi
c429c90860 "Merge_PR_421_structured_routing_logs_with_clean_modular_architecture" 2026-03-12 17:19:44 +05:30
ajaysi
27700ce272 "Add_structured_routing_logs_to_modular_text_generation" 2026-03-12 17:15:11 +05:30
ajaysi
482a600e14 "Add_structured_routing_logs_to_text_generation_modular" 2026-03-12 17:12:15 +05:30
ajaysi
e85c7d442e "Replace_main_text_generation.py_with_clean_modular_version" 2026-03-12 17:09:19 +05:30
ajaysi
1829f47893 "Extract_text_generation_utilities_into_modular_structure" 2026-03-12 16:59:45 +05:30
ajaysi
54396b8268 Merge_PR_420_add_tenant_aware_provider_config_resolver_across_llm_facades 2026-03-12 16:44:41 +05:30
ajaysi
f36cd8eea9 "Recreate_huggingface_provider_clean_functional_version" 2026-03-12 16:40:53 +05:30
ajaysi
1d68db8151 Merge_PR_437_repair_huggingface_provider_and_restore_explicit_retry_fallback 2026-03-12 16:36:37 +05:30
ي
968900858c Repair huggingface provider and restore explicit retry/fallback behavior 2026-03-12 16:29:50 +05:30
ajaysi
4d90a80b9c Merge_PR_419_refine_hf_provider_retries_and_client_reuse 2026-03-12 16:22:48 +05:30
ajaysi
acf526e7e1 Merge_PR_418_refine_hf_fallback_policy_and_sif_low_cost_routing 2026-03-12 16:19:19 +05:30
ajaysi
679c0e8c89 Merge_PR_417_centralized_text_routing_policy 2026-03-12 16:08:40 +05:30
ajaysi
8d421a158f Merge_PR_416_fix_textgen_ai_models_mapping 2026-03-12 16:05:47 +05:30
ajaysi
acc5e1f72c Merge_PR_415_enforce_runtime_only_workspace_creation 2026-03-12 16:01:23 +05:30
ajaysi
f1ee8fce50 Merge_PR_414_standardize_tenant_db_directory 2026-03-12 15:55:00 +05:30
ajaysi
e7171df5db Merge branch 'pr-413' 2026-03-12 15:46:43 +05:30
ajaysi
d0267c7608 Merge branch 'pr-409' 2026-03-12 15:33:33 +05:30
ajaysi
901470eb8b Merge_PR_408_flat_context_and_txtai_file_tools 2026-03-12 15:29:08 +05:30
ajaysi
e90a29c27e Merge_PR_410_with_local_changes 2026-03-12 15:21:08 +05:30
ي
d01d4af62f Add standardized structured routing logs for text generation 2026-03-12 15:05:07 +05:30
ي
feacbc6d59 Add tenant-aware provider config resolver across LLM facades 2026-03-12 15:04:42 +05:30
ي
7df7d870e5 Refine Hugging Face provider retries and client reuse 2026-03-12 15:04:16 +05:30
ي
bf191374a5 Refine HF fallback policy controls and SIF low-cost routing 2026-03-12 15:03:47 +05:30
ي
d4528fbc74 Add centralized text routing policy and premium HF defaults 2026-03-12 15:03:22 +05:30
ي
4b7f443509 Fix TEXTGEN_AI_MODELS full-name mapping and unify model resolution 2026-03-12 15:02:47 +05:30
ي
3ebe884a37 Enforce runtime-only workspace directory creation policy 2026-03-12 15:00:59 +05:30
ي
7557feb830 Standardize tenant DB directory to db with legacy migration 2026-03-12 15:00:20 +05:30
ي
22df52f9d6 Unify story media path resolution across services and routes 2026-03-12 14:59:45 +05:30
ي
ad1756aaa2 Extract usage trends and reset logic into usage_tracking_helpers 2026-03-12 07:32:59 +05:30
ajaysi
01881bb405 "feat:enhance-podcast-topic-ai" 2026-03-11 19:09:27 +05:30
ي
7619604324 Harden logging config with safer overrides and optional JSON/file sinks 2026-03-11 16:31:28 +05:30
ي
cbe41ef8c7 Add Step 5 flat context and txtai file tools for agents 2026-03-11 10:42:05 +05:30