ruby-openai-transitory-v2 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.circleci/config.yml +45 -0
- data/.devcontainer/Dockerfile +16 -0
- data/.devcontainer/devcontainer.json +36 -0
- data/.devcontainer/docker-compose.yml +19 -0
- data/.github/FUNDING.yml +13 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/dependabot.yml +15 -0
- data/.gitignore +74 -0
- data/.rspec +3 -0
- data/.rubocop.yml +31 -0
- data/CHANGELOG.md +398 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +88 -0
- data/LICENSE.txt +21 -0
- data/README.md +885 -0
- data/Rakefile +19 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/openai/assistants.rb +27 -0
- data/lib/openai/audio.rb +19 -0
- data/lib/openai/client.rb +95 -0
- data/lib/openai/compatibility.rb +10 -0
- data/lib/openai/files.rb +42 -0
- data/lib/openai/finetunes.rb +27 -0
- data/lib/openai/http.rb +127 -0
- data/lib/openai/http_headers.rb +36 -0
- data/lib/openai/images.rb +27 -0
- data/lib/openai/messages.rb +23 -0
- data/lib/openai/models.rb +15 -0
- data/lib/openai/run_steps.rb +15 -0
- data/lib/openai/runs.rb +32 -0
- data/lib/openai/threads.rb +23 -0
- data/lib/openai/version.rb +3 -0
- data/lib/openai.rb +88 -0
- data/lib/ruby/openai.rb +2 -0
- data/pull_request_template.md +5 -0
- data/ruby-openai.gemspec +32 -0
- metadata +137 -0
data/CHANGELOG.md
ADDED
@@ -0,0 +1,398 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [6.5.0] - 2024-03-31
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Add back the deprecated Completions endpoint that I removed a bit prematurely. Thanks, [@mishranant](https://github.com/
|
13
|
+
mishranant) and everyone who requested this.
|
14
|
+
|
15
|
+
## [6.4.0] - 2024-03-27
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- Add DALL·E 3 to specs and README - thanks to [@Gary-H9](https://github.com/Gary-H9)
|
20
|
+
- Add Whisper transcription language selection parameter to README - thanks to [@nfedyashev](https://github.com/nfedyashev)
|
21
|
+
- Add bundle exec rake lint and bundle exec rake test to make development easier - thanks to [@ignacio-chiazzo](https://github.com/ignacio-chiazzo)
|
22
|
+
- Add link to [https://github.com/sponsors/alexrudall](https://github.com/sponsors/alexrudall) when users run `bundle fund`
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
|
26
|
+
- Update README and spec to use tool calls instead of functions - thanks to [@mpallenjr](https://github.com/mpallenjr)
|
27
|
+
- Remove nonexistent Thread#list method - thanks again! to [@ignacio-chiazzo](https://github.com/ignacio-chiazzo)
|
28
|
+
- Update finetunes docs in README to use chat instead of completions endpoint - thanks to [@blefev](https://github.com/blefev)
|
29
|
+
|
30
|
+
## [6.3.1] - 2023-12-04
|
31
|
+
|
32
|
+
### Fixed
|
33
|
+
|
34
|
+
- Allow any kind of file (eg. PDFs) to be uploaded to the API, not just JSONL files. Thank you [@stefan-kp](https://github.com/stefan-kp) for the PR!
|
35
|
+
|
36
|
+
## [6.3.0] - 2023-11-26
|
37
|
+
|
38
|
+
### Added
|
39
|
+
|
40
|
+
- Add ability to pass [Faraday middleware](https://lostisland.github.io/faraday/#/middleware/index) to the client in a block, eg. to enable verbose logging - shout out to [@obie](https://github.com/obie) for pushing for this.
|
41
|
+
- Add better error logging to the client by default.
|
42
|
+
- Bump Event Source to v1, thank you [@atesgoral](https://github.com/atesgoral) @ Shopify!
|
43
|
+
|
44
|
+
## [6.2.0] - 2023-11-15
|
45
|
+
|
46
|
+
### Added
|
47
|
+
|
48
|
+
- Add text-to-speech! Thank you [@codergeek121](https://github.com/codergeek121)
|
49
|
+
|
50
|
+
## [6.1.0] - 2023-11-14
|
51
|
+
|
52
|
+
### Added
|
53
|
+
|
54
|
+
- Add support for Assistants, Threads, Messages and Runs. Thank you [@Haegin](https://github.com/Haegin) for the excellent work on this PR, and many reviewers for their contributions!
|
55
|
+
|
56
|
+
## [6.0.1] - 2023-11-07
|
57
|
+
|
58
|
+
### Fix
|
59
|
+
|
60
|
+
- Gracefully handle the case where an HTTP error response may not have valid JSON in its body. Thank you [@atesgoral](https://github.com/atesgoral)!
|
61
|
+
|
62
|
+
## [6.0.0] - 2023-11-06
|
63
|
+
|
64
|
+
### Added
|
65
|
+
|
66
|
+
- [BREAKING] HTTP errors will now be raised by ruby-openai as Faraday:Errors, including when streaming! Implemented by [@atesgoral](https://github.com/atesgoral)
|
67
|
+
- [BREAKING] Switch from legacy Finetunes to the new Fine-tune-jobs endpoints. Implemented by [@lancecarlson](https://github.com/lancecarlson)
|
68
|
+
- [BREAKING] Remove deprecated Completions endpoints - use Chat instead.
|
69
|
+
|
70
|
+
### Fix
|
71
|
+
|
72
|
+
- [BREAKING] Fix issue where :stream parameters were replaced by a boolean in the client application. Thanks to [@martinjaimem](https://github.com/martinjaimem), [@vickymadrid03](https://github.com/vickymadrid03) and [@nicastelo](https://github.com/nicastelo) for spotting and fixing this issue.
|
73
|
+
|
74
|
+
## [5.2.0] - 2023-10-30
|
75
|
+
|
76
|
+
### Fix
|
77
|
+
|
78
|
+
- Added more spec-compliant SSE parsing: see here https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation
|
79
|
+
- Fixes issue where OpenAI or an intermediary returns only partial JSON per chunk of streamed data
|
80
|
+
- Huge thanks to [@atesgoral](https://github.com/atesgoral) for this important fix!
|
81
|
+
|
82
|
+
## [5.1.0] - 2023-08-20
|
83
|
+
|
84
|
+
### Added
|
85
|
+
|
86
|
+
- Added rough_token_count to estimate tokens in a string according to OpenAI's "rules of thumb". Thank you to [@jamiemccarthy](https://github.com/jamiemccarthy) for the idea and implementation!
|
87
|
+
|
88
|
+
## [5.0.0] - 2023-08-14
|
89
|
+
|
90
|
+
### Added
|
91
|
+
|
92
|
+
- Support multi-tenant use of the gem! Each client now holds its own config, so you can create unlimited clients in the same project, for example to Azure and OpenAI, or for different headers, access keys, etc.
|
93
|
+
- [BREAKING-ish] This change should only break your usage of ruby-openai if you are directly calling class methods like `OpenAI::Client.get` for some reason, as they are now instance methods. Normal usage of the gem should be unaffected, just you can make new clients and they'll keep their own config if you want, overriding the global config.
|
94
|
+
- Huge thanks to [@petergoldstein](https://github.com/petergoldstein) for his original work on this, [@cthulhu](https://github.com/cthulhu) for testing and many others for reviews and suggestions.
|
95
|
+
|
96
|
+
### Changed
|
97
|
+
|
98
|
+
- [BREAKING] Move audio related method to Audio model from Client model. You will need to update your code to handle this change, changing `client.translate` to `client.audio.translate` and `client.transcribe` to `client.audio.transcribe`.
|
99
|
+
|
100
|
+
## [4.3.2] - 2023-08-14
|
101
|
+
|
102
|
+
### Fixed
|
103
|
+
|
104
|
+
- Don't overwrite config extra-headers when making a client without different ones. Thanks to [@swistaczek](https://github.com/swistaczek) for raising this!
|
105
|
+
- Include extra-headers for Azure requests.
|
106
|
+
|
107
|
+
## [4.3.1] - 2023-08-13
|
108
|
+
|
109
|
+
### Fixed
|
110
|
+
|
111
|
+
- Tempfiles can now be sent to the API as well as Files, eg for Whisper. Thanks to [@codergeek121](https://github.com/codergeek121) for the fix!
|
112
|
+
|
113
|
+
## [4.3.0] - 2023-08-12
|
114
|
+
|
115
|
+
### Added
|
116
|
+
|
117
|
+
- Add extra-headers to config to allow setting openai-caching-proxy-worker TTL, Helicone Auth and anything else ya need. Ty to [@deltaguita](https://github.com/deltaguita) and [@marckohlbrugge](https://github.com/marckohlbrugge) for the PR!
|
118
|
+
|
119
|
+
## [4.2.0] - 2023-06-20
|
120
|
+
|
121
|
+
### Added
|
122
|
+
|
123
|
+
- Add Azure OpenAI Service support. Thanks to [@rmachielse](https://github.com/rmachielse) and [@steffansluis](https://github.com/steffansluis) for the PR and to everyone who requested this feature!
|
124
|
+
|
125
|
+
## [4.1.0] - 2023-05-15
|
126
|
+
|
127
|
+
### Added
|
128
|
+
|
129
|
+
- Add the ability to trigger any callable object as stream chunks come through, not just Procs. Big thanks to [@obie](https://github.com/obie) for this change.
|
130
|
+
|
131
|
+
## [4.0.0] - 2023-04-25
|
132
|
+
|
133
|
+
### Added
|
134
|
+
|
135
|
+
- Add the ability to stream Chat responses from the API! Thanks to everyone who requested this and made suggestions.
|
136
|
+
- Added instructions for streaming to the README.
|
137
|
+
|
138
|
+
### Changed
|
139
|
+
|
140
|
+
- Switch HTTP library from HTTParty to Faraday to allow streaming and future feature and performance improvements.
|
141
|
+
- [BREAKING] Endpoints now return JSON rather than HTTParty objects. You will need to update your code to handle this change, changing `JSON.parse(response.body)["key"]` and `response.parsed_response["key"]` to just `response["key"]`.
|
142
|
+
|
143
|
+
## [3.7.0] - 2023-03-25
|
144
|
+
|
145
|
+
### Added
|
146
|
+
|
147
|
+
- Allow the usage of proxy base URIs like https://www.helicone.ai/. Thanks to [@mmmaia](https://github.com/mmmaia) for the PR!
|
148
|
+
|
149
|
+
## [3.6.0] - 2023-03-22
|
150
|
+
|
151
|
+
### Added
|
152
|
+
|
153
|
+
- Add much-needed ability to increase HTTParty timeout, and set default to 120 seconds. Thanks to [@mbackermann](https://github.com/mbackermann) for the PR and to everyone who requested this!
|
154
|
+
|
155
|
+
## [3.5.0] - 2023-03-02
|
156
|
+
|
157
|
+
### Added
|
158
|
+
|
159
|
+
- Add Client#transcribe and Client translate endpoints - Whisper over the wire! Thanks to [@Clemalfroy](https://github.com/Clemalfroy)
|
160
|
+
|
161
|
+
## [3.4.0] - 2023-03-01
|
162
|
+
|
163
|
+
### Added
|
164
|
+
|
165
|
+
- Add Client#chat endpoint - ChatGPT over the wire!
|
166
|
+
|
167
|
+
## [3.3.0] - 2023-02-15
|
168
|
+
|
169
|
+
### Changed
|
170
|
+
|
171
|
+
- Replace ::Ruby::OpenAI namespace with ::OpenAI - thanks [@kmcphillips](https://github.com/kmcphillips) for this work!
|
172
|
+
- To upgrade, change `require 'ruby/openai'` to `require 'openai'` and change all references to `Ruby::OpenAI` to `OpenAI`.
|
173
|
+
|
174
|
+
## [3.2.0] - 2023-02-13
|
175
|
+
|
176
|
+
### Added
|
177
|
+
|
178
|
+
- Add Files#content endpoint - thanks [@unixneo](https://github.com/unixneo) for raising!
|
179
|
+
|
180
|
+
## [3.1.0] - 2023-02-13
|
181
|
+
|
182
|
+
### Added
|
183
|
+
|
184
|
+
- Add Finetunes#delete endpoint - thanks [@lancecarlson](https://github.com/lancecarlson) for flagging this.
|
185
|
+
- Add VCR header and body matching - thanks [@petergoldstein](https://github.com/petergoldstein)!
|
186
|
+
|
187
|
+
### Fixed
|
188
|
+
|
189
|
+
- Update File#upload specs to remove deprecated `answers` purpose.
|
190
|
+
|
191
|
+
## [3.0.3] - 2023-01-07
|
192
|
+
|
193
|
+
### Added
|
194
|
+
|
195
|
+
- Add ability to run the specs without VCR cassettes using `NO_VCR=true bundle exec rspec`.
|
196
|
+
- Add Ruby 3.2 to CircleCI config - thanks [@petergoldstein](https://github.com/petergoldstein)!
|
197
|
+
- A bit of detail added to the README on DALLE image sizes - thanks [@ndemianc](https://github.com/ndemianc)!
|
198
|
+
|
199
|
+
### Fixed
|
200
|
+
|
201
|
+
- Fix finetunes and files uploads endpoints - thanks [@chaadow](https://github.com/chaadow) for your PR on this and [@petergoldstein](https://github.com/petergoldstein) for the PR we ultimately went with.
|
202
|
+
|
203
|
+
## [3.0.2] - 2022-12-27
|
204
|
+
|
205
|
+
### Fixed
|
206
|
+
|
207
|
+
- Fixed Images#generate and Finetunes#create which were broken by a double call of to_json.
|
208
|
+
- Thanks [@konung](https://github.com/konung) for spotting this!
|
209
|
+
|
210
|
+
## [3.0.1] - 2022-12-26
|
211
|
+
|
212
|
+
### Removed
|
213
|
+
|
214
|
+
- [BREAKING] Remove deprecated answers, classifications, embeddings, engines and search endpoints.
|
215
|
+
- [BREAKING] Remove ability to pass engine to completions and embeddings outside of the parameters hash.
|
216
|
+
|
217
|
+
## [3.0.0] - 2022-12-26
|
218
|
+
|
219
|
+
### Added
|
220
|
+
|
221
|
+
- Add ability to set access_token via gem configuration.
|
222
|
+
- Thanks [@grjones](https://github.com/grjones) and [@aquaflamingo](https://github.com/aquaflamingo) for raising this and [@feministy](https://github.com/feministy) for the [excellent guide](https://github.com/feministy/lizabinante.com/blob/stable/source/2016-01-30-creating-a-configurable-ruby-gem.markdown#configuration-block-the-end-goal) to adding config to a gem.
|
223
|
+
|
224
|
+
### Removed
|
225
|
+
|
226
|
+
- [BREAKING] Remove ability to include access_token directly via ENV vars.
|
227
|
+
- [BREAKING] Remove ability to pass API version directly to endpoints.
|
228
|
+
|
229
|
+
## [2.3.0] - 2022-12-23
|
230
|
+
|
231
|
+
### Added
|
232
|
+
|
233
|
+
- Add Images#edit and Images#variations endpoint to modify images with DALL·E.
|
234
|
+
|
235
|
+
## [2.2.0] - 2022-12-15
|
236
|
+
|
237
|
+
### Added
|
238
|
+
|
239
|
+
- Add Organization ID to headers so users can charge credits to the correct organization.
|
240
|
+
- Thanks [@mridul911](https://github.com/mridul911) for raising this and [@maks112v](https://github.com/maks112v) for adding it!
|
241
|
+
|
242
|
+
## [2.1.0] - 2022-11-13
|
243
|
+
|
244
|
+
### Added
|
245
|
+
|
246
|
+
- Add Images#generate endpoint to generate images with DALL·E!
|
247
|
+
|
248
|
+
## [2.0.1] - 2022-10-22
|
249
|
+
|
250
|
+
### Removed
|
251
|
+
|
252
|
+
- Deprecate Client#answers endpoint.
|
253
|
+
- Deprecate Client#classifications endpoint.
|
254
|
+
|
255
|
+
## [2.0.0] - 2022-09-19
|
256
|
+
|
257
|
+
### Removed
|
258
|
+
|
259
|
+
- [BREAKING] Remove support for Ruby 2.5.
|
260
|
+
- [BREAKING] Remove support for passing `query`, `documents` or `file` as top-level parameters to `Client#search`.
|
261
|
+
- Deprecate Client#search endpoint.
|
262
|
+
- Deprecate Client#engines endpoints.
|
263
|
+
|
264
|
+
### Added
|
265
|
+
|
266
|
+
- Add Client#models endpoints to list and query available models.
|
267
|
+
|
268
|
+
## [1.5.0] - 2022-09-18
|
269
|
+
|
270
|
+
### Added
|
271
|
+
|
272
|
+
- Add Client#moderations endpoint to check OpenAI's Content Policy.
|
273
|
+
- Add Client#edits endpoints to transform inputs according to instructions.
|
274
|
+
|
275
|
+
## [1.4.0] - 2021-12-11
|
276
|
+
|
277
|
+
### Added
|
278
|
+
|
279
|
+
- Add Client#engines endpoints to list and query available engines.
|
280
|
+
- Add Client#finetunes endpoints to create and use fine-tuned models.
|
281
|
+
- Add Client#embeddings endpoint to get vector representations of inputs.
|
282
|
+
- Add tests and examples for more engines.
|
283
|
+
|
284
|
+
## [1.3.1] - 2021-07-14
|
285
|
+
|
286
|
+
### Changed
|
287
|
+
|
288
|
+
- Add backwards compatibility from Ruby 2.5+.
|
289
|
+
|
290
|
+
## [1.3.0] - 2021-04-18
|
291
|
+
|
292
|
+
### Added
|
293
|
+
|
294
|
+
- Add Client#classifications to predict the most likely labels based on examples or a file.
|
295
|
+
|
296
|
+
### Fixed
|
297
|
+
|
298
|
+
- Fixed Files#upload which was previously broken by the validation code!
|
299
|
+
|
300
|
+
## [1.2.2] - 2021-04-18
|
301
|
+
|
302
|
+
### Changed
|
303
|
+
|
304
|
+
- Add Client#search(parameters:) to allow passing `max_rerank` or `return_metadata`.
|
305
|
+
- Deprecate Client#search with query, file or document parameters at the top level.
|
306
|
+
- Thanks [@stevegeek](https://github.com/stevegeek) for pointing this issue out!
|
307
|
+
|
308
|
+
## [1.2.1] - 2021-04-11
|
309
|
+
|
310
|
+
### Added
|
311
|
+
|
312
|
+
- Add validation of JSONL files to make it easier to debug during upload.
|
313
|
+
|
314
|
+
## [1.2.0] - 2021-04-08
|
315
|
+
|
316
|
+
### Added
|
317
|
+
|
318
|
+
- Add Client#answers endpoint for question/answer response on documents or a file.
|
319
|
+
|
320
|
+
## [1.1.0] - 2021-04-07
|
321
|
+
|
322
|
+
### Added
|
323
|
+
|
324
|
+
- Add Client#files to allow file upload.
|
325
|
+
- Add Client#search(file:) so you can search a file.
|
326
|
+
|
327
|
+
## [1.0.0] - 2021-02-01
|
328
|
+
|
329
|
+
### Removed
|
330
|
+
|
331
|
+
- Remove deprecated method Client#call - use Client#completions instead.
|
332
|
+
|
333
|
+
### Changed
|
334
|
+
|
335
|
+
- Rename 'master' branch to 'main' branch.
|
336
|
+
- Bump dependencies.
|
337
|
+
|
338
|
+
## [0.3.0] - 2020-11-22
|
339
|
+
|
340
|
+
### Added
|
341
|
+
|
342
|
+
- Add Client#completions to allow all parameters.
|
343
|
+
|
344
|
+
### Changed
|
345
|
+
|
346
|
+
- Deprecate Client#call.
|
347
|
+
- Update README.
|
348
|
+
|
349
|
+
## [0.2.0] - 2020-11-22
|
350
|
+
|
351
|
+
### Added
|
352
|
+
|
353
|
+
- Add method to use the search endpoint.
|
354
|
+
|
355
|
+
## [0.1.4] - 2020-10-18
|
356
|
+
|
357
|
+
### Changed
|
358
|
+
|
359
|
+
- Bump Rubocop to 3.9.2.
|
360
|
+
- Bump Webmock to 3.9.1.
|
361
|
+
|
362
|
+
## [0.1.3] - 2020-09-09
|
363
|
+
|
364
|
+
### Changed
|
365
|
+
|
366
|
+
- Add ability to change API version in the future.
|
367
|
+
- Fix README typos.
|
368
|
+
|
369
|
+
## [0.1.2] - 2020-09-09
|
370
|
+
|
371
|
+
### Added
|
372
|
+
|
373
|
+
- Add tests and cached responses for the different engines.
|
374
|
+
- Add issue templates.
|
375
|
+
|
376
|
+
### Changed
|
377
|
+
|
378
|
+
- Add README instructions for using the gem without dotenv.
|
379
|
+
- Add list of engines to README.
|
380
|
+
|
381
|
+
## [0.1.1] - 2020-09-08
|
382
|
+
|
383
|
+
### Added
|
384
|
+
|
385
|
+
- Run Rubocop on pulls using CircleCI.
|
386
|
+
|
387
|
+
### Changed
|
388
|
+
|
389
|
+
- Clean up CircleCI config file.
|
390
|
+
|
391
|
+
## [0.1.0] - 2020-09-06
|
392
|
+
|
393
|
+
### Added
|
394
|
+
|
395
|
+
- Initialise repository.
|
396
|
+
- Add OpenAI::Client to connect to OpenAI API using user credentials.
|
397
|
+
- Add spec for Client with a cached response using VCR.
|
398
|
+
- Add CircleCI to run the specs on pull requests.
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at alexrudall@users.noreply.github.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
## Contributing
|
2
|
+
|
3
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/alexrudall/ruby-openai. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/alexrudall/ruby-openai/blob/main/CODE_OF_CONDUCT.md).
|
data/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Include gem dependencies from ruby-openai.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem "byebug", "~> 11.1.3"
|
7
|
+
gem "dotenv", "~> 2.8.1"
|
8
|
+
gem "rake", "~> 13.1"
|
9
|
+
gem "rspec", "~> 3.12"
|
10
|
+
gem "rubocop", "~> 1.50.2"
|
11
|
+
gem "vcr", "~> 6.1.0"
|
12
|
+
gem "webmock", "~> 3.19.1"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ruby-openai (6.5.0)
|
5
|
+
event_stream_parser (>= 0.3.0, < 2.0.0)
|
6
|
+
faraday (>= 1)
|
7
|
+
faraday-multipart (>= 1)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
addressable (2.8.5)
|
13
|
+
public_suffix (>= 2.0.2, < 6.0)
|
14
|
+
ast (2.4.2)
|
15
|
+
base64 (0.2.0)
|
16
|
+
byebug (11.1.3)
|
17
|
+
crack (0.4.5)
|
18
|
+
rexml
|
19
|
+
diff-lcs (1.5.0)
|
20
|
+
dotenv (2.8.1)
|
21
|
+
event_stream_parser (1.0.0)
|
22
|
+
faraday (2.7.12)
|
23
|
+
base64
|
24
|
+
faraday-net_http (>= 2.0, < 3.1)
|
25
|
+
ruby2_keywords (>= 0.0.4)
|
26
|
+
faraday-multipart (1.0.4)
|
27
|
+
multipart-post (~> 2)
|
28
|
+
faraday-net_http (3.0.2)
|
29
|
+
hashdiff (1.0.1)
|
30
|
+
json (2.6.3)
|
31
|
+
multipart-post (2.3.0)
|
32
|
+
parallel (1.22.1)
|
33
|
+
parser (3.2.2.0)
|
34
|
+
ast (~> 2.4.1)
|
35
|
+
public_suffix (5.0.3)
|
36
|
+
rainbow (3.1.1)
|
37
|
+
rake (13.1.0)
|
38
|
+
regexp_parser (2.8.0)
|
39
|
+
rexml (3.2.6)
|
40
|
+
rspec (3.12.0)
|
41
|
+
rspec-core (~> 3.12.0)
|
42
|
+
rspec-expectations (~> 3.12.0)
|
43
|
+
rspec-mocks (~> 3.12.0)
|
44
|
+
rspec-core (3.12.0)
|
45
|
+
rspec-support (~> 3.12.0)
|
46
|
+
rspec-expectations (3.12.2)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.12.0)
|
49
|
+
rspec-mocks (3.12.3)
|
50
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
+
rspec-support (~> 3.12.0)
|
52
|
+
rspec-support (3.12.0)
|
53
|
+
rubocop (1.50.2)
|
54
|
+
json (~> 2.3)
|
55
|
+
parallel (~> 1.10)
|
56
|
+
parser (>= 3.2.0.0)
|
57
|
+
rainbow (>= 2.2.2, < 4.0)
|
58
|
+
regexp_parser (>= 1.8, < 3.0)
|
59
|
+
rexml (>= 3.2.5, < 4.0)
|
60
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
61
|
+
ruby-progressbar (~> 1.7)
|
62
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
63
|
+
rubocop-ast (1.28.0)
|
64
|
+
parser (>= 3.2.1.0)
|
65
|
+
ruby-progressbar (1.13.0)
|
66
|
+
ruby2_keywords (0.0.5)
|
67
|
+
unicode-display_width (2.4.2)
|
68
|
+
vcr (6.1.0)
|
69
|
+
webmock (3.19.1)
|
70
|
+
addressable (>= 2.8.0)
|
71
|
+
crack (>= 0.3.2)
|
72
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
73
|
+
|
74
|
+
PLATFORMS
|
75
|
+
ruby
|
76
|
+
|
77
|
+
DEPENDENCIES
|
78
|
+
byebug (~> 11.1.3)
|
79
|
+
dotenv (~> 2.8.1)
|
80
|
+
rake (~> 13.1)
|
81
|
+
rspec (~> 3.12)
|
82
|
+
rubocop (~> 1.50.2)
|
83
|
+
ruby-openai!
|
84
|
+
vcr (~> 6.1.0)
|
85
|
+
webmock (~> 3.19.1)
|
86
|
+
|
87
|
+
BUNDLED WITH
|
88
|
+
2.4.5
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Alex
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|