75 Commits

Author SHA1 Message Date
Ryan Sweet
c1646f21c0
Rysweet 4676 remove iagentruntime - collapse into iagentworker (#4740)
* moves AgentId into Agent
* Renames AgentRuntime to AgentMessenger (more accurate name)
* Remove IAgentRuntime Interface
* changes constructor of Agent to take IAgentWorker instead of IAgentRuntime
2024-12-17 13:04:37 -08:00
Ryan Sweet
a19c848622
rysweet-4677-rename-agents-project-to-core-trim-dependencies (#4696)
* move optional base agents to separate package
* rename main sdk to Core
* reduce dependency graph
Co-authored-by: @rysweet 
Authored-by: @kostapetan 
Co-authored-by: @kopetan-ms
2024-12-13 11:55:43 -08:00
Ryan Sweet
cdd84acd05
Rysweet 4688 core doesnt use orleans (#4689)
* removes core reps on Orleans
Co-Autohored-by: @kostapetan
2024-12-13 10:32:17 -08:00
Ryan Sweet
c169df8b7b
Rysweet 4679 move grpc to runtimegrpc project (#4680)
* refactor moving grpc runtime to a separate project
2024-12-13 09:29:57 -08:00
Ryan Sweet
55e157cb99
Rysweet refactor 4670 rename abstractions to contracts (#4674)
* refactor renaming agent base

* 1st draft

* 1st draft

* format

* rename the tsts

* move IagentWorker

* 1st draft

* format

* gen-proto

* run gen-proto-samples

* format

* merge problem format
2024-12-12 19:43:26 -08:00
Ryan Sweet
c9ebe32bd7
refactor renaming agent base - 4667 (#4669)
* refactor renaming agent base

* rename the files

* Update dotnet/src/Microsoft.AutoGen/Agents/Services/HostBuilderExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update the tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2024-12-12 21:43:57 +01:00
Ryan Sweet
7d01bc6136
adds integration test for the InMemoryRuntime (#4659)
* adds integration test for the InMemoryRuntime

* format

* expand timeout for in memory runtime tests
2024-12-11 12:59:02 -08:00
Ryan Sweet
d96997232f
rysweet-4150-xlang-ci-test (#4596)
adds aspire-based integration test that validates:
* registration
* subscriptions
* event delivery
* python -> .NET server -> python subscriber
* .NET -> .NET server  -> python subscriber
* python -> .NET server -> .NET subscriber
2024-12-09 14:07:59 -08:00
Ryan Sweet
b94abb2a6c
add default subscriptions for the agent type - Implicitly created sub… (#4324)
* add default subscriptions for the agent type - Implicitly created subscription for agent RPC #4321

* add default sub for agenttype+id

* fix subscription implementation for in memory runtime
---------

Co-authored-by: XiaoYun Zhang <xiaoyuz@microsoft.com>
2024-11-25 16:29:51 -08:00
Xiaoyun Zhang
8f4d8c89c3
.NET add roleplay tool call orchestrator in AutoGen.OpenAI (#4323)
* add roleplay tool call orchestrator

* add chinese business workflow test

* update
2024-11-22 13:51:08 -08:00
Xiaoyun Zhang
ac8fd99872
[.NET] Parse data uri when creating ImageMessage (#4272)
* add test

* parse data uri from ImageMessage
2024-11-19 15:09:07 -08:00
Ryan Sweet
1e3b765e3a
.net changes to re-enable xlang support, add subscription apis (#4159)
* add subscription response

* fix send subscription response

* add register agent type response

* adding a test

* working on shaping up a test

* appsettins update for backend

* another appsettings

* fixup aspire hosting

* enable AGENT_HOST var from aspire

* add SendMessageAsync

* remove broken test

* test compiles and runs but is not (yet) correct

* subscriptions grain wireup.

* temp assert true.

* remove DI for SubscriptionGrain

* add xlang python code

* add subscription response

* rebond

* Update to .NET 9.0

* Fix Backend project SDK

* Package updates

* get RegisterAgentTypeRequest working

* fix exceptions

* add error handling for requests

* whoops

* send cloud event message type

* processing cloudevents

* trying tosend proto data - doesn't work

* trying to pack proto_data

* fix (#4238)

* pack the Message from agents_events

* format - not sure why these?

* format

* cleanup, error handling, xlang sample publishes messages that can be heard by .NET and vice versa

* format

* sdk version

* sdk vers

* net8

* back to net8

* remove netstandard2

* fix used

* remove unused

* more cleanup

* remove unneeded package

* I'm terrible at writing tests

* deserialize the cloud events and sent them as events

* comment

* cleanup

* await

* Delete dotnet/samples/Hello/Backend/Backend.csproj

unneeded change

* whoops

* merge main python back into here

* revert back to local

* revert some of the helloAgents changes.

* [.NET] Add happy path test for in-memory agent && Simplify HelloAgent example && some clean-up in extension APIs (#4227)

* add happy path test

* remove unnecessary namespace

* fix build error

* Update AgentBaseTests.cs

* revert changes

---------

* fix busted merge from main

* addressing review comments

* make internal

* case sensitive rename step 1

* case sensitive rename step 2

* remove!

---------

Co-authored-by: Peter Chang <petchang@microsoft.com>
Co-authored-by: Reuben Bond <reuben.bond@gmail.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
2024-11-19 11:00:48 -08:00
Xiaoyun Zhang
ad271d975c
[.NET] Add happy path test for in-memory agent && Simplify HelloAgent example && some clean-up in extension APIs (#4227)
* add happy path test

* remove unnecessary namespace

* fix build error

* Update AgentBaseTests.cs

* revert changes

---------
2024-11-18 13:32:49 -08:00
Ryan Sweet
458d273fc4
Refactoring the services and implementing an in-memory runtime for .NET (#4005)
closes #3950 closes #3702

What this is doing:

I am refactoring the services on the .NET runtime and attempting to clarify the naming and organization.
I added this doc to help capture the naming and concepts.
AgentRuntime / Worker should work similar to the python version and enables running the whole agent system in one process. For remote the system uses the versions of the services in the grpc folder.
lots of other bug fixes/threading cleanup - passing cancellation token throughout
Services update clarifies the naming and roles:

Worker: Hosts the Agents and is a client to the Gateway
Gateway:
-- RPC gateway for the other services APIs
-- Provides an RPC bridge between the workers and the Event Bus
Registry: keeps track of the agents in the system and which events they can handle
AgentState: persistent state for agents
2024-11-12 11:04:59 -08:00
Xiaoyun Zhang
5e0b677acc
[.NET] Create tools from M.E.A.I AIFunctionFactory (#4041)
* add MEAI tool support

* fix format

* update

---------

Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
2024-11-03 09:18:32 -08:00
Xiaoyun Zhang
6bea055b26
[.Net] Add a generic IHandle interface so AgentRuntime doesn't need to deal with typed handler (#3985)
* add IHandle for object type

* rename handle -> handleObject

* remove duplicate file header setting

* update

* remove AgentId

* fix format
2024-10-30 11:53:37 -07:00
Xiaoyun Zhang
e63fd17ed5
[.Net] use file-scope (#3997)
* use file-scope

* reformat
2024-10-30 10:05:58 -07:00
Xiaoyun Zhang
6925cd436a
mitigate dotnet interactive blocking issue (#3982)
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
2024-10-28 17:01:03 -07:00
Ryan Sweet
0214299de5
updating dependencies and build to ensure works with net9 (#3800)
* interim - doesn't work - sharing

* turn off EnforceExtended

* works with dotnet build now... ;-)

* interim progress

* more updates

* make VS happy

* update

* Update AutoGen.Ollama.csproj

* Update Microsoft.AutoGen.Agents.Abstractions.csproj

* Delete dotnet/test/AutoGen.Gemini.Tests/ApprovalTests/FunctionContractExtensionTests.ItGenerateGetWeatherToolTest.received.txt

* fix tests

---------

Co-authored-by: XiaoYun Zhang <xiaoyuz@microsoft.com>
2024-10-16 11:03:05 -07:00
Xiaoyun Zhang
0560bdd645
[.Net] Update OpenAI, semantic kernel to latest version (#3792)
* update OpenAI, semantic kernel to latest version

* fix build error

* update

* update release note
2024-10-15 07:23:33 -07:00
Xiaoyun Zhang
9ba14ee15b
Fix dotnet test and reformat dotnet code (#3603)
* fix test

* install aspire workload

* format

* fix build error

* fix format

* format
2024-10-02 14:42:27 -04:00
Xiaoyun Zhang
5c7498cc08 Dotnet package cleanup and reconciliation of dirs 2024-10-02 12:57:50 -04:00
Xiaoyun Zhang
18d52f606a
Merge dotnet conflict (#3) 2024-09-30 19:32:48 -04:00
Xiaoyun Zhang
a44b86f26e
stop setting name field when assistant message contains tool call (#3481) 2024-09-05 20:54:30 +00:00
Xiaoyun Zhang
084532e274
[.Net] add output schema to generateReplyOption (#3450)
* add output schema

* fix format
2024-08-30 15:36:20 +00:00
Xiaoyun Zhang
4193cea267
[.Net] Add AutoGen.OpenAI package that uses OpenAI v2 SDK (#3402)
* udpate

* add sample to connect to azure oai

* update comment

* ping to beta5

* add openai tests

* format code

* add structural output example

* update comment

* fix test

* resolve comments

* fix format issue

* update sk version
2024-08-27 21:37:47 +00:00
Xiaoyun Zhang
eb160d9d4a
[.Net] Rename AutoGen.OpenAI to AutoGen.OpenAI.V1 (#3358)
* fix build error

* rename AutoGen.OpenAI to AutoGen.OpenAI.V1
2024-08-21 20:45:15 +00:00
Xiaoyun Zhang
a638a08f81
[.Net] Dispose kernel after running dotnet interactive tests (#3378)
* dispose kernel after running test

* add timeout
2024-08-20 02:33:52 +00:00
David Luong
0a2b667f3c
[.NET] Add cache control to Anthropic Client (#3372)
* Add cache control to anthropic client and write unit test & exampel

* PR comments

* Fix import ordering for build

* Fix import orderings

---------

Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
2024-08-18 16:14:51 +00:00
Xiaoyun Zhang
f49ed29b4e
[.Net][AutoGen.DotnetInteractive] add DotnetInteractiveStdioConnector (#3337)
* add DotnetInteractiveStdioCOnector

* update

* update

* comment out DotnetInteractive test

* add header

* update
2024-08-10 01:53:48 +00:00
Xiaoyun Zhang
4dab28c769
[.Net] Add AutoGen.AzureAIInference (#3332)
* add AutoGen.AzureAIInference

* add tests

* update readme

* fix format
2024-08-08 23:33:14 +00:00
Xiaoyun Zhang
5732b3e766
[.Net] add DotnetInteractiveKernelBuilder to AutoGen.DotnetInteractive (#3317)
* add DotnetInteractiveBuilder

* update

* fix workflow

* add pwsh test

* update

* add extract code extension

* update workflow
2024-08-08 17:49:58 +00:00
Xiaoyun Zhang
cf2fe4aa78
[.Net] Fix #3306 (#3310)
* break conversation when orchestartor return null

* enable test on different OS
2024-08-06 21:59:44 +00:00
Xiaoyun Zhang
a375d7ac38
[.Net] Remove Azure.AI.OpenAI from AutoGen.DotnetInteractive package (#3274)
* remove Azure.AI.OpenAI dependencies

* fix build error

* revert change
2024-08-02 16:35:07 +00:00
Xiaoyun Zhang
3186bb7610
only add the last message to chat history in SendAsync (#3272) 2024-08-02 16:35:00 +00:00
Xiaoyun Zhang
2cfaf73ad8
[.Net] add SendAsync api to iterate group chat step by step (#3214)
* add SendAsync api and tests

* update example to use new sendAsync API
2024-07-29 16:32:45 +00:00
Xiaoyun Zhang
155da15734
[.Net] fix #3203 (#3204)
* add net6 & net8

* update

* add tools and stop sequence
2024-07-25 16:15:55 +00:00
Xiaoyun Zhang
fa88646301
[.Net] Add a constructor which takes ChatCompletionOptions for OpenAIChatAgent (#3170)
* accept ChatCompletionOptions in constrcutor

* fix comment
2024-07-23 16:59:05 +00:00
Xiaoyun Zhang
1daf852f86
rename Service -> WebAPI (#3177) 2024-07-22 16:44:12 +00:00
Xiaoyun Zhang
d073678154
add streaming tool call example (#3167) 2024-07-19 16:36:04 +00:00
Xiaoyun Zhang
970c1961dd
[.Net] update dotnet-ci and dotnet-release to use 8.0.x version when setting up .NET. And enable format check (#3136)
* use 8.0.x versin

* enable format check

* change file header

* apply code format

* add instructions in ci to fix format error

* add comment back
2024-07-15 19:33:10 +00:00
Xiaoyun Zhang
7205ccc3b9
fix build and tests (#3134) 2024-07-15 19:20:22 +00:00
Xiaoyun Zhang
178bb8d325
add cancellation token to transition check lambda (#3132) 2024-07-15 18:02:30 +00:00
Xiaoyun Zhang
96146aa9b6
[.Net] update sk version from 1.10.0 to 1.15.1 (#3131)
* update sk version

* fix sk test error
2024-07-15 16:51:05 +00:00
Xiaoyun Zhang
b021e44540
[.Net] Agent as service: Run an IAgent as openai chat completion endpoint (#2633)
* update

* add test

* clean up

* update

* Delete dotnet/src/AutoGen.Server/AutoGen.Service.csproj.user

* implement streaming

* add sample project

* rename AutoGen.Service to AutoGen.WebAPI

* rename AutoGen.Service to AutoGen.WebAPI
2024-07-11 16:34:15 +00:00
Xiaoyun Zhang
4e95630fa9
[.Net] fix #2695 and #2884 (#3069)
* add round robin orchestrator

* add constructor for orchestrators

* add tests

* revert change

* return single orchestrator

* address comment
2024-07-10 22:12:42 +00:00
Prithvi
82903f5f89
[.Net] Update FunctionCallTemplate.tt to encode " (#3068)
* Update FunctionCallTemplate.tt

changed the desscription assigning to handle double quotes in comments and prevent the generated code from breaking.

* Added the necessary changes

Fixed handling of double quotes in descriptions within FunctionCallTemplate.tt.
Standardized newline characters to ensure consistency.
Updated test cases in FunctionCallTemplateEncodingTests to verify correct encoding of double quotes in descriptions.
Cleaned up unnecessary using directives in FunctionCallTemplateEncodingTests.
Aligned the template with the approved test output.

* test cases passing

Test cases passing like `Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     9, Skipped:     0, Total:     9, Duration: 66 ms - AutoGen.SourceGenerator.Tests.dll (net8.0)`

* Delete FunctionCallTemplateTests.TestFunctionCallTemplate.approved.txt

Deleted the ApprovalTests/FunctionCallTemplateTests.TestFunctionCallTemplate.approved.txt successfully!

* Revert "Delete FunctionCallTemplateTests.TestFunctionCallTemplate.approved.txt"

This reverts commit 7a6ea9cf0d5831ba7a5c445a7f9b64da713c600d.

---------

Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
2024-07-05 23:10:58 +00:00
Xiaoyun Zhang
66e50618bd
[.Net] Fix #3045 (#3047)
* make IStreamingMessage obsolete

* update final reply message
2024-07-01 16:52:57 +00:00
David Luong
80ecbf900c
[.Net] Support tools for AnthropicClient and AnthropicAgent (#2944)
* Squash commits : support anthropic tools

* Support tool_choice

* Remove reference from TypeSafeFunctionCallCodeSnippet.cs and add own function in test proj
2024-06-30 23:21:34 +00:00
Xiaoyun Zhang
b8a47a8d42
[.Net] fix #3014 by adding local model function call in dotnet website (#3044)
* add instruction in ollama-litellm function call example

* add tutorial

* fix tests
2024-06-30 18:43:22 +00:00