stability_sdk 0.2.12 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e707d41b381676dfbc958975bae028b82a52a7828529c52db7809db125791e9
|
4
|
+
data.tar.gz: 9e7aafbd1c0e5638ad2bc860312e55a0b2973ec3c8423fa050730cfa15887efa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37cb8a18a1accb3cf30f6dc780781f71dfe75ad648713a2c335d1b2be41f7546c0450d88ec0ae833354db24a3d3659fe0ac8163d1f3a1a076f08e8e344282c9c
|
7
|
+
data.tar.gz: aa66ce05d53d3d5bd6aa661f752a5d71f61c9835804d69f38834e07bc4e5259d971816eb4d4061264cfadc9a825a425b0469c794369eb48c1080cdbf1d1342d3
|
data/README.md
CHANGED
@@ -107,23 +107,29 @@ client.generate(prompt, options) do |answer|
|
|
107
107
|
end
|
108
108
|
```
|
109
109
|
|
110
|
-
###
|
111
|
-
|
112
|
-
**This feature is in a very early stage of development.**
|
110
|
+
### Dashboard API
|
113
111
|
|
114
112
|
Dashboard API is a way to interact with DreamStudio Web UIs, such as getting user info, payment info, etc.
|
115
113
|
|
116
|
-
Currently,
|
114
|
+
Currently, the API key is only allowed as read-only. And this client supports only GetMe and GetOrganization actions. See also https://github.com/Stability-AI/stability-sdk/issues/23
|
117
115
|
|
118
116
|
```sh
|
119
117
|
# get user info
|
120
|
-
STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client
|
118
|
+
STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client get_me
|
121
119
|
|
122
120
|
# get organization info
|
123
|
-
STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client
|
121
|
+
STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client get_organization
|
124
122
|
|
125
123
|
# i.e, get remaining balance
|
126
|
-
STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client
|
124
|
+
STABILITY_SDK_DASHBOARD_API_KEY=YOUR_API_KEY stability-dashboard-client get_organization | jq .paymentInfo.balance
|
125
|
+
```
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
require "stability_sdk"
|
129
|
+
|
130
|
+
client = StabilitySDK::DashboardClient.new(api_key: "your api key")
|
131
|
+
res = client.get_organization
|
132
|
+
p res.payment_info.balance # prints a remaining balance
|
127
133
|
```
|
128
134
|
|
129
135
|
## Development
|
@@ -33,7 +33,7 @@ class CLI < Thor
|
|
33
33
|
api_key = ENV["STABILITY_SDK_DASHBOARD_API_KEY"] if ENV["STABILITY_SDK_DASHBOARD_API_KEY"]
|
34
34
|
raise StabilitySDK::InsufficientParameter, "api key is required" if api_key.nil?
|
35
35
|
|
36
|
-
return StabilitySDK::
|
36
|
+
return StabilitySDK::DashboardClient.new(api_key: api_key)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
data/lib/stability_sdk.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stability_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosei Moriyama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|
@@ -92,7 +92,7 @@ email:
|
|
92
92
|
- cou929@gmail.com
|
93
93
|
executables:
|
94
94
|
- stability-client
|
95
|
-
- stability-dashboard-client
|
95
|
+
- stability-dashboard-client
|
96
96
|
extensions: []
|
97
97
|
extra_rdoc_files: []
|
98
98
|
files:
|
@@ -106,7 +106,7 @@ files:
|
|
106
106
|
- bin/console
|
107
107
|
- bin/setup
|
108
108
|
- exe/stability-client
|
109
|
-
- exe/stability-dashboard-client
|
109
|
+
- exe/stability-dashboard-client
|
110
110
|
- lib/dashboard_pb.rb
|
111
111
|
- lib/dashboard_services_pb.rb
|
112
112
|
- lib/generation_pb.rb
|
@@ -114,7 +114,7 @@ files:
|
|
114
114
|
- lib/stability_sdk.rb
|
115
115
|
- lib/stability_sdk/cli.rb
|
116
116
|
- lib/stability_sdk/client.rb
|
117
|
-
- lib/stability_sdk/
|
117
|
+
- lib/stability_sdk/dashboard_client.rb
|
118
118
|
- lib/stability_sdk/version.rb
|
119
119
|
- stability_sdk.gemspec
|
120
120
|
homepage: https://github.com/cou929/stability-sdk-ruby
|