Coder Social home page Coder Social logo

openai-batch's Introduction

Process a batch of OpenAI chat completion requests. The requests must be specified in a csv file with two fields named "system" and "user". The contents of these fields will be used as the content of the system message and the user message sent to OpenAI as part of the chat completion request. Results will be written to an output file which will be a csv containing the fields "system", "user", and "assistant" with the response from OpenAI contained in the "assistant" field.

Any additional fields specified in the input file will have no effect on processing and will be copied to the output file without modification.

Please make sure to specify your OpenAI API key in an environment variable called OPENAI_APIKEY. This can also be done by adding a file called .env to your working directory and including a line like this:

OPENAI_APIKEY=<Your OpenAI API key>

In order to use this program, make sure you have NodeJS and npm installed. It is recommended to use NodeJS 20.

After cloning the repo, download all dependencies by running: npm install

Then, you can run the program like this: openai-batch -i <your input file>

For usage instructions, run like this: openai-batch --help

Please note that the order of the records in the output file may not match the order in the input file. Therefore, you may find it helpful to add an additional index field to the input file. This will be copied to the output file and may aid in sorting and matching the results.

openai-batch's People

Contributors

kaxelson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.