Skip to content

Commit acd92e7

Browse files
committed
- Added OpenAIEmbeddingModels collection of Open AI Embedding Models
- Exposed `Connection` as a Property on all Factories - NuGet: Changed Project URL to be the [Wiki](https://github.com/rwjdk/AgentFrameworkToolkit/wiki)
1 parent 73fb583 commit acd92e7

File tree

17 files changed

+120
-56
lines changed

17 files changed

+120
-56
lines changed

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Use this file as a quick map for where code lives, how it is styled, and how to
1616
- All public APIs require XML documentation; most public types use `[PublicAPI]` (JetBrains.Annotations).
1717
- Prefer primary constructors where the codebase already uses them.
1818

19+
## Code Review rules
20+
- Check that new/changed/removed features are mentioned in CHANGELOG.md file.
21+
1922
## Adding a new provider package
2023
Pick the smallest implementation path that matches the provider API.
2124

AgentFrameworkToolkit.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</Folder>
1515
<Folder Name="/Solution Items/">
1616
<File Path=".github/workflows/Build.yml" />
17+
<File Path="AGENTS.md" />
1718
<File Path="CHANGELOG.md" />
1819
<File Path="CONTRIBUTING.md" />
1920
<File Path="README.md" />

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Changelog - Agent Framework Toolkit
22

33
## Unreleased
4-
- Adde `OpenAIEmbeddingModels` collection of Open AI Embedding Models
4+
- Added `OpenAIEmbeddingModels` collection of Open AI Embedding Models
5+
- Exposed `Connection` as a Property on all Factories
6+
- NuGet: Changed Project URL to be the [Wiki](https://github.com/rwjdk/AgentFrameworkToolkit/wiki)
57

68
---
79

nuget-package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1212
<Authors>Rasmus Wulff Jensen</Authors>
1313
<Copyright>2025</Copyright>
14-
<PackageProjectUrl>https://github.com/rwjdk/AgentFrameworkToolkit</PackageProjectUrl>
14+
<PackageProjectUrl>https://github.com/rwjdk/AgentFrameworkToolkit/wiki</PackageProjectUrl>
1515
<PackageIcon>icon.png</PackageIcon>
1616
<PackageTags>microsoft-agent-framework agent-framework-toolkit toolkit microsoft agent framework microsoft.agents.ai</PackageTags>
1717
<Company>RWJDK</Company>

src/AgentFrameworkToolkit.Anthropic/AnthropicAgentFactory.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ namespace AgentFrameworkToolkit.Anthropic;
1212
[PublicAPI]
1313
public class AnthropicAgentFactory
1414
{
15-
private readonly AnthropicConnection _connection;
15+
/// <summary>
16+
/// Connection
17+
/// </summary>
18+
public AnthropicConnection Connection { get; }
1619

1720
/// <summary>
1821
/// Constructor
1922
/// </summary>
2023
/// <param name="apiKey">Your Anthropic API Key (if you need a more advanced connection use the constructor overload)</param>
2124
public AnthropicAgentFactory(string apiKey)
2225
{
23-
_connection = new AnthropicConnection
26+
Connection = new AnthropicConnection
2427
{
2528
ApiKey = apiKey
2629
};
@@ -32,7 +35,7 @@ public AnthropicAgentFactory(string apiKey)
3235
/// <param name="connection">Connection Details</param>
3336
public AnthropicAgentFactory(AnthropicConnection connection)
3437
{
35-
_connection = connection;
38+
Connection = connection;
3639
}
3740

3841
/// <summary>
@@ -63,7 +66,7 @@ public AnthropicAgent CreateAgent(string model, int maxOutputTokens, string? ins
6366
/// <returns>The Agent</returns>
6467
public AnthropicAgent CreateAgent(AnthropicAgentOptions options)
6568
{
66-
IChatClient client = _connection.GetClient(options.RawHttpCallDetails).AsIChatClient();
69+
IChatClient client = Connection.GetClient(options.RawHttpCallDetails).AsIChatClient();
6770

6871
AIAgent innerAgent = new ChatClientAgent(client, CreateChatClientAgentOptions(options), options.LoggerFactory, options.Services);
6972

src/AgentFrameworkToolkit.AzureOpenAI/AzureOpenAIAgentFactory.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ namespace AgentFrameworkToolkit.AzureOpenAI;
1717
[PublicAPI]
1818
public class AzureOpenAIAgentFactory
1919
{
20-
private readonly AzureOpenAIConnection _connection;
20+
/// <summary>
21+
/// Connection
22+
/// </summary>
23+
public AzureOpenAIConnection Connection { get; }
2124

2225
/// <summary>
2326
/// Constructor
@@ -26,7 +29,7 @@ public class AzureOpenAIAgentFactory
2629
/// <param name="apiKey">Your AzureOpenAI API Key (if you need a more advanced connection use the constructor overload)</param>
2730
public AzureOpenAIAgentFactory(string endpoint, string apiKey)
2831
{
29-
_connection = new AzureOpenAIConnection
32+
Connection = new AzureOpenAIConnection
3033
{
3134
Endpoint = endpoint,
3235
ApiKey = apiKey
@@ -40,7 +43,7 @@ public AzureOpenAIAgentFactory(string endpoint, string apiKey)
4043
/// <param name="credentials">Your RBAC Credentials (if you need a more advanced connection use the constructor overload)</param>
4144
public AzureOpenAIAgentFactory(string endpoint, TokenCredential credentials)
4245
{
43-
_connection = new AzureOpenAIConnection
46+
Connection = new AzureOpenAIConnection
4447
{
4548
Endpoint = endpoint,
4649
Credentials = credentials
@@ -53,7 +56,7 @@ public AzureOpenAIAgentFactory(string endpoint, TokenCredential credentials)
5356
/// <param name="connection">Connection Details</param>
5457
public AzureOpenAIAgentFactory(AzureOpenAIConnection connection)
5558
{
56-
_connection = connection;
59+
Connection = connection;
5760
}
5861

5962

@@ -83,7 +86,7 @@ public AzureOpenAIAgent CreateAgent(string model, string? instructions = null, s
8386
/// <returns>The Agent</returns>
8487
public AzureOpenAIAgent CreateAgent(AgentOptions options)
8588
{
86-
OpenAIClient client = _connection.GetClient(options.RawHttpCallDetails);
89+
OpenAIClient client = Connection.GetClient(options.RawHttpCallDetails);
8790

8891
ChatClientAgentOptions chatClientAgentOptions = CreateChatClientAgentOptions(options);
8992

@@ -101,7 +104,7 @@ public AzureOpenAIAgent CreateAgent(AgentOptions options)
101104
.CreateAIAgent(chatClientAgentOptions, options.ClientFactory, options.LoggerFactory, options.Services);
102105
break;
103106
case null:
104-
innerAgent = _connection.DefaultClientType switch
107+
innerAgent = Connection.DefaultClientType switch
105108
{
106109
ClientType.ChatClient => client
107110
.GetChatClient(options.Model)
@@ -204,7 +207,7 @@ private ChatClientAgentOptions CreateChatClientAgentOptions(AgentOptions options
204207

205208
break;
206209
case null:
207-
chatOptions = _connection.DefaultClientType switch
210+
chatOptions = Connection.DefaultClientType switch
208211
{
209212
ClientType.ChatClient => chatOptions.WithOpenAIChatClientReasoning(new ChatReasoningEffortLevel(reasoningEffortAsString)),
210213
ClientType.ResponsesApi => options.ReasoningSummaryVerbosity switch

src/AgentFrameworkToolkit.AzureOpenAI/AzureOpenAIEmbeddingFactory.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ namespace AgentFrameworkToolkit.AzureOpenAI;
1010
[PublicAPI]
1111
public class AzureOpenAIEmbeddingFactory
1212
{
13-
private readonly AzureOpenAIConnection _connection;
13+
/// <summary>
14+
/// Connection
15+
/// </summary>
16+
public AzureOpenAIConnection Connection { get; }
1417

1518
/// <summary>
1619
/// Constructor
@@ -19,7 +22,7 @@ public class AzureOpenAIEmbeddingFactory
1922
/// <param name="apiKey">Your AzureOpenAI API Key (if you need a more advanced connection use the constructor overload)</param>
2023
public AzureOpenAIEmbeddingFactory(string endpoint, string apiKey)
2124
{
22-
_connection = new AzureOpenAIConnection
25+
Connection = new AzureOpenAIConnection
2326
{
2427
Endpoint = endpoint,
2528
ApiKey = apiKey,
@@ -33,7 +36,7 @@ public AzureOpenAIEmbeddingFactory(string endpoint, string apiKey)
3336
/// <param name="credentials">Your RBAC Credentials (if you need a more advanced connection use the constructor overload)</param>
3437
public AzureOpenAIEmbeddingFactory(string endpoint, TokenCredential credentials)
3538
{
36-
_connection = new AzureOpenAIConnection
39+
Connection = new AzureOpenAIConnection
3740
{
3841
Endpoint = endpoint,
3942
Credentials = credentials
@@ -46,7 +49,7 @@ public AzureOpenAIEmbeddingFactory(string endpoint, TokenCredential credentials)
4649
/// <param name="connection">Connection Details</param>
4750
public AzureOpenAIEmbeddingFactory(AzureOpenAIConnection connection)
4851
{
49-
_connection = connection;
52+
Connection = connection;
5053
}
5154

5255
/// <summary>
@@ -56,7 +59,7 @@ public AzureOpenAIEmbeddingFactory(AzureOpenAIConnection connection)
5659
/// <returns>An Embedding Generator</returns>
5760
public IEmbeddingGenerator<string, Embedding<float>> GetEmbeddingGenerator(string model)
5861
{
59-
return _connection.GetClient().GetEmbeddingClient(model).AsIEmbeddingGenerator();
62+
return Connection.GetClient().GetEmbeddingClient(model).AsIEmbeddingGenerator();
6063
}
6164

6265

src/AgentFrameworkToolkit.Cohere/CohereAgentFactory.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,24 @@ public class CohereAgentFactory
1212
{
1313
private readonly OpenAIAgentFactory _openAIAgentFactory;
1414

15+
/// <summary>
16+
/// Connection
17+
/// </summary>
18+
public CohereConnection Connection { get; }
19+
1520
/// <summary>
1621
/// Constructor
1722
/// </summary>
1823
/// <param name="apiKey">Your Cohere API Key (if you need a more advanced connection use the constructor overload)</param>
1924
public CohereAgentFactory(string apiKey)
2025
{
21-
_openAIAgentFactory = new OpenAIAgentFactory(new OpenAIConnection
26+
Connection = new CohereConnection
2227
{
2328
ApiKey = apiKey,
2429
Endpoint = CohereConnection.DefaultEndpoint
25-
});
30+
};
31+
32+
_openAIAgentFactory = new OpenAIAgentFactory(Connection);
2633
}
2734

2835
/// <summary>
@@ -32,6 +39,7 @@ public CohereAgentFactory(string apiKey)
3239
public CohereAgentFactory(CohereConnection connection)
3340
{
3441
connection.Endpoint ??= CohereConnection.DefaultEndpoint;
42+
Connection = connection;
3543
_openAIAgentFactory = new OpenAIAgentFactory(connection);
3644
}
3745

@@ -63,4 +71,4 @@ public CohereAgent CreateAgent(AgentOptions options)
6371
{
6472
return new CohereAgent(_openAIAgentFactory.CreateAgent(options));
6573
}
66-
}
74+
}

src/AgentFrameworkToolkit.GitHub/GitHubAgentFactory.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ namespace AgentFrameworkToolkit.GitHub;
1010
[PublicAPI]
1111
public class GitHubAgentFactory
1212
{
13-
private readonly GitHubConnection _connection;
13+
/// <summary>
14+
/// Connection
15+
/// </summary>
16+
public GitHubConnection Connection { get; }
1417

1518
/// <summary>
1619
/// Constructor
1720
/// </summary>
1821
/// <param name="personalAccessToken">The GitHub Personal Access Token with Models Access</param>
1922
public GitHubAgentFactory(string personalAccessToken)
2023
{
21-
_connection = new GitHubConnection
24+
Connection = new GitHubConnection
2225
{
2326
AccessToken = personalAccessToken
2427
};
@@ -30,7 +33,7 @@ public GitHubAgentFactory(string personalAccessToken)
3033
/// <param name="connection">Connection Details</param>
3134
public GitHubAgentFactory(GitHubConnection connection)
3235
{
33-
_connection = connection;
36+
Connection = connection;
3437
}
3538

3639
/// <summary>
@@ -59,7 +62,7 @@ public GitHubAgent CreateAgent(string model, string? instructions = null, string
5962
/// <returns>The Agent</returns>
6063
public GitHubAgent CreateAgent(GitHubAgentOptions options)
6164
{
62-
IChatClient client = _connection.GetClient(options.RawHttpCallDetails).AsIChatClient(options.Model);
65+
IChatClient client = Connection.GetClient(options.RawHttpCallDetails).AsIChatClient(options.Model);
6366
AIAgent innerAgent = new ChatClientAgent(client, CreateChatClientAgentOptions(options), options.LoggerFactory, options.Services);
6467

6568
// ReSharper disable once ConvertIfStatementToReturnStatement

src/AgentFrameworkToolkit.Google/GoogleAgentFactory.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ namespace AgentFrameworkToolkit.Google;
1111
[PublicAPI]
1212
public class GoogleAgentFactory
1313
{
14-
private readonly GoogleConnection _connection;
14+
/// <summary>
15+
/// Connection
16+
/// </summary>
17+
public GoogleConnection Connection { get; }
1518

1619
/// <summary>
1720
/// Constructor
1821
/// </summary>
1922
/// <param name="apiKey">Your Google API Key (if you need a more advanced connection use the constructor overload)</param>
2023
public GoogleAgentFactory(string apiKey)
2124
{
22-
_connection = new GoogleConnection
25+
Connection = new GoogleConnection
2326
{
2427
ApiKey = apiKey
2528
};
@@ -31,7 +34,7 @@ public GoogleAgentFactory(string apiKey)
3134
/// <param name="connection">Connection Details</param>
3235
public GoogleAgentFactory(GoogleConnection connection)
3336
{
34-
_connection = connection;
37+
Connection = connection;
3538
}
3639

3740
/// <summary>
@@ -134,13 +137,13 @@ private static ChatClientAgentOptions CreateChatClientAgentOptions(GoogleAgentOp
134137
private IChatClient GetClient(string model)
135138
{
136139
IChatClient client;
137-
if (_connection.Adapter != null)
140+
if (Connection.Adapter != null)
138141
{
139-
client = new GenerativeAIChatClient(_connection.Adapter, model);
142+
client = new GenerativeAIChatClient(Connection.Adapter, model);
140143
}
141-
else if (_connection.ApiKey != null)
144+
else if (Connection.ApiKey != null)
142145
{
143-
client = new GenerativeAIChatClient(_connection.ApiKey, model);
146+
client = new GenerativeAIChatClient(Connection.ApiKey, model);
144147
}
145148
else
146149
{

0 commit comments

Comments
 (0)