PlaygroundController constructor
PlaygroundController({
- LlmConfig? initialLlmConfig,
- List<
McpServerConfig> ? initialServers, - List<
McpLocalTool> ? customLocalTools, - McpPlaygroundStorageDelegate? storageDelegate,
- bool enableLogging = false,
- bool progressiveMcpDiscovery = false,
- List<
SystemPromptTemplate> ? systemPromptTemplates, - bool showSystemPromptTemplates = true,
Creates a new PlaygroundController instance.
Implementation
PlaygroundController({
LlmConfig? initialLlmConfig,
List<McpServerConfig>? initialServers,
List<McpLocalTool>? customLocalTools,
McpPlaygroundStorageDelegate? storageDelegate,
this.enableLogging = false,
bool progressiveMcpDiscovery = false,
this.systemPromptTemplates,
this.showSystemPromptTemplates = true,
}) : _llmConfig = _sanitizeInitialLlmConfig(initialLlmConfig),
// ignore: prefer_initializing_formals
_progressiveMcpDiscovery = progressiveMcpDiscovery,
_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();
}