Giter Club home page Giter Club logo

openaiapi-chat-program's Introduction

openaiapi-chat-program

This program uses the OpenAI API to create a chatbot that can converse with the user. The program prompts the user to enter input, sends that input to the OpenAI API, and displays the response.

Dependencies

This program depends on the following packages:

  • "bufio": Package for reading input from the user. Created by The Go Authors. Repository
  • "context": Package for managing contexts for Go programs. Created by The Go Authors. Repository
  • "fmt": Package for formatting input and output in Go programs. Created by The Go Authors. Repository
  • "os": Package for accessing operating system functionality in Go programs. Created by The Go Authors. Repository
  • "github.com/joho/godotenv": Package for loading environment variables from a .env file. Created by John Barton. Repository
  • "github.com/sashabaranov/go-openai": Package for accessing the OpenAI API. Created by Sasha Baranov. Repository

Usage

To run the program, execute the following command in the terminal:

go run main.go

The program will prompt the user to enter input, and then display the response generated by the OpenAI API. This process will repeat ten times.

Configuration

This program uses an API key to access the OpenAI API. The API key is stored in a .env file, which should be located in the same directory as the program. The contents of the .env file should be as follows:

api_key=<your_api_key_here>

Replace <your_api_key_here> with your actual API key. To get an API key, head to the openai website and sign up.

Limitations

This program only allows the user to enter text input. It does not currently support other types of input, such as voice input.

Acknowledgement

Special thanks to the creators and contributors of these packages for their hard work and dedication to the Go community.

openaiapi-chat-program's People

Contributors

fikradev 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.