Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AgentNet.Interop/AgentNet.Interop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-preview.260108.1" />
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-preview.260212.1" />
<PackageReference Include="Microsoft.DurableTask.Abstractions" Version="1.19.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/AgentNet.Tests/AgentNet.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="10.2.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="10.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
Expand Down
8 changes: 5 additions & 3 deletions src/AgentNet/AgentFramework.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace AgentNet

open System.Collections.Generic
open System.Threading
open Microsoft.Agents.AI
open Microsoft.Extensions.AI

Expand Down Expand Up @@ -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 }
Expand Down
18 changes: 9 additions & 9 deletions src/AgentNet/AgentNet.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

<!-- NuGet Package Metadata -->
<PropertyGroup>
<PackageId>AgentNet</PackageId>
<Version>1.0.0-alpha.3</Version>
<Authors>Jordan Marr</Authors>
<Description>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.</Description>
<PackageId>AgentNet.Unofficial</PackageId>
<Version>1.0.0-alpha.4</Version>
<Authors>Jordan Marr;Onur Gumus</Authors>
<Description>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.</Description>
<PackageTags>fsharp;ai;agents;llm;microsoft-agent-framework;workflows</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/JordanMarr/Agent.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/JordanMarr/Agent.NET</RepositoryUrl>
<PackageProjectUrl>https://github.com/OnurGumus/Agent.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/OnurGumus/Agent.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand All @@ -40,9 +40,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-preview.260108.1" />
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-preview.260108.1" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="10.2.0" />
<PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-preview.260212.1" />
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-preview.260212.1" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="10.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 7 additions & 5 deletions src/AgentNet/Workflow.InProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand All @@ -985,9 +986,8 @@ module Workflow =
let tryRun<'input, 'output, 'error> (input: 'input) (workflow: WorkflowDef<'input, 'output, 'error>) : Task<Result<'output, 'error>> =
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

Expand All @@ -1001,6 +1001,8 @@ module Workflow =

| _ -> ()

do! run.DisposeAsync()

match completed, earlyExit with
| _, Some error ->
return Error (unbox<'error> error)
Expand Down