Spaces:
Sleeping
Sleeping
File size: 1,950 Bytes
e458941 982f969 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# Nurse LLM
```
/your_path/MALI_Nurse/
βββ cli.py
βββ main.py
βββ README.md
βββ llm/
β βββ __init__.py
β βββ client.py
β βββ llm.py
βββ .env
```
## Quick Start
### Prerequisites
- Python 3.10
### Installation
1. Clone the repository:
```sh
git clone https://github.com/yourusername/MALI_Nurse.git
cd MALI_Nurse
```
2. Install the required packages:
```sh
pip install -r requirements.txt
```
Alternatively, you can use Poetry for dependency management:
```sh
poetry install
```
3. Set up your environment variables in a `.env` file:
```env
TYPHOON_API_KEY=your_typhoon_api_key
```
### Running the CLI
To start the CLI, run:
```sh
python cli.py
```
### Running the API
To start the FastAPI server, run:
```sh
uvicorn main:app --reload
```
The server will be available at `http://127.0.0.1:8000`.
### API Endpoints
- `GET /history`: Retrieve chat history
- `GET /ehr`: Retrieve EHR data
- `GET /status`: Get current prompt status
- `POST /debug`: Toggle debug mode
- `POST /reset`: Reset chat history and EHR data
- `POST /nurse_response`: Get a response from the nurse LLM
### Example Request
To get a response from the nurse LLM, send a POST request to `/nurse_response` with a JSON body:
```json
{
"user_input": "Your question here"
}
```
### CLI Commands
The CLI provides several commands to interact with the Nurse LLM. Below are the available commands:
- `start`: Start the CLI session.
- `help`: Display help information about the CLI commands.
- `exit`: Exit the CLI session.
### Example Usage
To start the CLI session, simply run:
```sh
python cli.py
```
Once the CLI is running, you can use the following commands:
- To start interacting with the nurse LLM:
```sh
start
```
- To display help information:
```sh
help
```
- To exit the CLI session:
```sh
exit
```
|