ruby-openai-transitory-v2 6.5.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: de3c702233f8aaddbb49c3ddf0caa4cce26e63c6a3d4f7fbfacca25a6b6cd5ff
|
4
|
+
data.tar.gz: 5b81d0e61d2b302682a966959da64838958092b376fbc94e32803f605d80adf5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 92eff2aafb1202b68b73e42439945f071db2321ed510010a7f96d2ad48a656adf4d8be18686c8d2721f081201475eab94a2d3993dc43c42395e739a94c814ef1
|
7
|
+
data.tar.gz: 6ce59a8002fda9a293ef86749c3fb92c53cfa99d51f41758196437439bf3385ce78509529bf5433fbc821d430343f159f808c27d5a96b845af5d2a1297c0740a
|
@@ -0,0 +1,45 @@
|
|
1
|
+
version: 2.1 # Use 2.1 to enable using orbs and other features.
|
2
|
+
|
3
|
+
# Declare the orbs that we'll use in our config.
|
4
|
+
orbs:
|
5
|
+
ruby: circleci/ruby@1.0
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
rubocop:
|
9
|
+
parallelism: 1
|
10
|
+
docker:
|
11
|
+
- image: cimg/ruby:3.1-node
|
12
|
+
steps:
|
13
|
+
- checkout
|
14
|
+
- ruby/install-deps
|
15
|
+
- run:
|
16
|
+
name: Run Rubocop
|
17
|
+
command: bundle exec rubocop
|
18
|
+
test:
|
19
|
+
parameters:
|
20
|
+
ruby-image:
|
21
|
+
type: string
|
22
|
+
parallelism: 1
|
23
|
+
docker:
|
24
|
+
- image: << parameters.ruby-image >>
|
25
|
+
steps:
|
26
|
+
- checkout
|
27
|
+
- ruby/install-deps
|
28
|
+
- run:
|
29
|
+
name: Run tests
|
30
|
+
command: bundle exec rspec -fd
|
31
|
+
|
32
|
+
workflows:
|
33
|
+
version: 2
|
34
|
+
checks:
|
35
|
+
jobs:
|
36
|
+
- rubocop
|
37
|
+
- test:
|
38
|
+
matrix:
|
39
|
+
parameters:
|
40
|
+
ruby-image:
|
41
|
+
- cimg/ruby:2.6-node
|
42
|
+
- cimg/ruby:2.7-node
|
43
|
+
- cimg/ruby:3.0-node
|
44
|
+
- cimg/ruby:3.1-node
|
45
|
+
- cimg/ruby:3.2-node
|
@@ -0,0 +1,16 @@
|
|
1
|
+
FROM ruby:3.2.2-slim-bullseye
|
2
|
+
|
3
|
+
ENV TZ="Europe/London"
|
4
|
+
|
5
|
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
6
|
+
&& apt-get -y install --no-install-recommends \
|
7
|
+
apt-utils \
|
8
|
+
build-essential \
|
9
|
+
curl \
|
10
|
+
git \
|
11
|
+
vim \
|
12
|
+
zsh
|
13
|
+
|
14
|
+
RUN gem install bundler
|
15
|
+
|
16
|
+
WORKDIR /workspace
|
@@ -0,0 +1,36 @@
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
2
|
+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ruby-rails-postgres
|
3
|
+
// Update the VARIANT arg in docker-compose.yml to pick a Ruby version
|
4
|
+
{
|
5
|
+
"name": "ruby-openai",
|
6
|
+
"dockerComposeFile": "docker-compose.yml",
|
7
|
+
"service": "app",
|
8
|
+
"workspaceFolder": "/workspace",
|
9
|
+
"containerEnv": {
|
10
|
+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
|
11
|
+
"GITHUB_USER": "${localEnv:GITHUB_USER}"
|
12
|
+
},
|
13
|
+
// Configure tool-specific properties.
|
14
|
+
"customizations": {
|
15
|
+
// Configure properties specific to VS Code.
|
16
|
+
"vscode": {
|
17
|
+
// Add the IDs of extensions you want installed when the container is created.
|
18
|
+
"extensions": [
|
19
|
+
"rebornix.Ruby",
|
20
|
+
"sleistner.vscode-fileutils",
|
21
|
+
"ms-azuretools.vscode-docker",
|
22
|
+
"samverschueren.final-newline",
|
23
|
+
"GitHub.copilot",
|
24
|
+
"usernamehw.remove-empty-lines",
|
25
|
+
"wingrunr21.vscode-ruby",
|
26
|
+
]
|
27
|
+
}
|
28
|
+
},
|
29
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
30
|
+
"postCreateCommand": "bundle install",
|
31
|
+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
32
|
+
"features": {
|
33
|
+
"git": "os-provided",
|
34
|
+
"github-cli": "latest"
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
version: "3"
|
2
|
+
|
3
|
+
services:
|
4
|
+
app:
|
5
|
+
build:
|
6
|
+
context: ..
|
7
|
+
dockerfile: .devcontainer/Dockerfile
|
8
|
+
|
9
|
+
volumes:
|
10
|
+
- ..:/workspace:cached
|
11
|
+
- bundle_cache:/bundle
|
12
|
+
|
13
|
+
command: sleep infinity
|
14
|
+
|
15
|
+
environment:
|
16
|
+
TZ: Europe/London
|
17
|
+
|
18
|
+
volumes:
|
19
|
+
bundle_cache:
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# These are supported funding model platforms
|
2
|
+
|
3
|
+
github: alexrudall
|
4
|
+
patreon: # Replace with a single Patreon username
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
11
|
+
otechie: # Replace with a single Otechie username
|
12
|
+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
13
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
25
|
+
|
26
|
+
**Desktop (please complete the following information):**
|
27
|
+
- OS: [e.g. iOS]
|
28
|
+
- Browser [e.g. chrome, safari]
|
29
|
+
- Version [e.g. 22]
|
30
|
+
|
31
|
+
**Smartphone (please complete the following information):**
|
32
|
+
- Device: [e.g. iPhone6]
|
33
|
+
- OS: [e.g. iOS8.1]
|
34
|
+
- Browser [e.g. stock browser, safari]
|
35
|
+
- Version [e.g. 22]
|
36
|
+
|
37
|
+
**Additional context**
|
38
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
open-pull-requests-limit: 10
|
8
|
+
ignore:
|
9
|
+
- dependency-name: webmock
|
10
|
+
versions:
|
11
|
+
- 3.11.1
|
12
|
+
- 3.11.3
|
13
|
+
- dependency-name: rspec
|
14
|
+
versions:
|
15
|
+
- 3.10.0
|
data/.gitignore
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
### Ruby ###
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
/.config
|
5
|
+
/coverage/
|
6
|
+
/InstalledFiles
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/spec/examples.txt
|
10
|
+
/test/tmp/
|
11
|
+
/test/version_tmp/
|
12
|
+
/tmp/
|
13
|
+
/.bundle/
|
14
|
+
/.yardoc
|
15
|
+
/_yardoc/
|
16
|
+
/doc/
|
17
|
+
|
18
|
+
|
19
|
+
# Used by dotenv library to load environment variables.
|
20
|
+
.env
|
21
|
+
|
22
|
+
# Ignore Byebug command history file.
|
23
|
+
.byebug_history
|
24
|
+
|
25
|
+
## Specific to RubyMotion:
|
26
|
+
.dat*
|
27
|
+
.repl_history
|
28
|
+
build/
|
29
|
+
*.bridgesupport
|
30
|
+
build-iPhoneOS/
|
31
|
+
build-iPhoneSimulator/
|
32
|
+
|
33
|
+
## Specific to RubyMotion (use of CocoaPods):
|
34
|
+
#
|
35
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
36
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
37
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
38
|
+
# vendor/Pods/
|
39
|
+
|
40
|
+
## Documentation cache and generated files:
|
41
|
+
/.yardoc/
|
42
|
+
/_yardoc/
|
43
|
+
/doc/
|
44
|
+
/rdoc/
|
45
|
+
|
46
|
+
## Environment normalization:
|
47
|
+
/.bundle/
|
48
|
+
/vendor/bundle
|
49
|
+
/lib/bundler/man/
|
50
|
+
|
51
|
+
# for a library or gem, you might want to ignore these files since the code is
|
52
|
+
# intended to run in multiple environments; otherwise, check them in:
|
53
|
+
# Gemfile.lock
|
54
|
+
# .ruby-version
|
55
|
+
# .ruby-gemset
|
56
|
+
|
57
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
58
|
+
.rvmrc
|
59
|
+
|
60
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
61
|
+
# .rubocop-https?--*
|
62
|
+
|
63
|
+
# rspec failure tracking
|
64
|
+
.rspec_status
|
65
|
+
|
66
|
+
# IDE
|
67
|
+
.idea
|
68
|
+
.idea/
|
69
|
+
.idea/*
|
70
|
+
.vscode
|
71
|
+
.vs/
|
72
|
+
|
73
|
+
# Mac
|
74
|
+
.DS_Store
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
NewCops: enable
|
4
|
+
SuggestExtensions: false
|
5
|
+
|
6
|
+
Style/Documentation:
|
7
|
+
# Skips checking to make sure top level modules / classes have a comment.
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Layout/LineLength:
|
11
|
+
Max: 100
|
12
|
+
Exclude:
|
13
|
+
- "**/*.gemspec"
|
14
|
+
|
15
|
+
Lint/AmbiguousOperator:
|
16
|
+
# https://github.com/rubocop/rubocop/issues/4294
|
17
|
+
Exclude:
|
18
|
+
- "lib/openai/client.rb"
|
19
|
+
|
20
|
+
Metrics/AbcSize:
|
21
|
+
Max: 20
|
22
|
+
|
23
|
+
Metrics/BlockLength:
|
24
|
+
Exclude:
|
25
|
+
- "spec/**/*"
|
26
|
+
|
27
|
+
Style/StringLiterals:
|
28
|
+
EnforcedStyle: double_quotes
|
29
|
+
|
30
|
+
Style/FrozenStringLiteralComment:
|
31
|
+
Enabled: false
|