mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-12 08:47:21 +00:00
Added research on the web to the BeyondFacts Lab (#1186)
This commit is contained in:
1 parent
e5c0931a60
commit
9a676101f7
66 files changed
+3609
-70
No files matched your search
@@ -5,7 +5,7 @@ namespace AIStudio.Assistants.BeyondFactsLab;
|
||||
|
||||
/// <summary>
|
||||
/// Sends a request which the person never sees, in a hidden copy of a conversation of the lab, e.g., for a work state
|
||||
/// or a result.
|
||||
/// or a result, or in a hidden chat of its own, e.g., for a research agent.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The copy carries the system prompt and the messages of the conversation, so the model knows all the step knows.
|
||||
@@ -22,7 +22,18 @@ public static class BflHiddenRequest
|
||||
/// <param name="images">The images of the material, which go along with the first message.</param>
|
||||
/// <param name="token">The cancellation token.</param>
|
||||
/// <returns>The answer, empty when the provider failed.</returns>
|
||||
public static async Task<string> AskAsync(ChatThread hidden, AIStudio.Settings.Provider provider, string text, IReadOnlyList<FileAttachmentImage> images, CancellationToken token)
|
||||
public static async Task<string> AskAsync(ChatThread hidden, AIStudio.Settings.Provider provider, string text, IReadOnlyList<FileAttachmentImage> images, CancellationToken token) => (await AskForAnswerAsync(hidden, provider, text, images, token)).Text;
|
||||
|
||||
/// <summary>
|
||||
/// Sends a request in a hidden chat and waits for the whole answer, together with what the tools did meanwhile.
|
||||
/// </summary>
|
||||
/// <param name="hidden">The hidden chat, which keeps the request and the answer.</param>
|
||||
/// <param name="provider">The provider which answers.</param>
|
||||
/// <param name="text">The request.</param>
|
||||
/// <param name="images">The images of the material, which go along with the first message.</param>
|
||||
/// <param name="token">The cancellation token.</param>
|
||||
/// <returns>The answer with the calls of the tools and their sources; its text is empty when the provider failed.</returns>
|
||||
public static async Task<ContentText> AskForAnswerAsync(ChatThread hidden, AIStudio.Settings.Provider provider, string text, IReadOnlyList<FileAttachmentImage> images, CancellationToken token)
|
||||
{
|
||||
var request = new ContentText { Text = text };
|
||||
hidden.Blocks.Add(new ContentBlock
|
||||
@@ -45,6 +56,6 @@ public static class BflHiddenRequest
|
||||
});
|
||||
|
||||
await answer.CreateFromProviderAsync(provider.CreateProvider(), provider.Model, request, BflConversationService.WithImages(hidden, images), token);
|
||||
return answer.Text;
|
||||
return answer;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user