2.0.4 • Published 7 months ago

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

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months 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.3

10 months ago

2.0.4

7 months ago

2.0.2

2 years ago

2.0.1

2 years ago