playground

package
v0.0.76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Playground

type Playground struct {
	Error error
	// contains filtered or unexported fields
}

Playground provides a fluent API for setting up a test environment. Errors are chained, and execution stops on the first failure.

func New

func New() *Playground

New creates a new Playground instance.

func (*Playground) AddCleanUp

func (p *Playground) AddCleanUp(cleanUp func())

AddCleanUp adds a cleanup function to be called by CleanUp.

func (*Playground) CleanUp

func (p *Playground) CleanUp()

CleanUp runs all registered cleanup functions.

func (*Playground) GetBackendService

func (p *Playground) GetBackendService() (backendservice.Service, error)

GetBackendService returns a new backend service instance.

func (*Playground) GetChatService

func (p *Playground) GetChatService(ctx context.Context) (chatservice.Service, error)

GetChatService returns a new chat service instance.

func (*Playground) GetDownloadService

func (p *Playground) GetDownloadService() (downloadservice.Service, error)

GetDownloadService returns a new download service instance.

func (*Playground) GetEmbedService

func (p *Playground) GetEmbedService() (embedservice.Service, error)

GetEmbedService returns a new embed service instance.

func (*Playground) GetError

func (p *Playground) GetError() error

GetError returns the first error that occurred during the setup chain.

func (*Playground) GetEventSourceService added in v0.0.74

func (p *Playground) GetEventSourceService() (eventsourceservice.Service, error)

func (*Playground) GetExecService

func (p *Playground) GetExecService(ctx context.Context) (execservice.ExecService, error)

GetExecService returns a new exec service instance.

func (*Playground) GetFunctionService added in v0.0.74

func (p *Playground) GetFunctionService() (functionservice.Service, error)

func (*Playground) GetGojaExecutor added in v0.0.74

func (p *Playground) GetGojaExecutor() (executor.ExecutorManager, error)

GetGojaExecutor returns the Goja executor instance

func (*Playground) GetHookProviderService

func (p *Playground) GetHookProviderService() (hookproviderservice.Service, error)

GetHookProviderService returns a new hook provider service instance.

func (*Playground) GetModelService

func (p *Playground) GetModelService() (modelservice.Service, error)

GetModelService returns a new model service instance.

func (*Playground) GetProviderService

func (p *Playground) GetProviderService() (providerservice.Service, error)

GetProviderService returns a new provider service instance.

func (*Playground) GetStateService

func (p *Playground) GetStateService() (stateservice.Service, error)

GetStateService returns a new state service instance.

func (*Playground) GetTaskChainService

func (p *Playground) GetTaskChainService() (taskchainservice.Service, error)

GetTaskChainService returns a new task chain service instance.

func (*Playground) GetTasksEnvService

func (p *Playground) GetTasksEnvService(ctx context.Context) (execservice.TasksEnvService, error)

GetTasksEnvService returns a new tasks environment service instance.

func (*Playground) GetgroupService added in v0.0.65

func (p *Playground) GetgroupService() (affinitygroupservice.Service, error)

GetgroupService returns a new group service instance.

func (*Playground) StartBackgroundRoutines

func (p *Playground) StartBackgroundRoutines(ctx context.Context) *Playground

StartBackgroundRoutines starts the core background processes for backend and download cycles.

func (*Playground) StartGojaExecutorSync added in v0.0.74

func (p *Playground) StartGojaExecutorSync(ctx context.Context, syncInterval time.Duration) *Playground

StartGojaExecutorSync starts the background sync for the Goja executor

func (*Playground) WaitUntilModelIsReady

func (p *Playground) WaitUntilModelIsReady(ctx context.Context, backendName, modelName string) error

WaitUntilModelIsReady blocks until the specified model is available on the specified backend.

func (*Playground) WithActivityTracker added in v0.0.74

func (p *Playground) WithActivityTracker(tracker libtracker.ActivityTracker) *Playground

WithActivityTracker sets the activity tracker for the playground

func (*Playground) WithDefaultChatModel

func (p *Playground) WithDefaultChatModel(model string, provider string, contextLength int) *Playground

WithDefaultChatModel sets the default chat model and provider.

func (*Playground) WithDefaultEmbeddingsModel

func (p *Playground) WithDefaultEmbeddingsModel(model string, provider string, contextLength int) *Playground

