From cb8040bd10dd4d900429dc5e8da54566ed5be922 Mon Sep 17 00:00:00 2001 From: sreyakumar <121137643+sreyakumar@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:35:24 -0700 Subject: [PATCH] updated w/ QC compatibility --- GAMER_workbook.ipynb | 117 ++++++----------------------------- src/metadata_chatbot/main.py | 10 +-- 2 files changed, 24 insertions(+), 103 deletions(-) diff --git a/GAMER_workbook.ipynb b/GAMER_workbook.ipynb index 17d7f59..d9706c4 100644 --- a/GAMER_workbook.ipynb +++ b/GAMER_workbook.ipynb @@ -49,102 +49,6 @@ "### Synchronous calling" ] }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: metadata-chatbot in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (0.0.20)\n", - "Requirement already satisfied: aind-data-access-api>=0.15.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api[full]>=0.15.0->metadata-chatbot) (0.15.0)\n", - "Requirement already satisfied: boto3 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (1.35.42)\n", - "Requirement already satisfied: langchain-aws in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.2.2)\n", - "Requirement already satisfied: langchain-community in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.3.2)\n", - "Requirement already satisfied: langchain-core in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.3.11)\n", - "Requirement already satisfied: langchain in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.3.3)\n", - "Requirement already satisfied: langgraph in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.2.38)\n", - "Requirement already satisfied: motor in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (3.1.2)\n", - "Requirement already satisfied: nest-asyncio in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (1.6.0)\n", - "Requirement already satisfied: pymongo in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (4.3.3)\n", - "Requirement already satisfied: fastapi in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.115.2)\n", - "Requirement already satisfied: uvicorn in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.32.0)\n", - "Requirement already satisfied: logging in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.4.9.6)\n", - "Requirement already satisfied: sshtunnel in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (0.4.0)\n", - "Requirement already satisfied: typing in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from metadata-chatbot) (3.7.4.3)\n", - "Requirement already satisfied: requests in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2.32.3)\n", - "Requirement already satisfied: aind-codeocean-api>=0.4.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (0.5.0)\n", - "Requirement already satisfied: pydantic>=2.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2.9.2)\n", - "Requirement already satisfied: pydantic-settings>=2.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2.5.2)\n", - "Requirement already satisfied: botocore<1.36.0,>=1.35.42 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from boto3->metadata-chatbot) (1.35.42)\n", - "Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from boto3->metadata-chatbot) (1.0.1)\n", - "Requirement already satisfied: s3transfer<0.11.0,>=0.10.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from boto3->metadata-chatbot) (0.10.3)\n", - "Requirement already satisfied: starlette<0.41.0,>=0.37.2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from fastapi->metadata-chatbot) (0.40.0)\n", - "Requirement already satisfied: typing-extensions>=4.8.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from fastapi->metadata-chatbot) (4.12.2)\n", - "Requirement already satisfied: PyYAML>=5.3 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (6.0.2)\n", - "Requirement already satisfied: SQLAlchemy<3,>=1.4 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (1.4.49)\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (3.10.10)\n", - "Requirement already satisfied: langchain-text-splitters<0.4.0,>=0.3.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (0.3.0)\n", - "Requirement already satisfied: langsmith<0.2.0,>=0.1.17 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (0.1.135)\n", - "Requirement already satisfied: numpy<2,>=1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (1.26.4)\n", - "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.1.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain->metadata-chatbot) (8.5.0)\n", - "Requirement already satisfied: jsonpatch<2.0,>=1.33 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain-core->metadata-chatbot) (1.33)\n", - "Requirement already satisfied: packaging<25,>=23.2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain-core->metadata-chatbot) (24.1)\n", - "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langchain-community->metadata-chatbot) (0.6.7)\n", - "Requirement already satisfied: langgraph-checkpoint<3.0.0,>=2.0.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langgraph->metadata-chatbot) (2.0.1)\n", - "Requirement already satisfied: langgraph-sdk<0.2.0,>=0.1.32 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langgraph->metadata-chatbot) (0.1.33)\n", - "Requirement already satisfied: dnspython<3.0.0,>=1.16.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from pymongo->metadata-chatbot) (2.7.0)\n", - "Requirement already satisfied: paramiko>=2.7.2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from sshtunnel->metadata-chatbot) (3.5.0)\n", - "Requirement already satisfied: click>=7.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from uvicorn->metadata-chatbot) (8.1.7)\n", - "Requirement already satisfied: h11>=0.8 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from uvicorn->metadata-chatbot) (0.14.0)\n", - "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (2.4.3)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (1.3.1)\n", - "Requirement already satisfied: attrs>=17.3.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (24.2.0)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (1.4.1)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (6.1.0)\n", - "Requirement already satisfied: yarl<2.0,>=1.12.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (1.15.4)\n", - "Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from botocore<1.36.0,>=1.35.42->boto3->metadata-chatbot) (2.9.0.post0)\n", - "Requirement already satisfied: urllib3!=2.2.0,<3,>=1.25.4 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from botocore<1.36.0,>=1.35.42->boto3->metadata-chatbot) (2.2.3)\n", - "Requirement already satisfied: colorama in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from click>=7.0->uvicorn->metadata-chatbot) (0.4.6)\n", - "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community->metadata-chatbot) (3.22.0)\n", - "Requirement already satisfied: typing-inspect<1,>=0.4.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community->metadata-chatbot) (0.9.0)\n", - "Requirement already satisfied: jsonpointer>=1.9 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from jsonpatch<2.0,>=1.33->langchain-core->metadata-chatbot) (3.0.0)\n", - "Requirement already satisfied: msgpack<2.0.0,>=1.1.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langgraph-checkpoint<3.0.0,>=2.0.0->langgraph->metadata-chatbot) (1.1.0)\n", - "Requirement already satisfied: httpx>=0.25.2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langgraph-sdk<0.2.0,>=0.1.32->langgraph->metadata-chatbot) (0.27.2)\n", - "Requirement already satisfied: httpx-sse>=0.4.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langgraph-sdk<0.2.0,>=0.1.32->langgraph->metadata-chatbot) (0.4.0)\n", - "Requirement already satisfied: orjson>=3.10.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langgraph-sdk<0.2.0,>=0.1.32->langgraph->metadata-chatbot) (3.10.7)\n", - "Requirement already satisfied: requests-toolbelt<2.0.0,>=1.0.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from langsmith<0.2.0,>=0.1.17->langchain->metadata-chatbot) (1.0.0)\n", - "Requirement already satisfied: bcrypt>=3.2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from paramiko>=2.7.2->sshtunnel->metadata-chatbot) (4.2.0)\n", - "Requirement already satisfied: cryptography>=3.3 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from paramiko>=2.7.2->sshtunnel->metadata-chatbot) (43.0.1)\n", - "Requirement already satisfied: pynacl>=1.5 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from paramiko>=2.7.2->sshtunnel->metadata-chatbot) (1.5.0)\n", - "Requirement already satisfied: annotated-types>=0.6.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from pydantic>=2.0->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (0.7.0)\n", - "Requirement already satisfied: pydantic-core==2.23.4 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from pydantic>=2.0->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2.23.4)\n", - "Requirement already satisfied: python-dotenv>=0.21.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from pydantic-settings>=2.0->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (1.0.1)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from requests->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (3.4.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from requests->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (3.10)\n", - "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from requests->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2024.8.30)\n", - "Requirement already satisfied: greenlet!=0.4.17 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from SQLAlchemy<3,>=1.4->langchain->metadata-chatbot) (3.1.1)\n", - "Requirement already satisfied: anyio<5,>=3.4.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from starlette<0.41.0,>=0.37.2->fastapi->metadata-chatbot) (4.6.2.post1)\n", - "Requirement already satisfied: psycopg2-binary==2.9.5 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2.9.5)\n", - "Requirement already satisfied: pandas<2.2.0,>=2.0.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2.1.4)\n", - "Requirement already satisfied: sniffio>=1.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from anyio<5,>=3.4.0->starlette<0.41.0,>=0.37.2->fastapi->metadata-chatbot) (1.3.1)\n", - "Requirement already satisfied: cffi>=1.12 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from cryptography>=3.3->paramiko>=2.7.2->sshtunnel->metadata-chatbot) (1.17.1)\n", - "Requirement already satisfied: httpcore==1.* in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from httpx>=0.25.2->langgraph-sdk<0.2.0,>=0.1.32->langgraph->metadata-chatbot) (1.0.6)\n", - "Requirement already satisfied: pytz>=2020.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from pandas<2.2.0,>=2.0.0->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2024.2)\n", - "Requirement already satisfied: tzdata>=2022.1 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from pandas<2.2.0,>=2.0.0->aind-data-access-api>=0.15.0->aind-data-access-api[full]>=0.15.0->metadata-chatbot) (2024.2)\n", - "Requirement already satisfied: six>=1.5 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.36.0,>=1.35.42->boto3->metadata-chatbot) (1.16.0)\n", - "Requirement already satisfied: mypy-extensions>=0.3.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain-community->metadata-chatbot) (1.0.0)\n", - "Requirement already satisfied: propcache>=0.2.0 in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from yarl<2.0,>=1.12.0->aiohttp<4.0.0,>=3.8.3->langchain->metadata-chatbot) (0.2.0)\n", - "Requirement already satisfied: pycparser in c:\\users\\sreya.kumar\\documents\\github\\metadata-chatbot\\venv\\lib\\site-packages (from cffi>=1.12->cryptography>=3.3->paramiko>=2.7.2->sshtunnel->metadata-chatbot) (2.22)\n" - ] - } - ], - "source": [ - "!pip install metadata-chatbot" - ] - }, { "cell_type": "code", "execution_count": 1, @@ -210,7 +114,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -225,14 +129,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "Based on the provided context, I could not find any information about the age of the subject at the time of imaging for the specific session SmartSPIM_662616_2023-03-06_17-47-13. The context contains conflicting information about the subject's date of birth and does not explicitly state the age for that particular session. I am unable to provide a definitive answer to the question.\n" + "Based on the provided context, here are the procedures performed on specimen 662616 and their start/end dates:\n", + "\n", + "Subject procedures:\n", + "1. Surgery on 2023-01-25 with virus injections\n", + "2. Surgery on 2023-01-25 with virus injection\n", + "\n", + "Specimen procedures:\n", + "1. Fixation (SHIELD OFF) from 2023-02-10 to 2023-02-12\n", + "2. Fixation (SHIELD ON) from 2023-02-12 to 2023-02-13\n", + "3. Delipidation (24h Delipidation) from 2023-02-15 to 2023-02-16 \n", + "4. Delipidation (Active Delipidation) from 2023-02-16 to 2023-02-18\n", + "5. Refractive index matching (50% EasyIndex) from 2023-02-19 to 2023-02-20\n", + "6. Refractive index matching (100% EasyIndex) from 2023-02-20 to 2023-02-21\n", + "\n", + "Imaging procedure:\n", + "1. SmartSPIM imaging session from 2023-03-06T17:47:13 to 2023-03-06T22:59:16\n" ] } ], "source": [ "from metadata_chatbot.agents.GAMER import GAMER\n", "llm = GAMER()\n", - "query = \"What was the age of the subject at the time of imaging in SmartSPIM_662616_2023-03-06_17-47-13\"\n", + "query = \"Can you list all the procedures performed on the specimen, including their start and end dates? in SmartSPIM_662616_2023-03-06_17-47-13\"\n", "\n", "result = await llm.ainvoke(query)\n", "print(result)" diff --git a/src/metadata_chatbot/main.py b/src/metadata_chatbot/main.py index b25eaf9..57f734e 100644 --- a/src/metadata_chatbot/main.py +++ b/src/metadata_chatbot/main.py @@ -1,12 +1,14 @@ from fastapi import FastAPI import uvicorn -from metadata_chatbot.bedrock_model.chat import get_summary +from metadata_chatbot.agents.GAMER import GAMER app = FastAPI() -@app.get("/summary/{_id}") -def REST_summary(_id: str): - result = get_summary(_id) +@app.get("/summary/{name}") +async def REST_summary(name: str): + query = f"Give me a detailed 3 sentence summary of the asset name: {name}. Do not include a starting phrase like here is a 3 sentence summary of this asset." + model = GAMER() + result = await model.ainvoke(query) return result if __name__ == "__main__":