Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dweinstein/openai-erlang-client
Erlang OpenAI client auto-generated by OpenAPI-generator
https://github.com/dweinstein/openai-erlang-client
client-libraries erlang openai openapi-generator
Last synced: 12 days ago
JSON representation
Erlang OpenAI client auto-generated by OpenAPI-generator
- Host: GitHub
- URL: https://github.com/dweinstein/openai-erlang-client
- Owner: dweinstein
- Created: 2023-03-19T03:27:33.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-19T03:28:08.000Z (almost 2 years ago)
- Last Synced: 2024-11-12T23:38:19.780Z (2 months ago)
- Topics: client-libraries, erlang, openai, openapi-generator
- Language: Erlang
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenAPI client server library for Erlang
## Overview
An Erlang client stub generated by [OpenAPI Generator](https://openapi-generator.tech) given the [OpenAPI spec](https://github.com/openai/openai-openapi).
## Example
```erlang
1> ApiKey = <<"sk-...">>,
Host = <<"https://api.openai.com">>,
HackneyOpts = [{recv_timeout, 30_000}],
Opts = #{cfg => #{ api_key_prefix => #{ <<"Authorization">> => <<"Bearer">> }, auth => #{ api_key => ApiKey }, host => Host }, hackney_opts => HackneyOpts }),
openai_open_ai_api:list_models(#{}, Opts).
...
{ok,#{data =>
[#{created => 1649358449,id => <<"babbage">>,
object => <<"model">>,owned_by => <<"openai">>,
parent => null,
permission =>
[#{allow_create_engine => false,allow_fine_tuning => false,
allow_logprobs => true,allow_sampling => true,
allow_search_indices => false,allow_view => true,
created => 1669085501,group => null,
id => <<"modelperm-49FUp5v084tBB49tC4z8LPH5">>,
is_blocking => false,object => <<"model_permission">>,
organization => <<"*">>}],
...
```