process_medical_record_azure:v8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import weave
from typing import Dict
azure_client = "<openai.lib.azure.AzureOpenAI object at 0x119104590>"
@weave.op()
def process_medical_record_azure(dialogue: str, note: str) -> Dict:
response = azure_client.chat.completions.create(
model="gpt-35-turbo-0125-ft-d30b3aee14864c29acd9ac54eb92457f",
messages=[
{"role": "system", "content": "You are a medical scribe assistant. Your task is to accurately document medical conversations between doctors and patients, creating detailed medical notes that capture all relevant clinical information."},
{"role": "user", "content": dialogue + "\n\n" + note},
],
)
extracted_info = response.choices[0].message.content
return {
"input": dialogue,
"output": extracted_info,
}