mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 04:20:20 +00:00 
			
		
		
		
	Factored agent content cleaner
This commit is contained in:
		
							parent
							
								
									d1f79f0f1e
								
							
						
					
					
						commit
						1b3d8d3c08
					
				@ -0,0 +1,10 @@
 | 
			
		||||
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.TextFields" HeaderText="Agent: Text Content Cleaner Options">
 | 
			
		||||
    <MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
 | 
			
		||||
        <MudText Typo="Typo.body1" Class="mb-3">
 | 
			
		||||
            Use Case: this agent is used to clean up text content. It extracts the main content, removes advertisements and other irrelevant things,
 | 
			
		||||
            and attempts to convert relative links into absolute links so that they can be used.
 | 
			
		||||
        </MudText>
 | 
			
		||||
        <ConfigurationOption OptionDescription="Preselect text content cleaner options?" LabelOn="Options are preselected" LabelOff="No options are preselected" State="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions = updatedState)" OptionHelp="When enabled, you can preselect some agent options. This is might be useful when you prefer a LLM."/>
 | 
			
		||||
        <ConfigurationProviderSelection Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider = selectedValue)"/>
 | 
			
		||||
    </MudPaper>
 | 
			
		||||
</ExpansionPanel>
 | 
			
		||||
@ -0,0 +1,14 @@
 | 
			
		||||
using AIStudio.Settings;
 | 
			
		||||
 | 
			
		||||
using Microsoft.AspNetCore.Components;
 | 
			
		||||
 | 
			
		||||
namespace AIStudio.Components.Settings;
 | 
			
		||||
 | 
			
		||||
public partial class SettingsPanelAgentContentCleaner : ComponentBase
 | 
			
		||||
{
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public Func<IReadOnlyList<ConfigurationSelectData<string>>> AvailableLLMProvidersFunc { get; set; } = () => [];
 | 
			
		||||
    
 | 
			
		||||
    [Inject]
 | 
			
		||||
    private SettingsManager SettingsManager { get; init; } = null!;
 | 
			
		||||
}
 | 
			
		||||
@ -4,6 +4,7 @@
 | 
			
		||||
@using AIStudio.Provider
 | 
			
		||||
@using AIStudio.Settings
 | 
			
		||||
@using AIStudio.Settings.DataModel
 | 
			
		||||
@using AIStudio.Components.Settings
 | 
			
		||||
@using Host = AIStudio.Provider.SelfHosted.Host
 | 
			
		||||
 | 
			
		||||
<MudText Typo="Typo.h3" Class="mb-12">Settings</MudText>
 | 
			
		||||
@ -531,15 +532,6 @@
 | 
			
		||||
            </MudPaper>
 | 
			
		||||
        </ExpansionPanel>
 | 
			
		||||
        
 | 
			
		||||
        <ExpansionPanel HeaderIcon="@Icons.Material.Filled.TextFields" HeaderText="Agent: Text Content Cleaner Options">
 | 
			
		||||
            <MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
 | 
			
		||||
                <MudText Typo="Typo.body1" Class="mb-3">
 | 
			
		||||
                    Use Case: this agent is used to clean up text content. It extracts the main content, removes advertisements and other irrelevant things,
 | 
			
		||||
                    and attempts to convert relative links into absolute links so that they can be used.
 | 
			
		||||
                </MudText>
 | 
			
		||||
                <ConfigurationOption OptionDescription="Preselect text content cleaner options?" LabelOn="Options are preselected" LabelOff="No options are preselected" State="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions = updatedState)" OptionHelp="When enabled, you can preselect some agent options. This is might be useful when you prefer a LLM."/>
 | 
			
		||||
                <ConfigurationProviderSelection Data="@this.availableLLMProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider = selectedValue)"/>
 | 
			
		||||
            </MudPaper>
 | 
			
		||||
        </ExpansionPanel>
 | 
			
		||||
        <SettingsPanelAgentContentCleaner AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)" />
 | 
			
		||||
    </MudExpansionPanels>
 | 
			
		||||
</InnerScrolling>
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user