diff --git a/src/AgentNet.Interop/AgentNet.Interop.csproj b/src/AgentNet.Interop/AgentNet.Interop.csproj
index 122ebb7..0814040 100644
--- a/src/AgentNet.Interop/AgentNet.Interop.csproj
+++ b/src/AgentNet.Interop/AgentNet.Interop.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/src/AgentNet.Tests/AgentNet.Tests.fsproj b/src/AgentNet.Tests/AgentNet.Tests.fsproj
index 5db3c44..f791b86 100644
--- a/src/AgentNet.Tests/AgentNet.Tests.fsproj
+++ b/src/AgentNet.Tests/AgentNet.Tests.fsproj
@@ -21,7 +21,7 @@
-
+
diff --git a/src/AgentNet/AgentFramework.fs b/src/AgentNet/AgentFramework.fs
index a741bd9..0dca09e 100644
--- a/src/AgentNet/AgentFramework.fs
+++ b/src/AgentNet/AgentFramework.fs
@@ -1,6 +1,7 @@
namespace AgentNet
open System.Collections.Generic
+open System.Threading
open Microsoft.Agents.AI
open Microsoft.Extensions.AI
@@ -40,16 +41,17 @@ module MAF =
/// Builds a fully functional ChatAgent from config and chat client
let build (chatClient: IChatClient) (config: ChatAgentConfig) : ChatAgent =
let mafAgent = createAgent chatClient config
- let thread = mafAgent.GetNewThread()
{
Config = config
Chat = fun message -> task {
- let! response = mafAgent.RunAsync(message, thread)
+ let! session = mafAgent.CreateSessionAsync(CancellationToken.None)
+ let! response = mafAgent.RunAsync(message, session, null, CancellationToken.None)
return response.Text
}
ChatFull = fun message -> task {
- let! response = mafAgent.RunAsync(message, thread)
+ let! session = mafAgent.CreateSessionAsync(CancellationToken.None)
+ let! response = mafAgent.RunAsync(message, session, null, CancellationToken.None)
// Return the user message and assistant response
let messages : AgentNet.ChatMessage list = [
{ Role = AgentNet.ChatRole.User; Content = message }
diff --git a/src/AgentNet/AgentNet.fsproj b/src/AgentNet/AgentNet.fsproj
index da64eab..27b4f4e 100644
--- a/src/AgentNet/AgentNet.fsproj
+++ b/src/AgentNet/AgentNet.fsproj
@@ -8,14 +8,14 @@
- AgentNet
- 1.0.0-alpha.3
- Jordan Marr
- A beautiful F# library for building AI agents on .NET. Wraps Microsoft Agent Framework with idiomatic F# APIs using quotation-based tools, pipeline-style agents, and computation expression workflows.
+ AgentNet.Unofficial
+ 1.0.0-alpha.4
+ Jordan Marr;Onur Gumus
+ Unofficial fork of AgentNet updated for Microsoft.Agents.AI 260212.1. An F# library for building AI agents on .NET, wrapping Microsoft Agent Framework with idiomatic F# APIs.
fsharp;ai;agents;llm;microsoft-agent-framework;workflows
MIT
- https://github.com/JordanMarr/Agent.NET
- https://github.com/JordanMarr/Agent.NET
+ https://github.com/OnurGumus/Agent.NET
+ https://github.com/OnurGumus/Agent.NET
git
README.md
@@ -40,9 +40,9 @@
-
-
-
+
+
+
diff --git a/src/AgentNet/Workflow.InProcess.fs b/src/AgentNet/Workflow.InProcess.fs
index 549a0a7..c35d12f 100644
--- a/src/AgentNet/Workflow.InProcess.fs
+++ b/src/AgentNet/Workflow.InProcess.fs
@@ -963,8 +963,7 @@ module Workflow =
let mafWorkflow = toMAF workflow
// Run via InProcessExecution
- let! run = MAFInProcessExecution.RunAsync(mafWorkflow, input :> obj)
- use _ = run
+ let! run = MAFInProcessExecution.Lockstep.RunAsync(mafWorkflow, input :> obj, null, System.Threading.CancellationToken.None)
// Find the last ExecutorCompletedEvent - it should be the workflow output
let mutable lastResult: obj option = None
@@ -974,6 +973,8 @@ module Workflow =
lastResult <- Some completed.Data
| _ -> ()
+ do! run.DisposeAsync()
+
match lastResult with
| Some data -> return convertToOutput<'output> data
| None -> return failwith "Workflow did not produce output. No ExecutorCompletedEvent found."
@@ -985,9 +986,8 @@ module Workflow =
let tryRun<'input, 'output, 'error> (input: 'input) (workflow: WorkflowDef<'input, 'output, 'error>) : Task> =
task {
let mafWorkflow = toMAF workflow
- let! run = MAFInProcessExecution.RunAsync(mafWorkflow, input :> obj)
- use _ = run
-
+ let! run = MAFInProcessExecution.Lockstep.RunAsync(mafWorkflow, input :> obj, null, System.Threading.CancellationToken.None)
+
let mutable completed = None
let mutable earlyExit = None
@@ -1001,6 +1001,8 @@ module Workflow =
| _ -> ()
+ do! run.DisposeAsync()
+
match completed, earlyExit with
| _, Some error ->
return Error (unbox<'error> error)