Skip to main content
POST
/
v1
/
context
Patient-contextualized answer with conflicts
curl --request POST \
  --url https://core.locusmedical.fr/v1/context \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "patient_context": {
    "sex": "F",
    "age": 34,
    "history": [
      "diabète type 2"
    ],
    "active_problems": [
      "grossesse 24 SA"
    ],
    "allergies": [
      "pénicilline"
    ],
    "current_treatments": [
      "warfarine"
    ]
  },
  "source_ids": []
}
'
{
  "query": "<string>",
  "answer": "<string>",
  "sources": [
    {
      "reco_id": 123,
      "reco_title": "<string>",
      "source_name": "<string>",
      "deep_link": "<string>"
    }
  ],
  "conflicts": [
    {
      "description": "<string>",
      "patient_factor": "allergie pénicilline",
      "reco_id": 123
    }
  ],
  "reformulated_question": "<string>",
  "tokens_in": 123,
  "tokens_out": 123
}

Authorizations

Authorization
string
header
required

Locus API key — paste the raw lsk_… value (no 'Bearer ' prefix).

Body

application/json
query
string
required

Free-text clinical question in French.

Minimum string length: 1
Example:

"Quelle antibiothérapie pour cette infection urinaire ?"

patient_context
PatientContext · object
required

Coarse patient profile used to contextualize the answer and surface conflicts (allergies, interactions, pregnancy, age…).

source_ids
integer[] | null

Optional allow-list of source ids to restrict retrieval. Omit (the default) to search all sources.

Example:
[]

Response

Successful Response

query
string
required

Echo of the submitted question.

answer
string
required

Concise answer grounded ONLY in the retrieved sources, taking the patient profile into account.

sources
AnswerSource · object[]
required

Citations actually used — deduplicated by recommendation.

conflicts
Conflict · object[]
required

Tensions between the recommendations and the patient profile. Empty when none are detected.

reformulated_question
string | null

The question restated clearly by the model.

tokens_in
integer | null

Prompt tokens billed.

tokens_out
integer | null

Completion tokens billed.