GoodMemGoodMem
ReferenceClient SDKsRust

Rerankers

Rust rerankers API reference: typed methods, request options, return values, and resource models.

goodmem::api::Rerankers

Access this service with client.rerankers().

pub struct Rerankers<'a> {
    /* private fields */
}

Methods

MethodHTTPPath
createPOST/v1/rerankers
deleteDELETE/v1/rerankers/{id}
getGET/v1/rerankers/{id}
listGET/v1/rerankers
updatePUT/v1/rerankers/{id}

Errors and cancellation

Calls return Result<T>. See Error for validation, HTTP, transport, decoding, and timeout failures. Stream items can also return errors after the call succeeds.

Pagination helpers fetch pages when polled. Drop a page or event stream to cancel further work.

Implementations

impl Rerankers<'_>

create

pub async fn create(&self, body: &RerankerCreationRequest) -> Result<RerankerResponse>

Create a new reranker

Creates a new reranker configuration for ranking search results. Rerankers represent connections to different reranking API services (like TEI, OpenAI, etc.) and include all the necessary configuration to use them for result ranking.

DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another reranker exists with the same effective provider connection and model configuration for this owner after endpoint canonicalization and provider-default resolution. Equivalent credentials participate in the comparison.

DEFAULTS: apiPath defaults to '/v2/rerank' for Cohere and '/rerank' for other providers if omitted; supportedModalities defaults to [TEXT] if omitted.

OWNER DEFAULTS: Owner defaults to the authenticated principal unless ownerId is provided; CREATE_RERANKER is evaluated against the proposed reranker and owner. This operation is NOT idempotent - each request creates a new reranker record.

Errors include local validation, HTTP failures, and malformed responses.

HTTP: POST /v1/rerankers

delete

pub async fn delete(&self, id: impl std::fmt::Display) -> Result<()>

Delete a reranker

Permanently deletes a reranker configuration. This operation cannot be undone and immediately removes the reranker record from the database.

SIDE EFFECTS: Invalidates any cached references to this reranker; does not affect historical usage data or audit logs. Requires DELETE_RERANKER on the requested reranker. This operation is safe to retry - may return NOT_FOUND if already deleted.

Errors include local validation, HTTP failures, and malformed responses.

HTTP: DELETE /v1/rerankers/{id}

get

pub async fn get( &self, id: impl std::fmt::Display, options: &RerankersGetOptions, ) -> Result<RerankerResponse>

Get a reranker by ID

Retrieves the details of a specific reranker configuration by its unique identifier. Stored credentials are omitted unless includeCredentials is true and the caller also has READ_RERANKER_CREDENTIALS. Requires READ_RERANKER on the requested reranker. The service distinguishes a missing reranker from an existing reranker the caller cannot read. This is a read-only operation with no side effects and is safe to retry.

Errors include local validation, HTTP failures, and malformed responses.

HTTP: GET /v1/rerankers/{id}

list

pub async fn list(&self, options: &RerankersListOptions) -> Result<ListRerankersResponse>

List rerankers

Retrieves a list of reranker configurations accessible to the caller, with optional filtering.

IMPORTANT: Pagination is NOT supported - all matching results are returned. Results are ordered by created_at descending. Stored credentials are never included in list responses.

LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).

AUTHORIZATION: Requires LIST_RERANKER on the GoodMem instance. Each returned reranker must also be visible through READ_RERANKER; unauthorized rerankers are filtered in PostgreSQL. The ownerId parameter filters that already-authorized result set and does not grant additional visibility.

Errors include local validation, HTTP failures, and malformed responses.

HTTP: GET /v1/rerankers

update

pub async fn update( &self, id: impl std::fmt::Display, body: &UpdateRerankerRequest, ) -> Result<RerankerResponse>

Update a reranker

Updates an existing reranker configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated.

IMMUTABLE FIELDS: providerType and ownerId cannot be changed after creation.

SUPPORTED_MODALITIES UPDATE: If the array contains >=1 elements, it replaces the stored set; if empty or omitted, no change occurs and it does not count as an update by itself. Returns ALREADY_EXISTS if update would create an equivalent reranker configuration for this owner after endpoint canonicalization and provider-default resolution (HTTP 409 Conflict / ALREADY_EXISTS). Requires UPDATE_RERANKER on the requested reranker. This operation is idempotent.

Errors include local validation, HTTP failures, and malformed responses.

HTTP: PUT /v1/rerankers/{id}

Types

Trait implementations

  • Clone (derived)
  • Copy (derived)
  • Debug (derived)

On this page