An open API service indexing awesome lists of open source software.

https://github.com/kevinam99/gpt3-first-flight

An Elixir client that works with GPT3
https://github.com/kevinam99/gpt3-first-flight

elixir gpt3

Last synced: 8 months ago
JSON representation

An Elixir client that works with GPT3

Awesome Lists containing this project

README

          

# GPT3 First Flight
![Elixir](https://img.shields.io/badge/elixir-%234B275F.svg?style=for-the-badge&logo=elixir&logoColor=white)
![GitHub](https://img.shields.io/github/license/kevinam99/GPT3-First-Steps?color=blue)
![GitHub last commit](https://img.shields.io/github/last-commit/kevinam99/GPT3-First-Steps)

**TODO: A lot!**
Succeeded in hiding the API key in lib/config/dev.exs
I don't know what else could be done except adding more functionalities using the API.
An Elixir client for using OpenAI's GPT3. I have used barebones API without any dependencies except Jason (to work with json) and HTTPoison (to make requests).

Since OpenAI doesn't allow for batch processing so I used Elixir's Task module to
implement concurrency while reducing the overall time taken for executing multiple queries.
So far, I've worked with text classification that includes analysing sentiments and assessing whether a poll/survey answer is relevant to the surveyor. Have a look at [lib/gpt3_first_flight/](./lib/gpt3_first_flight/). Please head over to [lib/gpt3_first_flight/](lib/gpt3_first_flight/) for additional documentation.

        **Be sure you have Elixir and Mix installed!**

### Getting started
1. Store your API key in ```lib/config/dev.exs``` as,
```elixir
import Config

config :gpt3_first_flight, api_key: "xx-xxx"
```
A reference [./config/dev.exs.example](./config/dev.exs.example) has also been included.
2. Install the dependencies before running any file. Run
```console
MIX_ENV=dev mix deps.get
```

3. Compile
```console
MIX_ENV=dev mix compile
```

4. Run the tests
```console
MIX_ENV=dev mix test
```

5. To run a test completion task, run
```console
MIX_ENV=dev elixir lib/gpt3_first_flight.ex
```

6. Each module can only be run by invoking the ```start``` function with an input query. **All inputs must be passed in a list, irrespective of the total number of inputs.**

Please head over to [./lib/gpt3_test_flight](./lib/gpt3_test_flight) for additional documentation.

### Author
1. Kevin Mathew,

    [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/neverloquacious.svg?style=social&label=Follow%20%40neverloquacious)](https://twitter.com/neverloquacious)