WithDefaultEmbeddingsModel sets the default embeddings model and provider.

func (*Playground) WithDefaultPromptModel

func (p *Playground) WithDefaultPromptModel(model string, provider string, contextLength int) *Playground

WithDefaultPromptModel sets the default prompt model and provider.

func (*Playground) WithEventDispatcher added in v0.0.74

func (p *Playground) WithEventDispatcher(ctx context.Context, onError func(context.Context, error), syncInterval time.Duration) *Playground

func (*Playground) WithEventSourceInit added in v0.0.74

func (p *Playground) WithEventSourceInit(ctx context.Context) *Playground

func (*Playground) WithEventSourceService added in v0.0.74

func (p *Playground) WithEventSourceService(ctx context.Context) *Playground

func (*Playground) WithFunctionInit added in v0.0.74

func (p *Playground) WithFunctionInit(ctx context.Context) *Playground

func (*Playground) WithFunctionService added in v0.0.74

func (p *Playground) WithFunctionService(ctx context.Context) *Playground

func (*Playground) WithGojaExecutor added in v0.0.74

func (p *Playground) WithGojaExecutor(ctx context.Context) *Playground

WithGojaExecutor initializes and returns a Goja executor

func (*Playground) WithGojaExecutorBuildIns added in v0.0.74

func (p *Playground) WithGojaExecutorBuildIns(ctx context.Context) *Playground

WithGojaExecutor initializes and returns a Goja executor

func (*Playground) WithInternalChatExecutor added in v0.0.59

func (p *Playground) WithInternalChatExecutor(ctx context.Context, modelName string, contextLen int) *Playground

func (*Playground) WithInternalOllamaEmbedder

func (p *Playground) WithInternalOllamaEmbedder(ctx context.Context, modelName string, contextLen int) *Playground

WithInternalOllamaEmbedder initializes the internal embedding model and group.

func (*Playground) WithInternalPromptExecutor

func (p *Playground) WithInternalPromptExecutor(ctx context.Context, modelName string, contextLen int) *Playground

WithInternalPromptExecutor initializes the internal task/prompt model and group.

func (*Playground) WithLLMRepo

func (p *Playground) WithLLMRepo() *Playground

WithLLMRepo initializes the LLM repository.

func (*Playground) WithMockHookRegistry

func (p *Playground) WithMockHookRegistry() *Playground

WithMockHookRegistry sets up a mock hook registry.

func (*Playground) WithMockTokenizer

func (p *Playground) WithMockTokenizer() *Playground

WithMockTokenizer sets up a mock tokenizer.

func (*Playground) WithNats

func (p *Playground) WithNats(ctx context.Context) *Playground

WithNats sets up a test NATS server.

func (*Playground) WithNatsReal added in v0.0.64

func (p *Playground) WithNatsReal(ctx context.Context, natsURL, natsUser, natsPassword string) *Playground

WithNatsReal sets up a connection to a real NATS server.

func (*Playground) WithOllamaBackend

func (p *Playground) WithOllamaBackend(ctx context.Context, name, tag string, assignEmbeddingModel, assignTasksModel bool) *Playground

WithOllamaBackend sets up an Ollama test instance and registers it as a backend.

func (*Playground) WithOllamaBackendReal added in v0.0.70

func (p *Playground) WithOllamaBackendReal(ctx context.Context, name, uri string, assignEmbeddingModel, assignTasksModel bool) *Playground

New method for real Ollama backend (complements container-based)

func (*Playground) WithPostgresReal added in v0.0.64

func (p *Playground) WithPostgresReal(ctx context.Context, connStr string) *Playground

WithPostgresReal connects to a real PostgreSQL instance using the provided connection string.

func (*Playground) WithPostgresTestContainer

func (p *Playground) WithPostgresTestContainer(ctx context.Context) *Playground

WithPostgresTestContainer sets up a test PostgreSQL container and initializes the DB manager.

func (*Playground) WithRuntimeState

func (p *Playground) WithRuntimeState(ctx context.Context, withgroups bool) *Playground

WithRuntimeState initializes the runtime state.

func (*Playground) WithTokenizerService added in v0.0.64

func (p *Playground) WithTokenizerService(ctx context.Context, tokenizerURL string) *Playground

WithTokenizerService sets up the tokenizer service from a real service URL

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL