@@ -17,7 +17,10 @@ namespace AgentFrameworkToolkit.AzureOpenAI;
1717[ PublicAPI ]
1818public 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
0 commit comments