Skip to content

Integrate Global Health and Specialized Medical Diagnostic Role#93

Merged
GYFX35 merged 1 commit intomainfrom
feature/integrate-global-health-diagnostic-role-10623514858802657793
Mar 21, 2026
Merged

Integrate Global Health and Specialized Medical Diagnostic Role#93
GYFX35 merged 1 commit intomainfrom
feature/integrate-global-health-diagnostic-role-10623514858802657793

Conversation

@GYFX35
Copy link
Copy Markdown
Owner

@GYFX35 GYFX35 commented Mar 21, 2026

Specialized the AI Diagnostic Specialist role for global health diagnostics, covering all diseases with a primary focus on Oncology (cancer) and Cardiology (heart disease). The integration includes updates to the AI's system prompt, the React frontend API client, and UI components in both the React marketplace and the standard HTML template. Functional integration in the React app now correctly handles diagnostic service requests instead of falling back to demo mode.


PR created automatically by Jules for task 10623514858802657793 started by @GYFX35

Summary by Sourcery

Integrate and specialize the AI Diagnostic Specialist service for global health diagnostics with emphasis on oncology and cardiology, and wire it through the frontend marketplace and HTML UI.

New Features:

  • Expose a dedicated diagnostic assistance API endpoint and client method for medical diagnostic requests in the marketplace frontend.
  • Enable the Medical Diagnostic service card in the React marketplace to call the backend diagnostic assistance service instead of demo mode.

Enhancements:

  • Expand the diagnostic assistant system prompt to cover global health topics with focused expertise in cancer and heart disease.
  • Update copy in the HTML and React frontends to describe the broader diagnostic coverage and oncology/cardiology focus of the AI Diagnostic Specialist.

- Update AI system prompt for diagnostic assistance to include all diseases, specializing in Oncology (cancer) and Cardiology (heart disease).
- Integrate the diagnostic assistance service into the React marketplace frontend.
- Update UI descriptions and labels in both React and HTML frontends to reflect the new global health focus.
- Ensure all user-facing strings in the HTML template are localized.

Co-authored-by: GYFX35 <134739293+GYFX35@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 21, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the AI Diagnostic Specialist role to a global health-focused medical diagnostic assistant (emphasizing oncology and cardiology), refreshes corresponding UI copy in both the HTML and React marketplace frontends, and wires the React marketplace diagnostic service to a new backend API endpoint instead of demo mode.

Sequence diagram for diagnostic service flow in React marketplace

sequenceDiagram
    actor User
    participant ReactApp as React_App
    participant AIService as aiService_api_client
    participant Backend as Backend_API
    participant GoogleAI as GoogleAI_provide_diagnostic_assistance

    User->>ReactApp: Select service diagnostic and enter request
    User->>ReactApp: Click Submit

    ReactApp->>ReactApp: Determine serviceId
    ReactApp->>Backend: POST /diagnostic/assistance
    note over ReactApp,Backend: Uses aiService.getDiagnosticAssistance(servicePrompt)

    Backend->>GoogleAI: Call provide_diagnostic_assistance(prompt)
    GoogleAI-->>Backend: Diagnostic analysis response

    Backend-->>ReactApp: { message: diagnostic_result }
    ReactApp-->>User: Render medical diagnostic response
Loading

Updated class diagram for diagnostic assistance integration

classDiagram
    class google_ai_module {
      +provide_diagnostic_assistance(prompt: str) str
    }

    class BackendAPI {
      +post_diagnostic_assistance(prompt: string) Response
    }

    class aiService {
      +getWeather(location: string) Promise~Response~
      +getFinancialAdvice(prompt: string) Promise~Response~
      +getGoogleSitesAssistance(prompt: string) Promise~Response~
      +getDiagnosticAssistance(prompt: string) Promise~Response~
    }

    class ReactApp {
      +handleServiceRequest(serviceId: string, servicePrompt: string) Promise~void~
    }

    google_ai_module <.. BackendAPI : uses
    BackendAPI <.. aiService : calls_HTTP_API
    aiService <.. ReactApp : imports
Loading

File-Level Changes

Change Details Files
Expand the diagnostic assistant system prompt to a global health scope with specialization in cancer and heart disease.
  • Broaden role description to cover all diseases with a global health perspective.
  • Add explicit specialization sections for chronic/infectious diseases, oncology, and cardiology.
  • Clarify capabilities around symptom analysis, diagnostic procedures, terminology, wellness, and referrals in the generation instructions.
google_ai.py
Align marketing/UX copy for the diagnostic service in the HTML frontend with the new global and oncology/cardiology-focused positioning.
  • Update home-page card description for AI Diagnostic Specialist to emphasize all diseases with focus on cancer and heart disease.
  • Retitle the diagnostic service section to ‘Global Diagnostic & Medical Support’.
  • Revise the diagnostic request helper text to mention any disease plus cancer and heart disease examples.
frontend/templates/index.html
Update the React marketplace UI and API wiring so the Medical Diagnostic service calls a dedicated diagnostic assistance endpoint instead of falling back to demo mode.
  • Adjust the marketplace service description for the Medical Diagnostic card to match the new global/oncology/cardiology focus.
  • Add a diagnostic case to the service dispatch switch to call a dedicated API method.
  • Introduce a new API client method that posts diagnostic assistance prompts to the /diagnostic/assistance backend endpoint.
marketplace-frontend/src/App.tsx
marketplace-frontend/src/api.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying ai-services with  Cloudflare Pages  Cloudflare Pages

Latest commit: e9bbc8a
Status: ✅  Deploy successful!
Preview URL: https://ef286deb.ai-services-36y.pages.dev
Branch Preview URL: https://feature-integrate-global-hea.ai-services-36y.pages.dev

View logs

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider updating the diagnostic system prompt to explicitly include safety constraints (e.g., not providing definitive diagnoses, handling emergencies, and always recommending consultation with a medical professional) to reduce the risk of unsafe medical advice.
  • In aiService.getDiagnosticAssistance, double-check that the /diagnostic/assistance route aligns with existing backend routing conventions (e.g., other health-related endpoints) to keep API paths consistent and predictable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider updating the diagnostic system prompt to explicitly include safety constraints (e.g., not providing definitive diagnoses, handling emergencies, and always recommending consultation with a medical professional) to reduce the risk of unsafe medical advice.
- In `aiService.getDiagnosticAssistance`, double-check that the `/diagnostic/assistance` route aligns with existing backend routing conventions (e.g., other health-related endpoints) to keep API paths consistent and predictable.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
aiservices e9bbc8a Mar 21 2026, 03:24 PM

@GYFX35 GYFX35 merged commit d83ef9d into main Mar 21, 2026
4 of 6 checks passed
@GYFX35 GYFX35 deleted the feature/integrate-global-health-diagnostic-role-10623514858802657793 branch March 21, 2026 15:25
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