| Title: | Conversational Interfaces for Clinical Data with Large Language Models |
|---|---|
| Description: | Provides tools and Shiny applications for interacting with clinical datasets through natural language using large language models. Built on 'ellmer' and 'shinychat', it emphasizes privacy-aware workflows where data remains local and only necessary summaries or tool results are shared with the model. Includes ready-to-use chat interfaces for exploratory analysis, summarization, and querying of clinical data. |
| Authors: | Shekhar Chalwadi [aut, cre] |
| Maintainer: | Shekhar Chalwadi <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-11-11 23:56:36 UTC |
| Source: | https://github.com/cran/clinChat |
Provides tools and Shiny applications for interacting with clinical datasets through natural language using large language models. Built on ellmer and shinychat, it emphasizes privacy-aware workflows where data remains local and only necessary summaries or tool results are shared with the model.
Shekhar Chalwadi [email protected]
Useful links:
Report bugs at https://github.com/shekharchalwadigrepo-hub/clinChat/issues
Generate a list of tools for clinical data exploration.
clinical_tools(data)clinical_tools(data)
data |
A data.frame. |
A list of ellmer tool objects.
Creates an ellmer::Chat object pre-configured with tools for exploring a clinical dataset. Data remains local; only tool results are shared with the model.
create_clinical_chat(data, system_prompt = NULL, provider = NULL, ...)create_clinical_chat(data, system_prompt = NULL, provider = NULL, ...)
data |
A data.frame containing clinical data. |
system_prompt |
Character. System prompt for the model. Defaults to a clinical analyst persona that emphasizes accuracy and privacy. |
provider |
Character or NULL. Provider string for ellmer::chat(), e.g. "openai/gpt-4o-mini". If NULL, uses the default from ellmer. |
... |
Additional arguments passed to ellmer::chat(). |
An ellmer Chat object with clinical tools registered.
# Create sample clinical data (executable) data <- data.frame( patient_id = 1:20, age = sample(25:80, 20, replace = TRUE), sex = sample(c("M", "F"), 20, replace = TRUE), outcome = sample(c("responder", "non-responder"), 20, replace = TRUE) ) # Inspect available tools (no API key required) tools <- clinical_tools(data) length(tools) # Creating a chat object requires a configured LLM provider if (FALSE) { chat <- create_clinical_chat(data, provider = "openai/gpt-4o-mini") # chat$chat("How many responders are there by sex?") }# Create sample clinical data (executable) data <- data.frame( patient_id = 1:20, age = sample(25:80, 20, replace = TRUE), sex = sample(c("M", "F"), 20, replace = TRUE), outcome = sample(c("responder", "non-responder"), 20, replace = TRUE) ) # Inspect available tools (no API key required) tools <- clinical_tools(data) length(tools) # Creating a chat object requires a configured LLM provider if (FALSE) { chat <- create_clinical_chat(data, provider = "openai/gpt-4o-mini") # chat$chat("How many responders are there by sex?") }
Starts an interactive Shiny app that lets users chat with a clinical dataset using a large language model. Uses shinychat for the interface and ellmer for the model backend.
run_clinchat_app( data, system_prompt = NULL, provider = NULL, title = "Clinical Data Chat", ... )run_clinchat_app( data, system_prompt = NULL, provider = NULL, title = "Clinical Data Chat", ... )
data |
A data.frame of clinical data. |
system_prompt |
Optional custom system prompt. |
provider |
Provider string for ellmer (e.g. "openai/gpt-4o-mini"). |
title |
Title shown in the app. |
... |
Additional arguments passed to shiny::runApp(). |
Invisibly returns the Shiny app object. Called for its side effect of launching the app.
# Sample data data <- iris[1:20, ] # Launching the app requires a configured LLM provider if (FALSE) { run_clinchat_app(data, title = "Iris Explorer") }# Sample data data <- iris[1:20, ] # Launching the app requires a configured LLM provider if (FALSE) { run_clinchat_app(data, title = "Iris Explorer") }