You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
26
-[BREAKING] Backwards compatibility for `require "ruby/openai"` is removed - from v8 on you MUST use `require "openai"`. This fixes a deprecation warning with Ruby 3.4. Thanks to [@ndemianc](https://github.com/ndemianc) for this PR.
27
27
-[BREAKING] Removed support for Ruby 2.6. ruby-openai may still work with this version but it's no longer supported.
28
28
- Removed the 'OpenAI-Beta' header from Batches API requests.
29
-
- Removed the "Exploring chunks used in file search" speca & from the README as it no longer seems to work.
Copy file name to clipboardExpand all lines: README.md
+107
Original file line number
Diff line number
Diff line change
@@ -1344,6 +1344,113 @@ end
1344
1344
1345
1345
Note that you have 10 minutes to submit your tool output before the run expires.
1346
1346
1347
+
#### Exploring chunks used in File Search
1348
+
1349
+
Take a deep breath. You might need a drink for this one.
1350
+
1351
+
It's possible for OpenAI to share what chunks it used in its internal RAG Pipeline to create its filesearch results.
1352
+
1353
+
An example spec can be found [here](https://github.com/alexrudall/ruby-openai/blob/main/spec/openai/client/assistant_file_search_spec.rb) that does this, just so you know it's possible.
1354
+
1355
+
Here's how to get the chunks used in a file search. In this example I'm using [this file](https://css4.pub/2015/textbook/somatosensory.pdf):
1356
+
1357
+
```ruby
1358
+
require"openai"
1359
+
1360
+
# Make a client
1361
+
client =OpenAI::Client.new(
1362
+
access_token:"access_token_goes_here",
1363
+
log_errors:true# Don't log errors in production.
1364
+
)
1365
+
1366
+
# Upload your file(s)
1367
+
file_id = client.files.upload(
1368
+
parameters: {
1369
+
file:"path/to/somatosensory.pdf",
1370
+
purpose:"assistants"
1371
+
}
1372
+
)["id"]
1373
+
1374
+
# Create a vector store to store the vectorised file(s)
0 commit comments