mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Rename workflows projects (#975)
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows * Removing local settings. * Removing remining old files from merge.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using Microsoft.Agents.AI;
|
||||
using Microsoft.Extensions.AI;
|
||||
using Microsoft.Shared.Diagnostics;
|
||||
|
||||
namespace Microsoft.Agents.AI.Workflows;
|
||||
|
||||
internal sealed class WorkflowThread : AgentThread
|
||||
{
|
||||
public WorkflowThread(string workflowId, string? workflowName, string runId)
|
||||
{
|
||||
this.MessageStore = new();
|
||||
this.RunId = Throw.IfNullOrEmpty(runId, nameof(runId));
|
||||
}
|
||||
|
||||
public WorkflowThread(JsonElement serializedThread, JsonSerializerOptions? jsonSerializerOptions = null)
|
||||
{
|
||||
throw new NotImplementedException("Pending Checkpointing work.");
|
||||
}
|
||||
|
||||
public string RunId { get; }
|
||||
public int Halts { get; }
|
||||
|
||||
public string ResponseId => $"{this.RunId}@{this.Halts}";
|
||||
|
||||
public override JsonElement Serialize(JsonSerializerOptions? jsonSerializerOptions = null)
|
||||
=> throw new NotImplementedException("Pending Checkpointing work.");
|
||||
|
||||
public AgentRunResponseUpdate CreateUpdate(params AIContent[] parts)
|
||||
{
|
||||
Throw.IfNullOrEmpty(parts);
|
||||
|
||||
AgentRunResponseUpdate update = new(ChatRole.Assistant, parts)
|
||||
{
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
MessageId = Guid.NewGuid().ToString("N"),
|
||||
};
|
||||
|
||||
this.MessageStore.AddMessages(update.ToChatMessage());
|
||||
|
||||
return update;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public WorkflowMessageStore MessageStore { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user