Credo Question Answer Module
Question Answer module for Credo. Implements Aries RFC 0113.
Quick start
In order for this module to work, we have to inject it into the agent to access agent functionality. See the example for more information.
Example of usage
import { QuestionAnswerModule } from '@credo-ts/question-answer'
const agent = new Agent({
config: {
},
dependencies: agentDependencies,
modules: {
questionAnswer: new QuestionAnswerModule(),
},
})
await agent.initialize()
await agent.modules.questionAnswer.sendQuestion(connectionId, {
question: 'Do you want to play?',
validResponses: [{ text: 'Yes' }, { text: 'No' }],
})
await agent.modules.questionAnswer.sendAnswer(questionAnswerRecordId, 'Yes')