GoodMem
ReferenceClient SDKsGo SDK

Rerankers API

Rerankers API documentation for Go SDK

All URIs are relative to http://localhost:8080

MethodHTTP requestDescription
CreateRerankerPost /v1/rerankersCreate a new reranker
DeleteRerankerDelete /v1/rerankers/{id}Delete a reranker
GetRerankerGet /v1/rerankers/{id}Get a reranker by ID
ListRerankersGet /v1/rerankersList rerankers
UpdateRerankerPut /v1/rerankers/{id}Update a reranker

CreateReranker

RerankerResponse CreateReranker(ctx).RerankerCreationRequest(rerankerCreationRequest).Execute()

Create a new reranker

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	rerankerCreationRequest := *goodmem_client.NewRerankerCreationRequest("BGE Cross-Encoder Reranker", goodmem_client.ProviderType("OPENAI"), "http://bge.reranker.goodmem.ai:8010", "BAAI/bge-reranker-base") // RerankerCreationRequest | Reranker configuration details

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.RerankersAPI.CreateReranker(context.Background()).RerankerCreationRequest(rerankerCreationRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RerankersAPI.CreateReranker``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateReranker`: RerankerResponse
	fmt.Fprintf(os.Stdout, "Response from `RerankersAPI.CreateReranker`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateRerankerRequest struct via the builder pattern

NameTypeDescriptionNotes
rerankerCreationRequestRerankerCreationRequestReranker configuration details

Return type

RerankerResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

DeleteReranker

DeleteReranker(ctx, id).Execute()

Delete a reranker

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the reranker to delete

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	r, err := apiClient.RerankersAPI.DeleteReranker(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RerankersAPI.DeleteReranker``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the reranker to delete

Other Parameters

Other parameters are passed through a pointer to a apiDeleteRerankerRequest struct via the builder pattern

NameTypeDescriptionNotes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

GetReranker

RerankerResponse GetReranker(ctx, id).Execute()

Get a reranker by ID

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the reranker to retrieve

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.RerankersAPI.GetReranker(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RerankersAPI.GetReranker``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetReranker`: RerankerResponse
	fmt.Fprintf(os.Stdout, "Response from `RerankersAPI.GetReranker`: %v\n", resp)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the reranker to retrieve

Other Parameters

Other parameters are passed through a pointer to a apiGetRerankerRequest struct via the builder pattern

NameTypeDescriptionNotes

Return type

RerankerResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

ListRerankers

ListRerankersResponse ListRerankers(ctx).OwnerId(ownerId).ProviderType(providerType).Label(label).Execute()

List rerankers

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	ownerId := "550e8400-e29b-41d4-a716-446655440000" // string | Filter rerankers by owner ID. With LIST_RERANKER_ANY permission, omitting this shows all accessible rerankers; providing it filters by that owner. With LIST_RERANKER_OWN permission, only your own rerankers are shown regardless of this parameter (PERMISSION_DENIED if set to another user). (optional)
	providerType := "TEI" // string | Filter rerankers by provider type (e.g., OPENAI, TEI, VLLM, etc.) (optional)
	label := "?label.environment=production&label.team=search" // string | Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=search) (optional)

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.RerankersAPI.ListRerankers(context.Background()).OwnerId(ownerId).ProviderType(providerType).Label(label).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RerankersAPI.ListRerankers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListRerankers`: ListRerankersResponse
	fmt.Fprintf(os.Stdout, "Response from `RerankersAPI.ListRerankers`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListRerankersRequest struct via the builder pattern

NameTypeDescriptionNotes
ownerIdstringFilter rerankers by owner ID. With LIST_RERANKER_ANY permission, omitting this shows all accessible rerankers; providing it filters by that owner. With LIST_RERANKER_OWN permission, only your own rerankers are shown regardless of this parameter (PERMISSION_DENIED if set to another user).
providerTypestringFilter rerankers by provider type (e.g., OPENAI, TEI, VLLM, etc.)
labelstringFilter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=search)

Return type

ListRerankersResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

UpdateReranker

RerankerResponse UpdateReranker(ctx, id).UpdateRerankerRequest(updateRerankerRequest).Execute()

Update a reranker

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the reranker to update
	updateRerankerRequest := *goodmem_client.NewUpdateRerankerRequest() // UpdateRerankerRequest | Updated reranker configuration details

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.RerankersAPI.UpdateReranker(context.Background(), id).UpdateRerankerRequest(updateRerankerRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RerankersAPI.UpdateReranker``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateReranker`: RerankerResponse
	fmt.Fprintf(os.Stdout, "Response from `RerankersAPI.UpdateReranker`: %v\n", resp)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the reranker to update

Other Parameters

Other parameters are passed through a pointer to a apiUpdateRerankerRequest struct via the builder pattern

NameTypeDescriptionNotes

updateRerankerRequest | UpdateRerankerRequest | Updated reranker configuration details |

Return type

RerankerResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK