mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-16 01:08:27 +00:00
Added the research on individual participants to the BeyondFacts Lab (#1207)
This commit is contained in:
1 parent
3ca4b3878b
commit
92d0ff68f4
69 files changed
+3869
-186
No files matched your search
@@ -17,9 +17,6 @@ namespace AIStudio.Tools.ToolCallingSystem.Harness;
|
||||
/// </remarks>
|
||||
public sealed class ToolCallingLoop(ILogger<ToolCallingLoop> logger) : IToolCallingLoop
|
||||
{
|
||||
private const string NO_ANSWER_AFTER_TOOL_CALL = "The model completed the tool call but did not return a final answer.";
|
||||
private const string NO_ANSWER_AFTER_LIMIT = "The model did not return a final answer after completing the available tool calls.";
|
||||
|
||||
/// <summary>
|
||||
/// What separates the text of one round from the text of the next one.
|
||||
/// </summary>
|
||||
@@ -152,7 +149,7 @@ public sealed class ToolCallingLoop(ILogger<ToolCallingLoop> logger) : IToolCall
|
||||
// the tools contributed. An empty chunk is how sources travel on their own; the
|
||||
// streaming paths of the providers attach their annotations the same way.
|
||||
//
|
||||
yield return WithWhatTheToolsContributed(roundAnswered ? string.Empty : NO_ANSWER_AFTER_LIMIT);
|
||||
yield return roundAnswered ? WithWhatTheToolsContributed(string.Empty) : WithoutAnswer(ToolCallingMessages.NoAnswerAfterLimit);
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -167,7 +164,7 @@ public sealed class ToolCallingLoop(ILogger<ToolCallingLoop> logger) : IToolCall
|
||||
|
||||
if (toolCallCount > 0)
|
||||
{
|
||||
yield return WithWhatTheToolsContributed(NO_ANSWER_AFTER_TOOL_CALL);
|
||||
yield return WithoutAnswer(ToolCallingMessages.NoAnswerAfterToolCall);
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -264,6 +261,12 @@ public sealed class ToolCallingLoop(ILogger<ToolCallingLoop> logger) : IToolCall
|
||||
// ends, so none of them hands over the sources and forgets the passages.
|
||||
//
|
||||
ContentStreamChunk WithWhatTheToolsContributed(string content) => new(content, [..toolSources]) { Passages = [..toolPassages] };
|
||||
|
||||
//
|
||||
// A notice in place of the answer is marked as such, so that whoever stores the answer as a result can tell
|
||||
// the two apart without reading the text:
|
||||
//
|
||||
ContentStreamChunk WithoutAnswer(string notice) => WithWhatTheToolsContributed(notice) with { EndsWithoutAnswer = true };
|
||||
}
|
||||
|
||||
private static string GetDisplayName(ToolCallingLoopContext context, string toolName) => context.RunnableTools
|
||||
|
||||
@@ -14,6 +14,18 @@ public static class ToolCallingMessages
|
||||
{
|
||||
private static string TA(string fallbackEN) => I18N.I.TA(fallbackEN, typeof(ToolCallingMessages).Namespace, nameof(ToolCallingMessages));
|
||||
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ToolCallingMessages).Namespace, nameof(ToolCallingMessages));
|
||||
|
||||
/// <summary>
|
||||
/// Says in place of the answer that the model stayed silent after a tool call.
|
||||
/// </summary>
|
||||
public static string NoAnswerAfterToolCall => TB("The model completed the tool call but did not return a final answer.");
|
||||
|
||||
/// <summary>
|
||||
/// Says in place of the answer that the model stayed silent after it used up its tool calls.
|
||||
/// </summary>
|
||||
public static string NoAnswerAfterLimit => TB("The model did not return a final answer after completing the available tool calls.");
|
||||
|
||||
/// <summary>
|
||||
/// Builds the exception for a response that cannot be used to continue.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user