Skip to content

6.2 HR AI Assistant: GetHrInsightQuery with live workforce context#3

Open
workcontrolgit wants to merge 2 commits intodevelopfrom
feature/6.2-dotnet-ai-hr-assistant
Open

6.2 HR AI Assistant: GetHrInsightQuery with live workforce context#3
workcontrolgit wants to merge 2 commits intodevelopfrom
feature/6.2-dotnet-ai-hr-assistant

Conversation

@workcontrolgit
Copy link
Copy Markdown
Owner

Summary

  • Adds GetHrInsightQuery MediatR handler that fetches live dashboard metrics and injects them into the LLM system prompt
  • Adds HrInsightDto response DTO with Question, Answer, and ExecutionTimeMs
  • Adds POST /api/v1/ai/hr-insight endpoint to AiController (guarded by [FeatureGate("AiEnabled")])
  • Updates XML docs for the new endpoint

What this enables

HR managers can ask plain-English questions ("Which department has the most employees?") and get answers grounded in live workforce data — no hallucination, no manual data export.

How to test

  1. Start Ollama: ollama serve
  2. Set "AiEnabled": true in appsettings.json
  3. Run API: dotnet run
  4. Open Swagger at https://localhost:44378/swagger
  5. POST to /api/v1/ai/hr-insight with { "question": "Which department has the most employees?" }
  6. Verify response includes question, answer, and executionTimeMs
  7. Set "AiEnabled": false — endpoint returns 503, all other endpoints unaffected

Related

  • Builds on Article 6.1 (IAiChatService, OllamaAiService, AiController base)
  • Reuses IDashboardMetricsReader from existing dashboard infrastructure
  • Part of AngularNetTutorial Series 6 — AI App Features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant