GoodMem
ReferenceClient SDKsGo SDK

Embedders API

Embedders API documentation for Go SDK

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

MethodHTTP requestDescription
CreateEmbedderPost /v1/embeddersCreate a new embedder
DeleteEmbedderDelete /v1/embedders/{id}Delete an embedder
GetEmbedderGet /v1/embedders/{id}Get an embedder by ID
ListEmbeddersGet /v1/embeddersList embedders
UpdateEmbedderPut /v1/embedders/{id}Update an embedder

CreateEmbedder

EmbedderResponse CreateEmbedder(ctx).EmbedderCreationRequest(embedderCreationRequest).Execute()

Create a new embedder

Example

package main

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

func main() {
	embedderCreationRequest := *goodmem_client.NewEmbedderCreationRequest("OpenAI Ada-2", goodmem_client.ProviderType("OPENAI"), "https://api.openai.com/v1", "text-embedding-3-small", int32(1536), goodmem_client.DistributionType("DENSE")) // EmbedderCreationRequest | Embedder configuration details

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
embedderCreationRequestEmbedderCreationRequestEmbedder configuration details

Return type

EmbedderResponse

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

DeleteEmbedder

DeleteEmbedder(ctx, id).Execute()

Delete an embedder

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 embedder to delete

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	r, err := apiClient.EmbeddersAPI.DeleteEmbedder(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EmbeddersAPI.DeleteEmbedder``: %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 embedder to delete

Other Parameters

Other parameters are passed through a pointer to a apiDeleteEmbedderRequest 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

GetEmbedder

EmbedderResponse GetEmbedder(ctx, id).Execute()

Get an embedder 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 embedder to retrieve

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

Path Parameters

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

Other Parameters

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

NameTypeDescriptionNotes

Return type

EmbedderResponse

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

ListEmbedders

ListEmbeddersResponse ListEmbedders(ctx).OwnerId(ownerId).ProviderType(providerType).Label(label).Execute()

List embedders

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 embedders by owner ID. With LIST_EMBEDDER_ANY permission, omitting this shows all accessible embedders; providing it filters by that owner. With LIST_EMBEDDER_OWN permission, only your own embedders are shown regardless of this parameter. (optional)
	providerType := "OPENAI" // string | Filter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.) (optional)
	label := "?label.environment=production&label.team=nlp" // string | Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp) (optional)

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
ownerIdstringFilter embedders by owner ID. With LIST_EMBEDDER_ANY permission, omitting this shows all accessible embedders; providing it filters by that owner. With LIST_EMBEDDER_OWN permission, only your own embedders are shown regardless of this parameter.
providerTypestringFilter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)
labelstringFilter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)

Return type

ListEmbeddersResponse

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

UpdateEmbedder

EmbedderResponse UpdateEmbedder(ctx, id).UpdateEmbedderRequest(updateEmbedderRequest).Execute()

Update an embedder

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 embedder to update
	updateEmbedderRequest := *goodmem_client.NewUpdateEmbedderRequest() // UpdateEmbedderRequest | Embedder update details

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

Path Parameters

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

Other Parameters

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

NameTypeDescriptionNotes

updateEmbedderRequest | UpdateEmbedderRequest | Embedder update details |

Return type

EmbedderResponse

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