-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority:highAddress soonAddress soonscope:gatewayGateway API (.NET backend)Gateway API (.NET backend)scope:llmLLM and AI model integrationLLM and AI model integrationtype:featureNew feature or enhancementNew feature or enhancement
Description
Note for implementers: The design outlined here is a guideline, not a strict specification. Feel free to pivot from the suggested approach if you discover a better solution during implementation. Update the issue with your rationale when deviating significantly.
Summary
Replace the stub IntelligenceClient with production HTTP calls to the Intelligence service /analyze endpoint.
Context
The current implementation returns hardcoded mock data. Production implementation must:
- Serialize
ClinicalBundleto JSON - POST to
/analyzeendpoint with timeout handling - Deserialize response to
PAFormData - Handle errors gracefully
Dependencies
| Issue | Relationship |
|---|---|
| #9 | Blocked by - data contracts must be stable |
Tasks
Core Implementation
- Inject
HttpClientviaIHttpClientFactory - Serialize ClinicalBundle to JSON
- POST to
{BaseUrl}/analyze - Deserialize response to
PAFormData
Resilience (Polly)
- Retry policy (exponential backoff, max 3)
- Circuit breaker (threshold: 5, 30s break)
- Timeout policy (30s default)
Error Handling
- Handle
HttpRequestException - Handle timeout scenarios
- Handle non-2xx status codes
- Log errors with correlation ID
Testing
- Unit tests with mocked
HttpMessageHandler - Test retry and circuit breaker behavior
Files
| File | Action |
|---|---|
apps/gateway/Gateway.API/Services/IntelligenceClient.cs |
Modify |
apps/gateway/Gateway.API/Configuration/IntelligenceOptions.cs |
Reference |
apps/gateway/Gateway.API.Tests/Services/IntelligenceClientTests.cs |
Create |
Design References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:highAddress soonAddress soonscope:gatewayGateway API (.NET backend)Gateway API (.NET backend)scope:llmLLM and AI model integrationLLM and AI model integrationtype:featureNew feature or enhancementNew feature or enhancement
Type
Projects
Status
Todo