Commit graph

12 commits

Author SHA1 Message Date
Ashwin Kumar Sivakumar
f0fbb15e54 Route through LiteLLM's task-specific models and implement missing Ask Ash features
Wires up 8 previously missing/stub Ask Ash capabilities: resume
improvement, job post improvement, professional/jobseeker/company
profile improvement, service description generation, KB
article/notification writing, admin support ticket summarization, and
lead/credit guidance. Also upgrades explain_plan_limits and
check_ai_pack_balance from static canned strings to real generated
answers.

Adds AiProvider::complete_as(model, ...) so callers can target
specific LiteLLM model aliases (jd-generator, profile-writer,
service-writer, support-drafter, decision-support, askash-main/fast)
that were already defined in apps/litellm/base/configmap.yaml but
never actually used by ai-assistant, since it wasn't even configured
to use the litellm provider (defaulted to plain Ollama with the tiny
gemma3:270m model for every task, with no LLM_PROVIDER/LITELLM_* env
vars set in the deployment).

New content_tools module holds the shared generation logic; new
routes registered for each feature; KB content generation and support
ticket summarization are gated to ADMIN/EMPLOYEE roles via JWT claims.
Registry gains 4 new ActionDefinitions (improve_job_post,
generate_kb_content, lead_credit_guidance, ai_auto_apply_status) to
match the existing registry pattern.
2026-07-02 18:48:43 +05:30
Ashwin Kumar Sivakumar
6decf8dce2 Fix panic-on-missing-env in auth middleware and ticket provider
require_auth and NxtgaugeTicketProvider::create_ticket both called
env::var(...).expect(...) on every request, crashing instead of
returning a proper error when JWT_SECRET/AI_SERVICE_KEY were unset.
Both are now loaded once into AppConfig at startup and checked with
a graceful 401/500 response.
2026-07-02 18:31:35 +05:30
Tracewebstudio Dev
2e0b986e20 feat: JWT auth middleware, env-var CORS origins, real user_id in confirm_action
- Add src/auth.rs with require_auth middleware extracting user_id from Bearer token
- Wire auth middleware onto all /api/* routes
- Replace CorsLayer::permissive() with env-driven FRONTEND_URL/ADMIN_URL origins
- Pass real auth_user.user_id to confirm_action instead of conversation_id

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:51:41 +02:00
Ashwin Kumar Sivakumar
e33ed2192c Update workflows and source files 2026-07-02 06:51:03 +05:30
Tracewebstudio Dev
4505d8987e feat: add Ask Ash AI assistant implementation
- Add LiteLLM provider with LLM_PROVIDER env var support
- Add Fake LLM provider for testing
- Add action registry with 17 AI actions
- Add permission checker with role verification
- Add UI events in chat responses (fill_form, open_preview, etc)
- Add versioned prompt files system
- Add confirm action endpoint
- Add 80 unit tests

New endpoints:
- POST /api/ai/actions/confirm

New files:
- src/handlers/actions.rs
- src/handlers/confirm_action.rs
- src/services/action_confirmation.rs
- src/prompts.rs
- src/tests.rs
- prompts/v1/*.txt
2026-06-14 20:28:17 +02:00
Tracewebstudio Dev
89e4809f0b feat: add permission checker module
Checks:
- User is logged in
- Role is allowed for action
- Verification status
- Account status

Includes unit tests.
2026-06-14 19:29:09 +02:00
Tracewebstudio Dev
fced248dfc feat: add action registry with code-based action definitions
Includes 17 actions with:
- Allowed roles
- Required/optional fields
- AI action costs
- Backend handlers
- Confirmation requirements
2026-06-14 19:28:12 +02:00
Tracewebstudio Dev
e947e248e2 feat: add fake LLM provider for testing
Set LLM_PROVIDER=fake to use mock responses without calling real LLM.
Useful for API flow tests, action engine tests, UI event tests.
2026-06-14 19:24:10 +02:00
Tracewebstudio Dev
7d31d1a2bd feat: add LiteLLM provider and cover letter generation
- Add LiteLLM provider implementing AiProvider trait
- Support both Ollama and LiteLLM via LLM_PROVIDER env var
- Add cover letter generation endpoint
- Improve chat orchestrator with better intent detection
- Add search_kb, explain_plan_limits, check_ai_pack_balance intents
- Add LiteLLM config env vars
2026-06-14 18:00:33 +02:00
Tracewebstudio Dev
42d5053259 fix: use cluster Ollama URL and gemma3:270m model defaults 2026-04-15 19:55:03 +02:00
Tracewebstudio Dev
72d44bbd63 feat: wire NxtgaugeTicketProvider and NxtgaugeHelpCenterProvider to real backend APIs
- Add NxtgaugeTicketProvider: calls /api/support/tickets/ai/create with service key auth
- Add NxtgaugeHelpCenterProvider: calls /api/kb/articles for help search
- Add ExternalService error variant for HTTP call failures
- Add NXTGAUGE_USERS_URL config env var
2026-04-15 18:18:39 +02:00
Ashwin Kumar
dbba72478c feat(ai-assistant): bootstrap rust axum backend with providers, routes, and db scaffolding 2026-04-11 15:04:14 +02:00