I’ve been busy, so my reply is a bit late. 
formatting the conversation
For example, the following prompt instructs the LLM to analyze the conversation and convert it into the specified JSON format. While this is a well-known method, it’s not necessarily the only correct approach. To achieve better results, it may be necessary to refine the prompt over time.
# Define the example conversation and its corresponding JSON format
example_conversation = """
**Client:** "Doctor, my dog has been scratching a lot recently and he seems a bit restless."
**Veterinarian:** "I see. Has there been any change in his food or environment?"
**Client:** "No, everything has been the same."
**Veterinarian:** "I understand. Excessive scratching and restlessness could be signs of skin issues or allergies. It's best to bring him in for a checkup. We may need to conduct a skin test."
"""
example_json = """
{
"symptoms": {
"description": "Dog has been scratching a lot recently and seems a bit restless."
},
"veterinarian_advice": {
"description": "Excessive scratching and restlessness could be signs of skin issues or allergies. It's best to bring him in for a checkup. We may need to conduct a skin test."
},
"pet_information": {
"type": "Dog",
"breed": "",
"age": ""
},
"background": {
"description": "Dog has been scratching a lot recently and seems a bit restless. No changes in food or environment."
}
}
"""
# Define the JSON format to be used
json_format = """
{
"symptoms": {
"description": ""
},
"veterinarian_advice": {
"description": ""
},
"pet_information": {
"type": "",
"breed": "",
"age": ""
},
"background": {
"description": ""
}
}
"""
# Combine everything into the final prompt
prompt = f"""
Translate the following conversations into JSON format. The conversations are between a client and a veterinarian.
**Example 1:**
{example_conversation}
**JSON Format:**
{example_json}
Translate this conversation into the following JSON format.
{conversation}
{json_format}
"""
Create a query in the specified JSON format using the information extracted from the conversation.
prompt = """
Translate the following conversation into a JSON format query for a vector database. The conversation is between a client and a veterinarian.
**Conversation:**
**Client:** "Doctor, my cat has been drinking a lot of water recently and she seems a bit lethargic."
**Veterinarian:** "I see. How about her food intake and urination? Has there been any change?"
**Client:** "Yes, she's been eating less and she seems to urinate more than usual."
**Veterinarian:** "I understand. Excessive drinking, decreased appetite, and increased urination could be signs of kidney issues. It's best to bring her in for a checkup. We may need to conduct a blood test and urine test."
Translate this conversation into the following JSON format query.
``` json
{
"symptoms": {
"description": ""
},
"veterinarian_advice": {
"description": ""
},
"pet_information": {
"type": "",
"breed": "",
"age": ""
},
"background": {
"description": ""
}
}
The expected result is as follows.
The “breed” and “age” fields under “pet_information” are left blank as they are not evident from the conversation.
{
"symptoms": {
"description": "Cat has been drinking a lot of water, appears lethargic, eating less, and urinating more than usual."
},
"veterinarian_advice": {
"description": "Excessive drinking, decreased appetite, and increased urination could be signs of kidney issues. It's best to bring her in for a checkup. We may need to conduct a blood test and urine test."
},
"pet_information": {
"type": "Cat",
"breed": "",
"age": ""
},
"background": {
"description": "Cat has been drinking a lot of water and appears lethargic. Her food intake has decreased and she seems to urinate more than usual."
}
}
I was imagining something like this when I was talking.