2.0.2 • Published 1 year ago

@k-apps-io/llm-dsl-chatgpt v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

llm-dsl-chatgpt

a ChatGPT implementation for @k-apps-io/llm-dsl

Installation

npm install @k-apps-io/llm-dsl @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( { model: "gpt-3.5-turbo" } );

  const chat = new DSL<Options, Context>( {
    llm: LLM
  } );

  chat
    .prompt( {
      message: "hello"
    } )
    .stream( stdout() )
    .then( () => {
      console.log( "done" );
    } )
    .catch( error => {
      console.error( error );
    } );
};

main();

More

See the docs for @k-apps-io/llm-dsl

2.0.2

1 year ago

2.0.1

1 year ago