inplay_ai 0.1.5 → 0.1.6
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 +4 -4
- data/lib/inplay_ai/version.rb +1 -1
- data/lib/inplay_ai.rb +7 -3
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 35c8d35b3b133ad10262cad807444dfd1ed802fe79a8c053f1e40cf3776e9c9d
|
|
4
|
+
data.tar.gz: ab4701e0eff0c6d280b0fd274f613db1277a6e4e8d233622823d5b9a7dfaa61b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b77866a32f808f2a2f2e497d0ee2465820277f4526f03ab9f117a036ed5bfa96571de6b0fddcec3dbac94d2496a57ae9c11a4500c945cb2283a6a2f5446898c1
|
|
7
|
+
data.tar.gz: d6a5f93cb788788c4cb510deaba13ac6352c01342e87e9928b815b1da1c5af101e472aa3eff4c1cc860e0beca8e344ea8396e24123dc4365bf7fd56e81115f16
|
data/lib/inplay_ai/version.rb
CHANGED
data/lib/inplay_ai.rb
CHANGED
|
@@ -10,12 +10,12 @@ module InplayAi
|
|
|
10
10
|
class Client
|
|
11
11
|
DEFAULT_API_URL = "https://api.inplay.ai"
|
|
12
12
|
|
|
13
|
-
def initialize(api_key: nil, api_url: nil)
|
|
13
|
+
def initialize(api_key: nil, api_url: nil, connect_timeout: 2, write_timeout: 5, read_timeout: 5)
|
|
14
14
|
@api_key = api_key || ENV["INPLAY_API_KEY"]
|
|
15
15
|
raise Error, "API key must be provided via api_key or INPLAY_API_KEY environment variable" unless @api_key
|
|
16
16
|
raw_url = api_url || ENV["INPLAY_API_URL"]
|
|
17
17
|
@api_url = (raw_url ? raw_url.sub(/\/$/, "") : DEFAULT_API_URL)
|
|
18
|
-
@http = HTTP.
|
|
18
|
+
@http = HTTP.timeout(connect: connect_timeout, write: write_timeout, read: read_timeout).headers(
|
|
19
19
|
"x-api-key" => @api_key,
|
|
20
20
|
"Content-Type" => "application/json"
|
|
21
21
|
)
|
|
@@ -52,6 +52,10 @@ module InplayAi
|
|
|
52
52
|
post("/v1/metadata/event", data)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
def screen(data)
|
|
56
|
+
post("/v1/ai/screen", data)
|
|
57
|
+
end
|
|
58
|
+
|
|
55
59
|
# Thread-safe per-thread singleton instance
|
|
56
60
|
def self.instance
|
|
57
61
|
Thread.current[:inplay_ai_client] ||= new
|
|
@@ -60,7 +64,7 @@ module InplayAi
|
|
|
60
64
|
private
|
|
61
65
|
|
|
62
66
|
def post(path, data)
|
|
63
|
-
res = @http.post(path, json: data)
|
|
67
|
+
res = @http.post("#{@api_url}#{path}", json: data)
|
|
64
68
|
if res.status >= 400
|
|
65
69
|
begin
|
|
66
70
|
err = JSON.parse(res.body.to_s)
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inplay_ai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- InPlay AI
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-03-28 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: http
|
|
@@ -40,6 +41,7 @@ licenses:
|
|
|
40
41
|
metadata:
|
|
41
42
|
allowed_push_host: https://rubygems.org
|
|
42
43
|
homepage_uri: https://inplay.ai
|
|
44
|
+
post_install_message:
|
|
43
45
|
rdoc_options: []
|
|
44
46
|
require_paths:
|
|
45
47
|
- lib
|
|
@@ -54,7 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
54
56
|
- !ruby/object:Gem::Version
|
|
55
57
|
version: '0'
|
|
56
58
|
requirements: []
|
|
57
|
-
rubygems_version: 3.
|
|
59
|
+
rubygems_version: 3.0.3.1
|
|
60
|
+
signing_key:
|
|
58
61
|
specification_version: 4
|
|
59
62
|
summary: InPlay AI SDK for Ruby
|
|
60
63
|
test_files: []
|