Documentation
¶
Index ¶
- type Playground
- func (p *Playground) AddCleanUp(cleanUp func())
- func (p *Playground) CleanUp()
- func (p *Playground) GetBackendService() (backendservice.Service, error)
- func (p *Playground) GetChatService(ctx context.Context) (chatservice.Service, error)
- func (p *Playground) GetDownloadService() (downloadservice.Service, error)
- func (p *Playground) GetEmbedService() (embedservice.Service, error)
- func (p *Playground) GetError() error
- func (p *Playground) GetExecService(ctx context.Context) (execservice.ExecService, error)
- func (p *Playground) GetHookProviderService() (hookproviderservice.Service, error)
- func (p *Playground) GetModelService() (modelservice.Service, error)
- func (p *Playground) GetProviderService() (providerservice.Service, error)
- func (p *Playground) GetStateService() (stateservice.Service, error)
- func (p *Playground) GetTaskChainService() (taskchainservice.Service, error)
- func (p *Playground) GetTasksEnvService(ctx context.Context) (execservice.TasksEnvService, error)
- func (p *Playground) GetgroupService() (affinitygroupservice.Service, error)
- func (p *Playground) StartBackgroundRoutines(ctx context.Context) *Playground
- func (p *Playground) WaitUntilModelIsReady(ctx context.Context, backendName, modelName string) error
- func (p *Playground) WithDefaultChatModel(model string, provider string, contextLength int) *Playground
- func (p *Playground) WithDefaultEmbeddingsModel(model string, provider string, contextLength int) *Playground
- func (p *Playground) WithDefaultPromptModel(model string, provider string, contextLength int) *Playground
- func (p *Playground) WithInternalChatExecutor(ctx context.Context, modelName string, contextLen int) *Playground
- func (p *Playground) WithInternalOllamaEmbedder(ctx context.Context, modelName string, contextLen int) *Playground
- func (p *Playground) WithInternalPromptExecutor(ctx context.Context, modelName string, contextLen int) *Playground
- func (p *Playground) WithLLMRepo() *Playground
- func (p *Playground) WithMockHookRegistry() *Playground
- func (p *Playground) WithMockTokenizer() *Playground
- func (p *Playground) WithNats(ctx context.Context) *Playground
- func (p *Playground) WithNatsReal(ctx context.Context, natsURL, natsUser, natsPassword string) *Playground
- func (p *Playground) WithOllamaBackend(ctx context.Context, name, tag string, ...) *Playground
- func (p *Playground) WithOllamaBackendReal(ctx context.Context, name, uri string, ...) *Playground
- func (p *Playground) WithPostgresReal(ctx context.Context, connStr string) *Playground
- func (p *Playground) WithPostgresTestContainer(ctx context.Context) *Playground
- func (p *Playground) WithRuntimeState(ctx context.Context, withgroups bool) *Playground
- func (p *Playground) WithTokenizerService(ctx context.Context, tokenizerURL string) *Playground
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 (*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) GetExecService ¶
func (p *Playground) GetExecService(ctx context.Context) (execservice.ExecService, error)
GetExecService returns a new exec service 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) 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) 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) 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