1.0.16 • Published 1 month ago

solver-aissistance-lib v1.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
1 month ago

SOLVER AISSISTANCE LIBRARY

Configuration file

Structure

The configuration file should have the structure shown below:

{
    "saApikey": "XXXXXXXXXXXXXXXXXXXXXXXXX",
    "logging": {
        "level": "info"
    }
}
KeyDescription
saApikeySolver AIssistance API key. This key is provided when purchasing the subscription.
logging.levelLevel for logging messages. It could be one of the following values: debug, info, warn, error, fatal. If not value is specified, the default value is info.

Location

The default configuration file path and name is ./sa-config.json. To change this location, use the SA_CONFIG_FILE environment variable, like this:

export SA_CONFIG_FILE="/path/to/file/sa-config.json"

Question answering

import SolverAIssistanceConfigurationManager from "solver-aissistance-lib/configuration/solver-aissistance-configuration";
import SolverAI, { SolverAIResponse } from 'solver-aissistance-lib/solverai/solver-ai';

(async () => {
    // Get API Key from configuration file
    const apiKey = SolverAIssistanceConfigurationManager.getInstance().getConfiguration()?.saApikey;

    const question:string = "What's the Percy's problem?";
    const contextId:string = "AAAAA-AAAA-AAAA-AAAA-AAAAAAAA";
    const solverAI:SolverAI = new SolverAI(apiKey as string);
    const response:SolverAIResponse = await solverAI.answer(question, contextId);
    console.log("Answer:", response.answer);
})();

Command line simple client

To use commnad line simple client:

npx solver-aissistance-lib
1.0.16

1 month ago

1.0.15

1 month ago

1.0.14

1 month ago

1.0.13

1 month ago

1.0.11

1 month ago

1.0.10

1 month ago

1.0.0

1 month ago