.env
file with the name WRITER_API_KEY
.POST /v1/graphs/question
Parameter | Type | Required | Description |
---|---|---|---|
graph_ids | array[string] | Yes | The unique identifiers of the Knowledge Graphs to query. You can specify multiple Knowledge Graph IDs to search across multiple graphs. |
question | string | Yes | The question to answer using the Knowledge Graph. |
subqueries | Boolean | No | Specify whether to include subqueries. Defaults to false . |
stream | Boolean | No | Determines whether to stream the response. If true , the output is sent as it is generated, which can be useful for real-time applications. Defaults to false . See how to handle streaming responses below. |
Parameter | Type | Description |
---|---|---|
question | string | The question you asked. |
answer | string | The answer to the question based on the Knowledge Graph content. |
sources | array | An array of source objects that contain the file information and text snippets used to generate the answer. |
sources[].file_id | string | If the source is a file, this is the unique identifier of the file that contains the source information. |
sources[].snippet | string | If the source is a file, this is a snippet of text from the source file used to answer the question. |
subqueries | array | An array of subquery objects. Only included if subqueries is true . |
subqueries[].query | string | The subquery the model generated to answer the question. |
subqueries[].answer | string | The answer to the subquery. |
subqueries[].sources | array | An array of source objects for the subquery. |
graph_ids
array.
stream
parameter to true
. This is useful for real-time applications that need to see the response as it is generated.