GoodMem
ReferenceClient SDKsGo

LLMs API

LLMs API documentation for Go SDK

The default url is http://localhost:8080

MethodHTTP requestDescription
CreateLLMPost /v1/llmsCreate a new LLM
DeleteLLMDelete /v1/llms/{id}Delete an LLM
GetLLMGet /v1/llms/{id}Get an LLM by ID
ListLLMsGet /v1/llmsList LLMs
UpdateLLMPut /v1/llms/{id}Update an LLM

CreateLLM

CreateLLMResponse CreateLLM(ctx).LLMCreationRequest(lLMCreationRequest).Execute()

Create a new LLM

Example

package main

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

func main() {
	lLMCreationRequest := *goodmem_client.NewLLMCreationRequest("GPT-4 Turbo", goodmem_client.LLMProviderType("OPENAI"), "https://api.openai.com/v1", "gpt-4-turbo-preview") // LLMCreationRequest | LLM configuration details

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
lLMCreationRequestLLMCreationRequestLLM configuration details

Return type

CreateLLMResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK

DeleteLLM

DeleteLLM(ctx, id).Execute()

Delete an LLM

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

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

Other Parameters

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

GetLLM

LLMResponse GetLLM(ctx, id).Execute()

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

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

Path Parameters

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

Other Parameters

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

NameTypeDescriptionNotes

Return type

LLMResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK

ListLLMs

ListLLMsResponse ListLLMs(ctx).OwnerId(ownerId).ProviderType(providerType).Label(label).Execute()

List LLMs

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 LLMs by owner ID. With LIST_LLM_ANY permission, omitting this shows all accessible LLMs; providing it filters by that owner. With LIST_LLM_OWN permission, only your own LLMs are shown regardless of this parameter. (optional)
	providerType := goodmem_client.LLMProviderType("OPENAI") // LLMProviderType | Filter LLMs by provider type. Allowed values match the LLMProviderType schema. (optional)
	label := map[string]string{"environment": "production", "team": "nlp"} // map[string]string | Filter by label key-value pairs. Label filters accept either label.`<key>`=`<value>` or label[key]=value (for example, label.environment=production or label[environment]=production). (optional)

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

Path Parameters

Other Parameters

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

NameTypeDescriptionNotes
ownerIdstringFilter LLMs by owner ID. With LIST_LLM_ANY permission, omitting this shows all accessible LLMs; providing it filters by that owner. With LIST_LLM_OWN permission, only your own LLMs are shown regardless of this parameter.
providerTypeLLMProviderTypeFilter LLMs by provider type. Allowed values match the LLMProviderType schema.
labelmap[string]stringFilter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).

Return type

ListLLMsResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK

UpdateLLM

LLMResponse UpdateLLM(ctx, id).LLMUpdateRequest(lLMUpdateRequest).Execute()

Update an LLM

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 LLM to update
	lLMUpdateRequest := *goodmem_client.NewLLMUpdateRequest() // LLMUpdateRequest | LLM update details

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

Path Parameters

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

Other Parameters

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

NameTypeDescriptionNotes

lLMUpdateRequest | LLMUpdateRequest | LLM update details |

Return type

LLMResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK