Skip to content

Commit 07d0388

Browse files
committed
init
0 parents  commit 07d0388

11 files changed

Lines changed: 820 additions & 0 deletions

.gitignore

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
14+
15+
# Build results
16+
[Dd]ebug/
17+
[Dd]ebugPublic/
18+
[Rr]elease/
19+
x64/
20+
x86/
21+
bld/
22+
[Bb]in/
23+
[Oo]bj/
24+
[Ll]og/
25+
26+
# Visual Studio 2015 cache/options directory
27+
.vs/
28+
# Uncomment if you have tasks that create the project's static files in wwwroot
29+
#wwwroot/
30+
31+
# MSTest test Results
32+
[Tt]est[Rr]esult*/
33+
[Bb]uild[Ll]og.*
34+
35+
# NUNIT
36+
*.VisualState.xml
37+
TestResult.xml
38+
39+
# Build Results of an ATL Project
40+
[Dd]ebugPS/
41+
[Rr]eleasePS/
42+
dlldata.c
43+
44+
# .NET Core
45+
project.lock.json
46+
project.fragment.lock.json
47+
artifacts/
48+
**/Properties/launchSettings.json
49+
50+
# VS Code
51+
.vscode/
52+
53+
*_i.c
54+
*_p.c
55+
*_i.h
56+
*.ilk
57+
*.meta
58+
*.obj
59+
*.pch
60+
*.pdb
61+
*.pgc
62+
*.pgd
63+
*.rsp
64+
*.sbr
65+
*.tlb
66+
*.tli
67+
*.tlh
68+
*.tmp
69+
*.tmp_proj
70+
*.log
71+
*.vspscc
72+
*.vssscc
73+
.builds
74+
*.pidb
75+
*.svclog
76+
*.scc
77+
78+
# Chutzpah Test files
79+
_Chutzpah*
80+
81+
# Visual C++ cache files
82+
ipch/
83+
*.aps
84+
*.ncb
85+
*.opendb
86+
*.opensdf
87+
*.sdf
88+
*.cachefile
89+
*.VC.db
90+
*.VC.VC.opendb
91+
92+
# Visual Studio profiler
93+
*.psess
94+
*.vsp
95+
*.vspx
96+
*.sap
97+
98+
# TFS 2012 Local Workspace
99+
$tf/
100+
101+
# Guidance Automation Toolkit
102+
*.gpState
103+
104+
# ReSharper is a .NET coding add-in
105+
_ReSharper*/
106+
*.[Rr]e[Ss]harper
107+
*.DotSettings.user
108+
109+
# JustCode is a .NET coding add-in
110+
.JustCode
111+
112+
# TeamCity is a build add-in
113+
_TeamCity*
114+
115+
# DotCover is a Code Coverage Tool
116+
*.dotCover
117+
118+
# Visual Studio code coverage results
119+
*.coverage
120+
*.coveragexml
121+
122+
# NCrunch
123+
_NCrunch_*
124+
.*crunch*.local.xml
125+
nCrunchTemp_*
126+
127+
# MightyMoose
128+
*.mm.*
129+
AutoTest.Net/
130+
131+
# Web workbench (sass)
132+
.sass-cache/
133+
134+
# Installshield output folder
135+
[Ee]xpress/
136+
137+
# DocProject is a documentation generator add-in
138+
DocProject/buildhelp/
139+
DocProject/Help/*.HxT
140+
DocProject/Help/*.HxC
141+
DocProject/Help/*.hhc
142+
DocProject/Help/*.hhk
143+
DocProject/Help/*.hhp
144+
DocProject/Help/Html2
145+
DocProject/Help/html
146+
147+
# Click-Once directory
148+
publish/
149+
150+
# Publish Web Output
151+
*.[Pp]ublish.xml
152+
*.azurePubxml
153+
# TODO: Comment the next line if you want to checkin your web deploy settings
154+
# but database connection strings (with potential passwords) will be unencrypted
155+
*.pubxml
156+
*.publishproj
157+
158+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
159+
# checkin your Azure Web App publish settings, but sensitive information contained
160+
# in these scripts will be unencrypted
161+
PublishScripts/
162+
163+
# NuGet Packages
164+
*.nupkg
165+
# The packages folder can be ignored because of Package Restore
166+
**/packages/*
167+
# except build/, which is used as an MSBuild target.
168+
!**/packages/build/
169+
# Uncomment if necessary however generally it will be regenerated when needed
170+
#!**/packages/repositories.config
171+
# NuGet v3's project.json files produces more ignorable files
172+
*.nuget.props
173+
*.nuget.targets
174+
175+
# Microsoft Azure Build Output
176+
csx/
177+
*.build.csdef
178+
179+
# Microsoft Azure Emulator
180+
ecf/
181+
rcf/
182+
183+
# Windows Store app package directories and files
184+
AppPackages/
185+
BundleArtifacts/
186+
Package.StoreAssociation.xml
187+
_pkginfo.txt
188+
189+
# Visual Studio cache files
190+
# files ending in .cache can be ignored
191+
*.[Cc]ache
192+
# but keep track of directories ending in .cache
193+
!*.[Cc]ache/
194+
195+
# Others
196+
ClientBin/
197+
~$*
198+
*~
199+
*.dbmdl
200+
*.dbproj.schemaview
201+
*.jfm
202+
*.pfx
203+
*.publishsettings
204+
orleans.codegen.cs
205+
206+
# Since there are multiple workflows, uncomment next line to ignore bower_components
207+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
208+
#bower_components/
209+
210+
# RIA/Silverlight projects
211+
Generated_Code/
212+
213+
# Backup & report files from converting an old project file
214+
# to a newer Visual Studio version. Backup files are not needed,
215+
# because we have git ;-)
216+
_UpgradeReport_Files/
217+
Backup*/
218+
UpgradeLog*.XML
219+
UpgradeLog*.htm
220+
221+
# SQL Server files
222+
*.mdf
223+
*.ldf
224+
225+
# Business Intelligence projects
226+
*.rdl.data
227+
*.bim.layout
228+
*.bim_*.settings
229+
230+
# Microsoft Fakes
231+
FakesAssemblies/
232+
233+
# GhostDoc plugin setting file
234+
*.GhostDoc.xml
235+
236+
# Node.js Tools for Visual Studio
237+
.ntvs_analysis.dat
238+
node_modules/
239+
240+
# Typescript v1 declaration files
241+
typings/
242+
243+
# Visual Studio 6 build log
244+
*.plg
245+
246+
# Visual Studio 6 workspace options file
247+
*.opt
248+
249+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
250+
*.vbw
251+
252+
# Visual Studio LightSwitch build output
253+
**/*.HTMLClient/GeneratedArtifacts
254+
**/*.DesktopClient/GeneratedArtifacts
255+
**/*.DesktopClient/ModelManifest.xml
256+
**/*.Server/GeneratedArtifacts
257+
**/*.Server/ModelManifest.xml
258+
_Pvt_Extensions
259+
260+
# Paket dependency manager
261+
.paket/paket.exe
262+
paket-files/
263+
264+
# FAKE - F# Make
265+
.fake/
266+
267+
# JetBrains Rider
268+
.idea/
269+
*.sln.iml
270+
271+
# CodeRush
272+
.cr/
273+
274+
# Python Tools for Visual Studio (PTVS)
275+
__pycache__/
276+
*.pyc
277+
278+
# Cake - Uncomment if you are using it
279+
# tools/**
280+
# !tools/packages.config
281+
282+
# Telerik's JustMock configuration file
283+
*.jmconfig
284+
285+
# BizTalk build output
286+
*.btp.cs
287+
*.btm.cs
288+
*.odx.cs
289+
*.xsd.cs

AutoGen.BasicSamples.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="AutoGen" Version="0.0.13" />
12+
<PackageReference Include="AutoGen.DotnetInteractive" Version="0.0.14-nightly-9073421528" />
13+
<PackageReference Include="AutoGen.SemanticKernel" Version="0.0.14-3nightly-9073421528" />
14+
<PackageReference Include="AutoGen.SourceGenerator" Version="0.0.14-nightly-9073421528" />
15+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
16+
</ItemGroup>
17+
18+
</Project>

AutoGen.BasicSamples.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.BasicSamples", "AutoGen.BasicSamples.csproj", "{F6F0D0E4-22E8-4217-A567-CBF4FADD7821}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(SolutionProperties) = preSolution
14+
HideSolutionNode = FALSE
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{F6F0D0E4-22E8-4217-A567-CBF4FADD7821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{F6F0D0E4-22E8-4217-A567-CBF4FADD7821}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{F6F0D0E4-22E8-4217-A567-CBF4FADD7821}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{F6F0D0E4-22E8-4217-A567-CBF4FADD7821}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
EndGlobal

Example01_AssistantAgent.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using AutoGen.Core;
2+
using AutoGen.SemanticKernel.Extension;
3+
using FluentAssertions;
4+
using Microsoft.SemanticKernel;
5+
using Microsoft.SemanticKernel.Connectors.OpenAI;
6+
7+
namespace AutoGen.BasicSamples;
8+
9+
public static class Example01_AssistantAgent
10+
{
11+
public static async Task RunAsync(IKernelBuilder kernelBuilder, OpenAIPromptExecutionSettings settings)
12+
{
13+
// create assistant agent
14+
var assistantAgent = kernelBuilder.Build().ToSemanticKernelAgent(
15+
name: "assistant",
16+
systemMessage: "You convert what user said to all uppercase.",
17+
settings: settings)
18+
.RegisterMessageConnector()
19+
.RegisterPrintMessage();
20+
// talk to the assistant agent
21+
var reply = await assistantAgent.SendAsync("hello world");
22+
reply.Should().BeOfType<TextMessage>();
23+
reply.GetContent().Should().Be("HELLO WORLD");
24+
25+
// to carry on the conversation, pass the previous conversation history to the next call
26+
var conversationHistory = new List<IMessage>
27+
{
28+
new TextMessage(Role.User, "hello world"), // first message
29+
reply, // reply from assistant agent
30+
};
31+
32+
reply = await assistantAgent.SendAsync("hello world again", conversationHistory);
33+
reply.Should().BeOfType<TextMessage>();
34+
reply.GetContent().Should().Be("HELLO WORLD AGAIN");
35+
}
36+
}

0 commit comments

Comments
 (0)