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
- Host: GitHub
- URL: https://github.com/kevinam99/gpt3-first-flight
- Owner: kevinam99
- License: mit
- Created: 2021-08-10T17:54:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-24T06:34:39.000Z (almost 5 years ago)
- Last Synced: 2025-01-12T17:46:50.178Z (over 1 year ago)
- Topics: elixir, gpt3
- Language: Elixir
- Homepage:
- Size: 399 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPT3 First Flight



**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,
[](https://twitter.com/neverloquacious)