KnowledgeGraph.answer_question()
Answer a pending enrichment question.
Usage
KnowledgeGraph.answer_question(
question_id,
*,
choice=None,
freeform=None,
)At least one of choice or freeform must be provided.
Parameters
question_id: str-
ID of the question to answer.
choice: int | None = None-
Index of the selected option.
freeform: str | None = None- Freeform text answer.
Returns
EnrichmentQuestion | None-
The updated question, or
Noneif not found or not pending.
Raises
ValueError-
If neither
choicenorfreeformis provided, orchoiceis out of range.
Examples
questions = kg.pending_questions()
kg.answer_question(questions[0].id, choice=0)
kg.answer_question(questions[1].id, freeform="It's the API migration")