Skip to content

Commit

Permalink
Merge pull request #54 from andresharpe/fix/douglas-detection-logic
Browse files Browse the repository at this point in the history
Fix douglas detection logic
  • Loading branch information
andresharpe authored Oct 13, 2024
2 parents e0388c5 + 927387f commit 927ab92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/Cute/Commands/Chat/ChatCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public class Settings : LoggedInSettings
[CommandOption("--memory-length")]
[Description("The total number of user and agent messages to keep in memory and send with new prompt.")]
public int Memory { get; set; } = 16;

[CommandOption("--douglas")]
[Description("Summons Douglas. He knows most things about your Contentful space.")]
public bool IsDouglas { get; set; } = false;
}

public override ValidationResult Validate(CommandContext context, Settings settings)
Expand Down Expand Up @@ -105,7 +109,8 @@ public override async Task<int> ExecuteCommandAsync(CommandContext context, Sett
{
string? systemMessage = null;

bool isDouglas = settings.Key == null && string.IsNullOrWhiteSpace(settings.SystemPrompt);
bool isDouglas = settings.IsDouglas
|| !(settings.Key == null && string.IsNullOrWhiteSpace(settings.SystemPrompt));

ChatCompletionOptions? chatCompletionOptions = null;

Expand Down

0 comments on commit 927ab92

Please sign in to comment.