Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarmisuper committed Nov 11, 2024
1 parent ad3b7a0 commit 7b7d9ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ChatRPG/API/Tools/ToolUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ public class ToolUtilities(IConfiguration configuration)
query.Length--; // Remove last comma

query.Append("\n]}");

query.Append($"\n\nThe player is {campaign.Player.Name}. First-person pronouns refer to them.");

query.Append($"\n\nFind the character using the following content: {input}.");

var response = await llm.GenerateAsync(query.ToString());

try
{
var llmResponseCharacter =
JsonSerializer.Deserialize<LlmResponseCharacter>(ResponseCleaner.RemoveMarkdown(response.ToString()), JsonOptions);
JsonSerializer.Deserialize<LlmResponseCharacter>(ResponseCleaner.RemoveMarkdown(response.ToString()),
JsonOptions);

if (llmResponseCharacter is null) return null;

Expand All @@ -85,4 +86,4 @@ public class ToolUtilities(IConfiguration configuration)
return null; // Format was unexpected
}
}
}
}

0 comments on commit 7b7d9ea

Please sign in to comment.