cloudflare-ai 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -0
- data/lib/cloudflare/ai/models.rb +1 -1
- data/lib/cloudflare/ai/results/image_to_text.rb +3 -1
- data/lib/cloudflare/ai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0dbb7a703cef587e4c132ced954abc6be79bb903fe6e2b1d531ae8a1bd22ad9
|
4
|
+
data.tar.gz: f59a67ae6ff4785994269a65bce16f3bc22d284dfc3fcdac5d4d846b70e5e2b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ab260777dfdfb4427f20e06c2a3522226db63bd869a627ed0abbd7c83948d33f37585f2249c1417ae590b0267934b5ce9e7444df03df95fad8b4d1334c0a12
|
7
|
+
data.tar.gz: 1716e968bf8f7694de57eadf3b003a5e4cd76cb25b240112a8561830c2fe16cd17a769af02662024edb32efc860675520356431cd2dd8cfc132db58ae7c8a165
|
data/README.md
CHANGED
@@ -194,6 +194,36 @@ result = client.transcribe(audio: File.open("/path/to/audio.wav"))
|
|
194
194
|
#### Result object
|
195
195
|
All invocations of the `transcribe` method returns a `Cloudflare::AI::Results::Transcribe`.
|
196
196
|
|
197
|
+
### Summarization
|
198
|
+
```ruby
|
199
|
+
result = client.summarize(text: "This text should be a lot longer.")
|
200
|
+
p result.summary # => {"result":{"summary":"Short text"},"success":true,"errors":[],"messages":[]}
|
201
|
+
```
|
202
|
+
#### Result object
|
203
|
+
All invocations of the `summarize` method returns a `Cloudflare::AI::Results::Summarization` object.
|
204
|
+
|
205
|
+
### Object detection
|
206
|
+
The object detection endpoint accepts either a path to a file or a file stream.
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
result = client.detect_objects(image: "/path/to/cat.jpg")
|
210
|
+
result = client.classify(image: File.open("/path/to/cat.jpg"))
|
211
|
+
```
|
212
|
+
|
213
|
+
#### Result object
|
214
|
+
All invocations of the `detect_objects` method returns a `Cloudflare::AI::Results::ObjectDetection` object.
|
215
|
+
|
216
|
+
### Image-to-text
|
217
|
+
The captioning endpoint accepts either a path to a file or a file stream.
|
218
|
+
|
219
|
+
```ruby
|
220
|
+
client.caption(image: "/path/to/cat.jpg").description # => "a cat sitting on a couch"
|
221
|
+
client.caption(image: File.open("/path/to/cat.jpg")).description # => "a cat sitting on a couch"
|
222
|
+
```
|
223
|
+
|
224
|
+
#### Result object
|
225
|
+
All invocations of the `caption` method returns a `Cloudflare::AI::Results::ImageToText` object.
|
226
|
+
|
197
227
|
# Logging
|
198
228
|
|
199
229
|
This gem uses standard logging mechanisms and defaults to `:warn` level. Most messages are at info level, but we will add debug or warn statements as needed.
|
data/lib/cloudflare/ai/models.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudflare-ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajay Krishnan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|