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: d5aac33cb8d504aab26b515dc2fa6bd9d76c70829a0aa706eabc6be39043b143
4
- data.tar.gz: ca6a3cd1cd24763a9f9427132a4e8fde4c688d9bc9d3409ef921139fa62fa232
3
+ metadata.gz: 3e707d41b381676dfbc958975bae028b82a52a7828529c52db7809db125791e9
4
+ data.tar.gz: 9e7aafbd1c0e5638ad2bc860312e55a0b2973ec3c8423fa050730cfa15887efa
5
5
  SHA512:
6
- metadata.gz: 95b76f6caf8e5a32af792cc0d284f81b76c7e38c682b24a5fc91204b3373096a47a98ab1ee6f0e32cbbd2039ad6b57c920c262661cda221c54eac529bd54e51a
7
- data.tar.gz: f196c8b879b36e69c84d40c2528fd9fbf7f07e1ae6eec9c4a996a66a8a73841ea50d73d8ca941b7813ca9d5fbada94140143619bdb841de4ce9f71316af1303e
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
- ### [Unstable] Dashboard API
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, there is no canonical way to get the API key for the Dashboard API. You can retrieve the key by logging in to the [DreamStudio Web page](https://beta.dreamstudio.ai/dream) and inspect request the authorization header with Chrome Developer Tool. Please be aware that how to refresh the key or an expiration period is unknown. See also https://github.com/Stability-AI/stability-sdk/issues/23
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-unstable get_me
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-unstable get_organization
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-unstable get_organization | jq .paymentInfo.balance
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::Unstable::DashboardClient.new(api_key: api_key)
36
+ return StabilitySDK::DashboardClient.new(api_key: api_key)
37
37
  end
38
38
  end
39
39
 
@@ -1,7 +1,7 @@
1
1
  require "grpc"
2
2
  require "dashboard_services_pb"
3
3
 
4
- module StabilitySDK::Unstable
4
+ module StabilitySDK
5
5
  class DashboardClient
6
6
  DEFAULT_API_HOST = "grpc.stability.ai:443"
7
7
 
@@ -1,3 +1,3 @@
1
1
  module StabilitySDK
2
- VERSION = "0.2.12"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/stability_sdk.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "stability_sdk/version"
2
2
  require "stability_sdk/client"
3
3
  require "stability_sdk/cli"
4
- require "stability_sdk/unstable/dashboard_client"
4
+ require "stability_sdk/dashboard_client"
5
5
 
6
6
  module StabilitySDK
7
7
  class Error < StandardError; end
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.2.12
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-10-31 00:00:00.000000000 Z
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-unstable
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-unstable
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/unstable/dashboard_client.rb
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