0.9.0 • Published 26 days ago
@contextco/context-node v0.9.0
Context Node Library
The Context Node library provides a convenient way to interface with the Context APIs. We include pre-defined classes and operations to interact with API resources.
Installation
NPM
npm install @contextco/context-node
Yarn
yarn add @contextco/context-node
Usage
The library needs to be configured with your Context API key, which is available in the Context Settings Dashboard.
Example
import { ContextAPI, ContextAPIOptionalParams, KnownMessageRole, Credential } from "context-js";
const options: ContextAPIOptionalParams = {
credential: new Credential(process.env.CONTEXT_TOKEN),
};
const c = new ContextAPI(options);
await c.log.conversation({
body: {
conversation: {
messages: [
{ message: "You are a helpful assistant.", role: KnownMessageRole.System, rating: 0 },
{ message: "Hi, how are you doing?", role: KnownMessageRole.User, rating: 0 },
{ message: "I'm doing super well, how are you?", role: KnownMessageRole.Assistant, rating: 1 }
],
}
}
})
Appendix
typescript: true
output-folder: generated
source-code-folder-path: src
package-name: "@contextco/context-generated"
clear-output-folder: true
credential-default-policy-type: BearerTokenCredentialPolicy
azure-arm: false
add-credentials: true
credential-scopes: all
models-mode: msrest
generate-metadata: true
use:
- "@autorest/typescript@6.0.8"
0.9.0
26 days ago
0.8.0
2 months ago
0.6.0
2 months ago
0.7.0
3 months ago
0.5.0
6 months ago
0.4.0
6 months ago
0.1.1-3.1
8 months ago
0.1.10
9 months ago
0.1.11
8 months ago
0.1.12
8 months ago
0.1.13
8 months ago
0.1.15
8 months ago
0.3.0
6 months ago
0.2.0
7 months ago
0.1.16
7 months ago
0.1.8
9 months ago
0.1.7
9 months ago
0.1.18
6 months ago
0.1.9
9 months ago
0.1.1-3.3
8 months ago
0.1.4
10 months ago
0.1.1-3.2
8 months ago
0.1.3
10 months ago
0.1.6
9 months ago
0.1.5
9 months ago
0.1.2
11 months ago
0.1.1
11 months ago
0.1.0
11 months ago