Skip to content

Latest commit

 

History

History
412 lines (294 loc) · 14.2 KB

API.md

File metadata and controls

412 lines (294 loc) · 14.2 KB

Classes

Agent

The Agent service is responsible for managing an AI agent. AI agents are self-contained actors which emit messages to a subscriber, which may be a human or another AI agent.

Bundler

Builder for Fabric-based applications.

Clock : Object

Simple clock. Emits tick events at a specified interval.

Queue

A Queue is a simple job queue for managing asynchronous tasks.

Site

Implements a full-capacity (Native + Edge nodes) for a Fabric Site.

SPA

Fully-managed HTML application.

Trainer

Implements document ingestion.

Worker

Worker service.

FabricNetwork

Defines the Fabric interface for Sensemaker.

Sensemaker : Object

Sensemaker is the primary instance of the AI.

Agent

The Agent service is responsible for managing an AI agent. AI agents are self-contained actors which emit messages to a subscriber, which may be a human or another AI agent.

Kind: global class

new Agent([settings])

Create an instance of an Agent.

Returns: Agent - Instance of the Agent.

Param Type Description
[settings] Object Settings for the Agent.
[settings.name] String The name of the agent.
[settings.type] String The type of the agent.
[settings.description] String The description of the agent.
[settings.frequency] Number The frequency at which the agent operates.
[settings.database] Object The database settings for the agent.
[settings.fabric] Object The Fabric settings for the agent.
[settings.parameters] Object The parameters for the agent.
[settings.model] String The model for the agent.

agent.query(request) ⇒ AgentResponse

Query the agent with some text.

Kind: instance method of Agent
Returns: AgentResponse - Response object.

Param Type Description
request Object Request object.
request.query String The query to send to the agent.

Bundler

Builder for Fabric-based applications.

Kind: global class

new Bundler([settings])

Create an instance of the bundler.

Param Type Description
[settings] Object Map of settings.
[settings.document] HTTPComponent Document to use.

Clock : Object

Simple clock. Emits tick events at a specified interval.

Kind: global class

Queue

A Queue is a simple job queue for managing asynchronous tasks.

Kind: global class

queue.registerMethod(name, contract, context) ⇒ function

Register a method with the queue.

Kind: instance method of Queue
Returns: function - The registered method.

Param Type Description
name String Name of the method to register.
contract function Function to execute when the method is called.
context Object Context in which to execute the method.

Site

Implements a full-capacity (Native + Edge nodes) for a Fabric Site.

Kind: global class

new Site([settings])

Creates an instance of the Site, which provides general statistics covering a target Fabric node.

Returns: Site - Instance of the Site. Call render(state) to derive a new DOM element.

Param Type Description
[settings] Object Configuration values for the Site.

SPA

Fully-managed HTML application.

Kind: global class

Trainer

Implements document ingestion.

Kind: global class

trainer.ingestDirectory(directory) ⇒ Promise

Ingest a directory of files.

Kind: instance method of Trainer
Returns: Promise - Resolves with the result of the operation.

Param Type Description
directory String Path to ingest.

trainer.ingestDocument(document, type) ⇒ Promise

Ingest a well-formed document.

Kind: instance method of Trainer
Returns: Promise - Resolves with the result of the operation.

Param Type Default Description
document Object Well-formed document object.
type String text Name of the document type.

trainer.search(request) ⇒ Promise

Search the document store.

Kind: instance method of Trainer
Returns: Promise - Resolves with the result of the operation.

Param Type Description
request Object Search object.

Worker

Worker service.

Kind: global class

FabricNetwork

Defines the Fabric interface for Sensemaker.

Kind: global class

new FabricNetwork([settings])

Create an instance of the service.

Returns: FabricService - A new instance of the service.

Param Type Description
[settings] Object Settings for the service.

Sensemaker : Object

Sensemaker is the primary instance of the AI.

Kind: global class
Extends: Service

new Sensemaker([settings])

Constructor for the Sensemaker instance.

Returns: Sensemaker - Resulting instance of Sensemaker.

Param Type Default Description
[settings] Object {} Map of configuration values.
[settings.seed] Number 12 or 24 word mnemonic seed.
[settings.port] Number 7777 Fabric messaging port.

sensemaker.combinationsOf(tokens, prefix) ⇒ Array

Extracts a list of possible combinations of a given array.

Kind: instance method of Sensemaker
Returns: Array - List of possible combinations.

Param Type Description
tokens Array List of tokens to combine.
prefix String Additional prefix to add to each combination.

sensemaker.createAgent(configuration) ⇒ Agent

Creates (and registers) a new Agent instance.

Kind: instance method of Sensemaker
Returns: Agent - Instance of the Agent.

Param Type Description
configuration Object Settings for the Agent.

sensemaker.estimateTokens(input) ⇒ Number

Provides a function to estimate the number of tokens in a given input string.

Kind: instance method of Sensemaker
Returns: Number - Estimated number of tokens.

Param Type Description
input String Input string to estimate.

sensemaker.importantPhrases(input, limit) ⇒ Array

Extracts a list of important phrases from a given input string.

Kind: instance method of Sensemaker
Returns: Array - List of important phrases in order of rank.

Param Type Default Description
input String Input string to analyze.
limit Number 5 Maximum number of phrases to return.

sensemaker.importantWords(input, limit) ⇒ Array

Extracts a list of important words from a given input string.

Kind: instance method of Sensemaker
Returns: Array - List of important words in order of rank.

Param Type Default Description
input String Input string to analyze.
limit Number 5 Maximum number of words to return.

sensemaker.properNouns(input) ⇒ Array

Extract a list of proper nouns from a given input string.

Kind: instance method of Sensemaker
Returns: Array - List of proper nouns.

Param Type Description
input String Input string to analyze.

sensemaker.uniqueWords(input) ⇒ Array

Extract a list of unique words from a given input string.

Kind: instance method of Sensemaker
Returns: Array - List of unique words.

Param Type Description
input String Input string to analyze.

sensemaker.alert(message) ⇒ Boolean

Sends a system-wide alert.

Kind: instance method of Sensemaker
Returns: Boolean - Returns true if the alert sent, false otherwise.

Param Type Description
message String Message to send in the alert.

sensemaker.handleTextRequest(request) ⇒ Promise

Generate a response to a given request.

Kind: instance method of Sensemaker
Returns: Promise - Resolves with the response to the request.

Param Type Description
request Object Request object.
request.query String Query text.
[request.conversation_id] String Unique identifier for the conversation.

sensemaker.retrieveFile(id) ⇒ Object

Retrieve a file by its database ID.

Kind: instance method of Sensemaker
Returns: Object - File object.

Param Type Description
id Number Database ID of the file.

sensemaker.start() ⇒ Promise

Start the process.

Kind: instance method of Sensemaker
Returns: Promise - Resolves once the process has been started.

sensemaker.stop() ⇒ Promise

Stop the process.

Kind: instance method of Sensemaker
Returns: Promise - Resolves once the process has been stopped.

sensemaker._getRoomMessages() ⇒ Array

Retrieve a conversation's messages.

Kind: instance method of Sensemaker
Returns: Array - List of the conversation's messages.

sensemaker._handleRequest(request) ⇒ SensemakerResponse

Generate a response to a request.

Kind: instance method of Sensemaker

Param Type Description
request SensemakerRequest The request.
[request.room] String Matrix room to retrieve conversation history from.