Skip to content
Open
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
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]
### Added
### Changed
- Update rubygems public key setting expiry to 20260707 ([#308](https://github.com/opensearch-project/opensearch-ruby/pull/308))
### Deprecated
### Removed
### Fixed
Expand All @@ -16,16 +15,22 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added a workflow to generate API methods from OpenSearch API Spec ([261](https://github.com/opensearch-project/opensearch-ruby/pull/261))
- Added support for Ruby 3.4 ([#265](https://github.com/opensearch-project/opensearch-ruby/pull/265))
- Added ability to sign requests ([#281](https://github.com/opensearch-project/opensearch-ruby/pull/281))
- Added `ml` memory container, agentic memory, and streaming actions (`create_memory_container`, `add_agentic_memory`, `search_agentic_memory`, `execute_agent_stream`, `predict_model_stream`, `execute_tool`, and related) from the latest OpenSearch API spec
- Added `search_relevance` scheduled experiment actions (`get_scheduled_experiments`, `post_scheduled_experiments`, `delete_scheduled_experiments`) from the latest OpenSearch API spec
### Changed
- Restructured the API methods and modules to be more efficient and intuitive ([261](https://github.com/opensearch-project/opensearch-ruby/pull/261))
- Moved ignore-404-on-deletion feature into the client options ([#277](https://github.com/opensearch-project/opensearch-ruby/pull/277))
- Changed the default json serializer from `multi_json` to the `json` gem ([#290](https://github.com/opensearch-project/opensearch-ruby/pull/290))
- Updated the API to reflect the latest OpenSearch API spec ([#271](https://github.com/opensearch-project/opensearch-ruby/pull/271), [#276](https://github.com/opensearch-project/opensearch-ruby/pull/276), [#279](https://github.com/opensearch-project/opensearch-ruby/pull/279), [#280](https://github.com/opensearch-project/opensearch-ruby/pull/280), [#282](https://github.com/opensearch-project/opensearch-ruby/pull/282), [#284](https://github.com/opensearch-project/opensearch-ruby/pull/284), [#286](https://github.com/opensearch-project/opensearch-ruby/pull/286), [#296](https://github.com/opensearch-project/opensearch-ruby/pull/296), [#299](https://github.com/opensearch-project/opensearch-ruby/pull/299), [#314](https://github.com/opensearch-project/opensearch-ruby/pull/314), [#318](https://github.com/opensearch-project/opensearch-ruby/pull/318), [#320](https://github.com/opensearch-project/opensearch-ruby/pull/320)) and regenerated against the latest spec for the 4.0.0 release, adding a `msearch` `allow_partial_results` parameter
- Wrapped unreachable host exceptions in `OpenSearch::Transport::Transport::Error` ([#317](https://github.com/opensearch-project/opensearch-ruby/pull/317))
- Only require what is necessary from `cgi` for Ruby 3.5 ([#298](https://github.com/opensearch-project/opensearch-ruby/pull/298))
- Update rubygems public key setting expiry to 20260707 ([#308](https://github.com/opensearch-project/opensearch-ruby/pull/308))
- Update RubyGems signing certificate ([#330](https://github.com/opensearch-project/opensearch-ruby/pull/330))
### Removed
- Removed support for Ruby 2.x ([261](https://github.com/opensearch-project/opensearch-ruby/pull/261))
- Removed the ability to ignore any error code by passing the `ignore: Array<error_code>` to each API method invocation ([#277](https://github.com/opensearch-project/opensearch-ruby/pull/277))
- Removed ability to set `X-Opaque-Id` header value via the `opaque_id` parameter. ([#287](https://github.com/opensearch-project/opensearch-ruby/pull/287))
- Removed support for Faraday 1.x. ([#293](https://github.com/opensearch-project/opensearch-ruby/pull/293))
- Wrapped unreachable host exceptions in `OpenSearch::Transport::Transport::Error`. ([#317](https://github.com/opensearch-project/opensearch-ruby/pull/317))

## [3.4.0]
### Added
Expand Down
37 changes: 37 additions & 0 deletions lib/opensearch/api/actions/ml/add_agentic_memory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Add agentic memory to a memory container.
#
# @option args [String] :memory_container_id *Required*
# @option args [Hash] :body
def add_agentic_memory(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil?

_memory_container_id = args.delete('memory_container_id')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'POST'
url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories')

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
32 changes: 32 additions & 0 deletions lib/opensearch/api/actions/ml/create_memory_container.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Create a memory container.
#
# @option args [Hash] :body
def create_memory_container(args = {})
args = Utils.clone_and_normalize_arguments(args)
headers = args.delete('headers') || {}
body = args.delete('body')
method = 'POST'
url = '_plugins/_ml/memory_containers/_create'

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Create session in a memory container.
#
# @option args [String] :memory_container_id *Required*
# @option args [Hash] :body
def create_memory_container_session(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil?

_memory_container_id = args.delete('memory_container_id')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'POST'
url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories/sessions')

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
42 changes: 42 additions & 0 deletions lib/opensearch/api/actions/ml/delete_agentic_memory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Delete a specific memory by its type and ID.
#
# @option args [String] :id *Required*
# @option args [String] :memory_container_id *Required*
# @option args [String] :type *Required*
def delete_agentic_memory(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'id' missing" if args['id'].nil?
raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil?
raise ArgumentError, "Required argument 'type' missing" if args['type'].nil?

_id = args.delete('id')
_memory_container_id = args.delete('memory_container_id')
_type = args.delete('type')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'DELETE'
url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, _id)

Utils.validate_query_params! args
transport.perform_delete_request method, url, args, body, headers
end
end
end
end
end
40 changes: 40 additions & 0 deletions lib/opensearch/api/actions/ml/delete_agentic_memory_query.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Delete multiple memories using a query to match specific criteria.
#
# @option args [String] :memory_container_id *Required*
# @option args [String] :type *Required*
# @option args [Hash] :body
def delete_agentic_memory_query(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil?
raise ArgumentError, "Required argument 'type' missing" if args['type'].nil?

_memory_container_id = args.delete('memory_container_id')
_type = args.delete('type')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'POST'
url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, '_delete_by_query')

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
43 changes: 43 additions & 0 deletions lib/opensearch/api/actions/ml/delete_memory_container.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Delete a memory container.
#
# @option args [String] :memory_container_id *Required*
# @option args [Boolean] :delete_all_memories
# @option args [Enumerable<String>] :delete_memories
def delete_memory_container(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil?

_memory_container_id = args.delete('memory_container_id')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'DELETE'
url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id)

Utils.validate_query_params! args, DELETE_MEMORY_CONTAINER_QUERY_PARAMS
transport.perform_delete_request method, url, args, body, headers
end

DELETE_MEMORY_CONTAINER_QUERY_PARAMS = Set.new(%w[
delete_all_memories
delete_memories
]).freeze
end
end
end
end
37 changes: 37 additions & 0 deletions lib/opensearch/api/actions/ml/execute_agent_stream.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Execute an agent in streaming mode.
#
# @option args [String] :agent_id *Required*
# @option args [Hash] :body
def execute_agent_stream(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'agent_id' missing" if args['agent_id'].nil?

_agent_id = args.delete('agent_id')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'POST'
url = Utils.build_url('_plugins/_ml/agents', _agent_id, '_execute/stream')

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
37 changes: 37 additions & 0 deletions lib/opensearch/api/actions/ml/execute_tool.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Execute a tool.
#
# @option args [String] :tool_name *Required*
# @option args [Hash] :body
def execute_tool(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'tool_name' missing" if args['tool_name'].nil?

_tool_name = args.delete('tool_name')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'POST'
url = Utils.build_url('_plugins/_ml/tools/_execute', _tool_name)

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
42 changes: 42 additions & 0 deletions lib/opensearch/api/actions/ml/get_agentic_memory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

# This file is generated from the OpenSearch REST API spec.
# Do not modify it by hand. Instead, modify the generator or the spec.

# frozen_string_literal: true

module OpenSearch
module API
module Ml
module Actions
# Get a specific memory by its type and ID.
#
# @option args [String] :id *Required*
# @option args [String] :memory_container_id *Required*
# @option args [String] :type *Required*
def get_agentic_memory(args = {})
args = Utils.clone_and_normalize_arguments(args)
raise ArgumentError, "Required argument 'id' missing" if args['id'].nil?
raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil?
raise ArgumentError, "Required argument 'type' missing" if args['type'].nil?

_id = args.delete('id')
_memory_container_id = args.delete('memory_container_id')
_type = args.delete('type')

headers = args.delete('headers') || {}
body = args.delete('body')
method = 'GET'
url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, _id)

Utils.validate_query_params! args
transport.perform_request(method, url, args, body, headers).body
end
end
end
end
end
Loading
Loading