mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-15 19:41:36 +00:00
Add the possibility to send document analysis sessions to the chat, with attachment.
This commit is contained in:
parent
eb39d130b9
commit
b479cfe0c5
@ -118,10 +118,40 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<SettingsDialo
|
|||||||
|
|
||||||
protected override bool SubmitDisabled => (this.IsNoPolicySelected || this.loadedDocumentPaths.Count==0);
|
protected override bool SubmitDisabled => (this.IsNoPolicySelected || this.loadedDocumentPaths.Count==0);
|
||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.chatThread is not null)
|
||||||
|
{
|
||||||
|
var convertThread = new ChatThread();
|
||||||
|
convertThread = convertThread with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.DEFAULT,
|
||||||
|
Blocks =
|
||||||
|
[
|
||||||
|
new ContentBlock()
|
||||||
|
{
|
||||||
|
Role = ChatRole.USER,
|
||||||
|
HideFromUser = false,
|
||||||
|
ContentType = ContentType.TEXT,
|
||||||
|
Content = new ContentText()
|
||||||
|
{
|
||||||
|
Text = this.T("Your previous document from the Document Analysis Assistant."),
|
||||||
|
FileAttachments = this.loadedDocumentPaths.ToList(),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this.chatThread.Blocks.Last(),
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
return convertThread;
|
||||||
|
}
|
||||||
|
return new ChatThread
|
||||||
|
{
|
||||||
|
SystemPrompt = SystemPrompts.DEFAULT
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user