PlaygroundController constructor
PlaygroundController({
- LlmConfig? initialLlmConfig,
- List<
McpServerConfig> ? initialServers, - List<
McpLocalTool> ? customLocalTools, - McpPlaygroundStorageDelegate? storageDelegate,
- bool enableLogging = false,
Creates a new PlaygroundController instance.
Implementation
PlaygroundController({
LlmConfig? initialLlmConfig,
List<McpServerConfig>? initialServers,
List<McpLocalTool>? customLocalTools,
McpPlaygroundStorageDelegate? storageDelegate,
this.enableLogging = false,
}) : _llmConfig =
initialLlmConfig ??
const LlmConfig(provider: LlmProvider.none, model: '', apiKey: ''),
_storage = storageDelegate ?? SharedPreferencesStorageDelegate() {
if (initialServers != null) {
_servers.addAll(initialServers);
}
// Register custom local tools (if any) passed via constructor
if (customLocalTools != null) {
_localTools.addAll(customLocalTools);
}
_registerEmbeddedLlmHandlers();
_mcpManager.addListener(notifyListeners);
_initAndLoad();
}