From 388bea2acff737ff360ee990b6d7a3690faab445 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Thu, 21 Nov 2024 15:51:02 -0500 Subject: [PATCH 1/4] Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cc69ede69..7f6aebc0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ontogpt" -version = "1.0.7" +version = "1.0.8" description = "OntoGPT" authors = ["Chris Mungall ", "J. Harry Caufield "] license = "BSD-3" From 1615aceb1e5256d7b0e0ee85cf63ae49379bfeb4 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Thu, 21 Nov 2024 15:55:49 -0500 Subject: [PATCH 2/4] Add docstrings for webapp runner --- src/ontogpt/webapp/main.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/ontogpt/webapp/main.py b/src/ontogpt/webapp/main.py index b7f906306..02082c4a7 100644 --- a/src/ontogpt/webapp/main.py +++ b/src/ontogpt/webapp/main.py @@ -1,4 +1,33 @@ -"""Webapp main function.""" +"""OntoGPT Webapp main function. + +This module sets up a FastAPI web application for +the OntoGPT project. It includes routes for handling +GET and POST requests, and integrates with components +such as SPIRESEngine and HTMLExporter to process and +display data. + +Classes: + Query: A Pydantic model representing the structure + of the form data. + +Functions: + get_engine(datamodel: str, llm_model: str) -> SPIRESEngine: + Retrieves or initializes a SPIRESEngine instance for + the given datamodel and LLM model. + + read_root(request: Request) -> TemplateResponse: + Handles GET requests to the root URL, + rendering the form.html template. + + form_post(request: Request, datamodel: str = Form(...), + text: str = Form(...), llm_model: str = Form(...)) + -> TemplateResponse: + Handles POST requests to the root URL, processing + the form data and rendering the results.html template. + + start(): + Launches the FastAPI application using Uvicorn. +""" from io import StringIO from pathlib import Path From d0f8018072dd0ce5999fdfdfa4b2f7489413db02 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Thu, 21 Nov 2024 15:58:47 -0500 Subject: [PATCH 3/4] Add some comments to Kanjee prompt --- src/ontogpt/utils/clinical_cases.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ontogpt/utils/clinical_cases.py b/src/ontogpt/utils/clinical_cases.py index 2aaffea57..0a7f334f0 100644 --- a/src/ontogpt/utils/clinical_cases.py +++ b/src/ontogpt/utils/clinical_cases.py @@ -1,4 +1,14 @@ -"""Utilities for working with clinical case reports.""" +"""Utilities for working with clinical case reports. + +The prompt in get_kanjee_prompt() is that used by +the following citation: + Kanjee Z, Crowe B, Rodman A. Accuracy of a + generative artificial intelligence model in + a complex diagnostic challenge. JAMA. + 2023 Jul 3;330(1):78–80. + http://dx.doi.org/10.1001/jama.2023.8288 + PMCID: PMC10273128 +""" def get_kanjee_prompt() -> str: """Prompt from Kanjee et al. 2023.""" From 82f0d1b75dc36a68c66ccf08eb1ade52c4c9b301 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Thu, 21 Nov 2024 16:03:20 -0500 Subject: [PATCH 4/4] Minor linting in eval resolver --- src/ontogpt/evaluation/resolver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ontogpt/evaluation/resolver.py b/src/ontogpt/evaluation/resolver.py index 92ced439a..1b932b324 100644 --- a/src/ontogpt/evaluation/resolver.py +++ b/src/ontogpt/evaluation/resolver.py @@ -6,8 +6,8 @@ from ontogpt.evaluation.ctd.eval_ctd import EvalCTD from ontogpt.evaluation.ctd.eval_ctd_ner import EvalCTDNER -from ontogpt.evaluation.maxo.eval_maxo import EvalMAXO from ontogpt.evaluation.evaluation_engine import SPIRESEvaluationEngine +from ontogpt.evaluation.maxo.eval_maxo import EvalMAXO resolver = ClassResolver([EvalCTD, EvalCTDNER, EvalMAXO], base=SPIRESEvaluationEngine)