Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.10.6"
".": "0.10.7"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 26
openapi_spec_hash: 6f6cb98b7755d18274dd51e857508336
config_hash: cc9a32249c08143687799eb8de187d6a
configured_endpoints: 27
openapi_spec_hash: c70c3eccfe803e99c14e97e650b1e314
config_hash: 1f7626e569e1a74574a58d7883170a0e
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.10.7 (2026-02-10)

Full Changelog: [v0.10.6...v0.10.7](https://github.com/openlayer-ai/openlayer-ruby/compare/v0.10.6...v0.10.7)

### Chores

* **closes OPEN-8647:** add endpoint to retrieve aggregated user data for inference pipelines ([5442bcb](https://github.com/openlayer-ai/openlayer-ruby/commit/5442bcbd5b6ab56d618fd36a985a7d864b65e7ae))

## 0.10.6 (2026-02-07)

Full Changelog: [v0.10.5...v0.10.6](https://github.com/openlayer-ai/openlayer-ruby/compare/v0.10.5...v0.10.6)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
openlayer (0.10.6)
openlayer (0.10.7)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "openlayer", "~> 0.10.6"
gem "openlayer", "~> 0.10.7"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/openlayer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
require_relative "openlayer/models/inference_pipeline_delete_params"
require_relative "openlayer/models/inference_pipeline_retrieve_params"
require_relative "openlayer/models/inference_pipeline_retrieve_response"
require_relative "openlayer/models/inference_pipeline_retrieve_users_params"
require_relative "openlayer/models/inference_pipeline_retrieve_users_response"
require_relative "openlayer/models/inference_pipelines/data_stream_params"
require_relative "openlayer/models/inference_pipelines/data_stream_response"
require_relative "openlayer/models/inference_pipelines/row_update_params"
Expand Down
2 changes: 2 additions & 0 deletions lib/openlayer/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ module Openlayer

InferencePipelineRetrieveParams = Openlayer::Models::InferencePipelineRetrieveParams

InferencePipelineRetrieveUsersParams = Openlayer::Models::InferencePipelineRetrieveUsersParams

InferencePipelines = Openlayer::Models::InferencePipelines

InferencePipelineUpdateParams = Openlayer::Models::InferencePipelineUpdateParams
Expand Down
30 changes: 30 additions & 0 deletions lib/openlayer/models/inference_pipeline_retrieve_users_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

module Openlayer
module Models
# @see Openlayer::Resources::InferencePipelines#retrieve_users
class InferencePipelineRetrieveUsersParams < Openlayer::Internal::Type::BaseModel
extend Openlayer::Internal::Type::RequestParameters::Converter
include Openlayer::Internal::Type::RequestParameters

# @!attribute page
# The page to return in a paginated query.
#
# @return [Integer, nil]
optional :page, Integer

# @!attribute per_page
# Maximum number of items to return per page.
#
# @return [Integer, nil]
optional :per_page, Integer

# @!method initialize(page: nil, per_page: nil, request_options: {})
# @param page [Integer] The page to return in a paginated query.
#
# @param per_page [Integer] Maximum number of items to return per page.
#
# @param request_options [Openlayer::RequestOptions, Hash{Symbol=>Object}]
end
end
end
77 changes: 77 additions & 0 deletions lib/openlayer/models/inference_pipeline_retrieve_users_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# frozen_string_literal: true

module Openlayer
module Models
# @see Openlayer::Resources::InferencePipelines#retrieve_users
class InferencePipelineRetrieveUsersResponse < Openlayer::Internal::Type::BaseModel
# @!attribute items
# Array of user aggregation data
#
# @return [Array<Openlayer::Models::InferencePipelineRetrieveUsersResponse::Item>]
required :items,
-> { Openlayer::Internal::Type::ArrayOf[Openlayer::Models::InferencePipelineRetrieveUsersResponse::Item] }

# @!method initialize(items:)
# @param items [Array<Openlayer::Models::InferencePipelineRetrieveUsersResponse::Item>] Array of user aggregation data

class Item < Openlayer::Internal::Type::BaseModel
# @!attribute id
# The unique user identifier
#
# @return [String]
required :id, String

# @!attribute cost
# Total cost for this user
#
# @return [Float]
required :cost, Float

# @!attribute date_of_first_record
# Timestamp of the user's first event/trace
#
# @return [Time]
required :date_of_first_record, Time, api_name: :dateOfFirstRecord

# @!attribute date_of_last_record
# Timestamp of the user's last event/trace
#
# @return [Time]
required :date_of_last_record, Time, api_name: :dateOfLastRecord

# @!attribute records
# Total number of traces/rows for this user
#
# @return [Integer]
required :records, Integer

# @!attribute sessions
# Count of unique sessions for this user
#
# @return [Integer]
required :sessions, Integer

# @!attribute tokens
# Total token count for this user
#
# @return [Float]
required :tokens, Float

# @!method initialize(id:, cost:, date_of_first_record:, date_of_last_record:, records:, sessions:, tokens:)
# @param id [String] The unique user identifier
#
# @param cost [Float] Total cost for this user
#
# @param date_of_first_record [Time] Timestamp of the user's first event/trace
#
# @param date_of_last_record [Time] Timestamp of the user's last event/trace
#
# @param records [Integer] Total number of traces/rows for this user
#
# @param sessions [Integer] Count of unique sessions for this user
#
# @param tokens [Float] Total token count for this user
end
end
end
end
30 changes: 30 additions & 0 deletions lib/openlayer/resources/inference_pipelines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,36 @@ def delete(inference_pipeline_id, params = {})
)
end

# Get aggregated user data for an inference pipeline with pagination and metadata.
#
# Returns a list of users who have interacted with the inference pipeline,
# including their activity statistics such as session counts, record counts, token
# usage, and costs.
#
# @overload retrieve_users(inference_pipeline_id, page: nil, per_page: nil, request_options: {})
#
# @param inference_pipeline_id [String] The inference pipeline id (a UUID).
#
# @param page [Integer] The page to return in a paginated query.
#
# @param per_page [Integer] Maximum number of items to return per page.
#
# @param request_options [Openlayer::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [Openlayer::Models::InferencePipelineRetrieveUsersResponse]
#
# @see Openlayer::Models::InferencePipelineRetrieveUsersParams
def retrieve_users(inference_pipeline_id, params = {})
parsed, options = Openlayer::InferencePipelineRetrieveUsersParams.dump_request(params)
@client.request(
method: :get,
path: ["inference-pipelines/%1$s/users", inference_pipeline_id],
query: parsed.transform_keys(per_page: "perPage"),
model: Openlayer::Models::InferencePipelineRetrieveUsersResponse,
options: options
)
end

# @api private
#
# @param client [Openlayer::Client]
Expand Down
2 changes: 1 addition & 1 deletion lib/openlayer/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Openlayer
VERSION = "0.10.6"
VERSION = "0.10.7"
end
3 changes: 3 additions & 0 deletions rbi/openlayer/models.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module Openlayer
InferencePipelineRetrieveParams =
Openlayer::Models::InferencePipelineRetrieveParams

InferencePipelineRetrieveUsersParams =
Openlayer::Models::InferencePipelineRetrieveUsersParams

InferencePipelines = Openlayer::Models::InferencePipelines

InferencePipelineUpdateParams =
Expand Down
60 changes: 60 additions & 0 deletions rbi/openlayer/models/inference_pipeline_retrieve_users_params.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# typed: strong

module Openlayer
module Models
class InferencePipelineRetrieveUsersParams < Openlayer::Internal::Type::BaseModel
extend Openlayer::Internal::Type::RequestParameters::Converter
include Openlayer::Internal::Type::RequestParameters

OrHash =
T.type_alias do
T.any(
Openlayer::InferencePipelineRetrieveUsersParams,
Openlayer::Internal::AnyHash
)
end

# The page to return in a paginated query.
sig { returns(T.nilable(Integer)) }
attr_reader :page

sig { params(page: Integer).void }
attr_writer :page

# Maximum number of items to return per page.
sig { returns(T.nilable(Integer)) }
attr_reader :per_page

sig { params(per_page: Integer).void }
attr_writer :per_page

sig do
params(
page: Integer,
per_page: Integer,
request_options: Openlayer::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(
# The page to return in a paginated query.
page: nil,
# Maximum number of items to return per page.
per_page: nil,
request_options: {}
)
end

sig do
override.returns(
{
page: Integer,
per_page: Integer,
request_options: Openlayer::RequestOptions
}
)
end
def to_hash
end
end
end
end
Loading