<Window x:Class="ReAct_PME.ParametresOllama"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:ReAct_PME"
        mc:Ignorable="d"
        Title="Parametres Ollama" Height="480" Width="500" Background="#FFF0F0F0">
    <Grid Margin="10,10,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <TextBlock Text="URL Ollama (avec le port si besoin):" Grid.Row="0" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_URL, Mode=TwoWay}"  MaxLength="255"  Grid.Row="0" Margin="220,0,0,0"/>

        <TextBlock Text="Timeout :" Grid.Row="1" VerticalAlignment="Center"/>
        <TextBox x:Name="IntTextBox" Text="{Binding SelectedItem.Ollama_TimeOut, Mode=TwoWay}"  Grid.Row="1" Margin="220,0,0,0" MaxLength="10" 
                 PreviewTextInput="NumericOnly_PreviewTextInput"
                 TextChanged="IntTextBox_TextChanged"
                 PreviewKeyDown="NumericOnly_PreviewKeyDown" />

        <TextBlock Text="Température:" Grid.Row="2" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Temperature, Mode=TwoWay}"  MaxLength="255"  Grid.Row="2" Margin="220,0,0,0" ToolTip="0 : réponses plus précises et conservatrices ; 1 : plus créatives"/>

        <TextBlock Text="Top_P:" Grid.Row="3" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Top_p, Mode=TwoWay}"  MaxLength="255"  Grid.Row="3" Margin="220,0,0,0" ToolTip="on considère uniquement les mots parmi les plus probables (+ c'est proche de 1 -> + cela limite l’invention)"/>

        <TextBlock Text="Max tokens:" Grid.Row="4" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Max_tokens, Mode=TwoWay}"  MaxLength="255"  Grid.Row="4" Margin="220,0,0,0" ToolTip="pour ne pas générer des réponses trop longues"/>


        <TextBlock Text="URL Ollama Batch (avec le port si besoin):" Grid.Row="6" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Batch_URL, Mode=TwoWay}"  MaxLength="255"  Grid.Row="6" Margin="220,0,0,0"/>

        <TextBlock Text="Timeout Batch :" Grid.Row="7" VerticalAlignment="Center"/>
        <TextBox x:Name="IntTextBox2" Text="{Binding SelectedItem.Ollama_Batch_TimeOut, Mode=TwoWay}"  Grid.Row="7" Margin="220,0,0,0" MaxLength="10" 
                 PreviewTextInput="NumericOnly_PreviewTextInput"
                 TextChanged="IntTextBox2_TextChanged"
                 PreviewKeyDown="NumericOnly_PreviewKeyDown" />

        <TextBlock Text="Température Batch :" Grid.Row="8" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Batch_Temperature, Mode=TwoWay}"  MaxLength="255"  Grid.Row="8" Margin="220,0,0,0" ToolTip="0 : réponses plus précises et conservatrices ; 1 : plus créatives"/>

        <TextBlock Text="Top_P Batch :" Grid.Row="9" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Batch_Top_p, Mode=TwoWay}"  MaxLength="255"  Grid.Row="9" Margin="220,0,0,0" ToolTip="on considère uniquement les mots parmi les plus probables (+ c'est proche de 1 -> + cela limite l’invention)"/>

        <TextBlock Text="Max tokens Batch :" Grid.Row="10" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.Ollama_Batch_Max_tokens, Mode=TwoWay}"  MaxLength="255"  Grid.Row="10" Margin="220,0,0,0" ToolTip="pour ne pas générer des réponses trop longues"/>

        <TextBlock x:Name="Message" Text="..." Grid.Row="11" VerticalAlignment="Center"/>
        
        <StackPanel Orientation="Vertical" Grid.Row="12" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,0">
            <Button 
                Content="Sauvegarder" Width="80" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click"
                />
            <Button Content="Fermer" Width="80" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click_1"                
                />
        </StackPanel>
    </Grid>
</Window>
