mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-16 19:08:27 +00:00
Added the simulation of researched participants to the conversation of the test situation of the BeyondFacts Lab
This commit is contained in:
18 files changed
+503
-56
No files matched your search
@@ -7,8 +7,9 @@ namespace AIStudio.Assistants.BeyondFactsLab;
|
||||
/// of the BeyondFacts Lab.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The prompt of the step carries the dossier of every person the chat plays, in full: unlike the material, a dossier
|
||||
/// is never shortened, since the chat must not play a person after half of what they said. The estimate adds the
|
||||
/// The prompt of the step carries the dossier of every person the chat plays in full, with their entry in the list:
|
||||
/// unlike the material, a dossier is never shortened, since the chat must not play a person after half of what they
|
||||
/// said. The estimate adds the
|
||||
/// dossiers to the smallest window the lab accepts at all, which leaves room for the fixed part of the prompt, the
|
||||
/// details, and the conversation, and counts the characters of a dossier the way the budget of the material does. The
|
||||
/// material then gets what is left, see BflMaterialBudget.
|
||||
@@ -18,20 +19,20 @@ public static class BflSimulationBudget
|
||||
/// <summary>
|
||||
/// Estimates how many tokens the dossiers of the people the chat plays take in the prompt.
|
||||
/// </summary>
|
||||
/// <param name="people">The research on the people the chat plays.</param>
|
||||
/// <param name="people">The people the chat plays.</param>
|
||||
/// <returns>The estimated tokens.</returns>
|
||||
public static int DossierTokens(IReadOnlyList<BflPersonResearch> people)
|
||||
public static int DossierTokens(IReadOnlyList<BflSimulatedPerson> people)
|
||||
{
|
||||
var characters = people.Sum(person => person.Stages.Sum(stage => stage.Research.Text.Trim().Length));
|
||||
var characters = people.Sum(person => person.Participant.Entry.Trim().Length + person.Research.Stages.Sum(stage => stage.Research.Text.Trim().Length));
|
||||
return (characters + BflMaterialBudget.CHARACTERS_PER_TOKEN - 1) / BflMaterialBudget.CHARACTERS_PER_TOKEN;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Estimates how many tokens a model needs to read at once for a simulation.
|
||||
/// </summary>
|
||||
/// <param name="people">The research on the people the chat plays.</param>
|
||||
/// <param name="people">The people the chat plays.</param>
|
||||
/// <returns>The estimated tokens.</returns>
|
||||
public static int RequiredTokens(IReadOnlyList<BflPersonResearch> people) => BflModelRequirements.MINIMUM_CONTEXT_TOKENS + DossierTokens(people);
|
||||
public static int RequiredTokens(IReadOnlyList<BflSimulatedPerson> people) => BflModelRequirements.MINIMUM_CONTEXT_TOKENS + DossierTokens(people);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the context window of a model is likely to hold a simulation.
|
||||
|
||||
Reference in new issue
Block a user