POST
/
v1
/
graphs
/
question
curl --location --request POST https://api.writer.com/v1/graphs/question \
 --header "Authorization: Bearer <token>" \
 --header "Content-Type: application/json" \
--data-raw '{"graph_ids":[{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}],"subqueries":false,"question":"What is the generic name for the drug Bavencio?","stream":false}'
{
  "question": "What is the generic name for the drug Bavencio?",
  "answer": "avelumab",
  "sources": [
    {
      "file_id": "1234",
      "snippet": "Bavencio is the brand name for avelumab."
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
graph_ids
string[]
required

The unique identifiers of the Knowledge Graphs to be queried.

subqueries
boolean
required

Specify whether to include subqueries.

question
string
required

The question to be answered using the Knowledge Graph.

stream
boolean
required

Determines whether the model's output should be streamed. If true, the output is generated and sent incrementally, which can be useful for real-time applications.

Response

200
application/json
question
string
required

The question that was asked.

answer
string
required

The answer to the question.

sources
array
required
subqueries
array