Chat
Chat Submit
Chat with Virtual Patient
POST http://dev-api.med2lab.com/external/v1/case/chat/submit/
Request Body
Name
Type
Description
case_id*
id
The id of the case
message*
string
Your message.
model*
string
"gpt-3.5-turbo", "gpt-4"... from OpenAI
```json
{
"status": "response_saved",
"UserMessage": "how are you",
"PatientResponse": "Hello, doctor. I'm feeling concerned about my symptoms. Can you please explain what might be causing the numbness and tingling in my feet? Could it be related to my diabetes?",
"Media": null,
"ChatStatus": "patient",
"PreceptorQuestion": null
}
```curl --location 'https://api-qa.med2lab.com/external/v1/case/chat/submit/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L' \
--data '{
"case_id": 778,
"message": "how are you",
"model": "gpt-3.5-turbo"
}'import requests
import json
url = "https://api-qa.med2lab.com/external/v1/case/chat/submit/"
payload = json.dumps({
"case_id": 778,
"message": "how are you",
"model": "gpt-3.5-turbo"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api-qa.med2lab.com/external/v1/case/chat/submit/");
request.Headers.Add("Authorization", "Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L");
var content = new StringContent("{\r\n \"case_id\": 778,\r\n \"message\": \"how are you\",\r\n \"model\": \"gpt-3.5-turbo\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
"case_id": 778,
"message": "how are you",
"model": "gpt-3.5-turbo"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api-qa.med2lab.com/external/v1/case/chat/submit/");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L");
xhr.send(data);Chat Reset
Reset your chat in that case.
POST http://dev-api.med2lab.com/external/v1/case/chat/reset/
Request Body
Name
Type
Description
case_id*
id
The id of the case
```json
{
"status": "success"
}
```curl --location 'http://api-qa.med2lab.com/external/v1/case/chat/reset/' \
--header 'Authorization: Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L' \
--header 'Content-Type: application/json' \
--data '{
"case_id": 778
}'import requests
import json
url = "http://api-qa.med2lab.com/external/v1/case/chat/reset/"
payload = json.dumps({
"case_id": 778
})
headers = {
'Authorization': 'Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "http://api-qa.med2lab.com/external/v1/case/chat/reset/");
request.Headers.Add("Authorization", "Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L");
var content = new StringContent("{\r\n \"case_id\": 778\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
"case_id": 778
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://api-qa.med2lab.com/external/v1/case/chat/reset/");
xhr.setRequestHeader("Authorization", "Bearer H8AqjUwVTbRylxkQFtDSz4eWptLS8L");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Last updated