1.0.9 • Published 6 months ago
@k-apps.io/llm-dsl-chatgpt v1.0.9
llm-dsl-chatgpt
a ChatGPT implementation for @k-apps.io/llm-dsl
Installation
npm install @k-apps.io/llm-dsl-chatgpt
Usage
import { DSL, LocalStorage, Context } from "@k-apps.io/llm-dsl";
import { ChatGPT, Options } from "@k-apps.io/llm-dsl-chatgpt";
require( "dotenv" ).config();
const main = () => {
const LLM = new ChatGPT( {} );
const chat = new DSL<Options, Context>( {
llm: LLM,
storage: LocalStorage,
options: {
model: "gpt-4"
}
} );
chat
.prompt( {
message: "hello"
} )
.stream( chunk => {
if ( chunk.type === "message" ) process.stdout.write( content );
} )
.then( () => {
console.log( "done" );
} )
.catch( error => {
console.error( error );
} );
};
main();
1.2.1-beta.2
6 months ago
1.2.1-beta.1
6 months ago
1.2.1-beta.0
6 months ago
1.0.9
6 months ago
1.0.8
6 months ago
1.0.7
6 months ago
1.0.6
6 months ago
1.0.5
6 months ago
1.0.4
6 months ago
1.0.3
6 months ago
1.0.2
6 months ago
1.0.1
6 months ago
1.0.0
6 months ago