🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@animo-id/credo-ts-question-answer

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@animo-id/credo-ts-question-answer

Credo Question Answe

Source
npmnpm
Version
0.5.14-alpha-20250204074333
Version published
Weekly downloads
49
-47.87%
Maintainers
4
Weekly downloads
 
Created
Source


Credo Logo

Credo Question Answer Module

License typescript @credo-ts/question-answer version


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: {
    /* config */
  },
  dependencies: agentDependencies,
  modules: {
    questionAnswer: new QuestionAnswerModule(),
    /* other custom modules */
  },
})

await agent.initialize()

// To send a question to a given connection
await agent.modules.questionAnswer.sendQuestion(connectionId, {
  question: 'Do you want to play?',
  validResponses: [{ text: 'Yes' }, { text: 'No' }],
})

// Questions and Answers are received as QuestionAnswerStateChangedEvent

// To send an answer related to a given question answer record
await agent.modules.questionAnswer.sendAnswer(questionAnswerRecordId, 'Yes')

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts