mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [BREAKING] Renamed CreateAIAgent/GetAIAgent to AsAIAgent (#3222)
* Renamed chat client extension method * Additional renaming * Updated documentation * Fixed tests * Small fix * Small fix
This commit is contained in:
+8
-8
@@ -42,7 +42,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
|
||||
// Act & Assert - null agentId
|
||||
var exception1 = Assert.Throws<ArgumentException>(() =>
|
||||
mockClient.Object.GetAIAgent((string)null!));
|
||||
mockClient.Object.GetAIAgent(null!));
|
||||
Assert.Equal("agentId", exception1.ParamName);
|
||||
|
||||
// Act & Assert - empty agentId
|
||||
@@ -314,7 +314,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
};
|
||||
|
||||
// Act
|
||||
var agent = client.GetAIAgent(response, options);
|
||||
var agent = client.AsAIAgent(response, options);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(agent);
|
||||
@@ -341,7 +341,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
};
|
||||
|
||||
// Act
|
||||
var agent = client.GetAIAgent(persistentAgent, options);
|
||||
var agent = client.AsAIAgent(persistentAgent, options);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(agent);
|
||||
@@ -363,7 +363,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
var options = new ChatClientAgentOptions(); // Empty options
|
||||
|
||||
// Act
|
||||
var agent = client.GetAIAgent(persistentAgent, options);
|
||||
var agent = client.AsAIAgent(persistentAgent, options);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(agent);
|
||||
@@ -443,7 +443,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
};
|
||||
|
||||
// Act
|
||||
var agent = client.GetAIAgent(
|
||||
var agent = client.AsAIAgent(
|
||||
persistentAgent,
|
||||
options,
|
||||
clientFactory: (innerClient) => testChatClient);
|
||||
@@ -470,7 +470,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
|
||||
// Act & Assert
|
||||
var exception = Assert.Throws<ArgumentNullException>(() =>
|
||||
client.GetAIAgent((Response<PersistentAgent>)null!, options));
|
||||
client.AsAIAgent(null!, options));
|
||||
|
||||
Assert.Equal("persistentAgentResponse", exception.ParamName);
|
||||
}
|
||||
@@ -487,7 +487,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
|
||||
// Act & Assert
|
||||
var exception = Assert.Throws<ArgumentNullException>(() =>
|
||||
client.GetAIAgent((PersistentAgent)null!, options));
|
||||
client.AsAIAgent((PersistentAgent)null!, options));
|
||||
|
||||
Assert.Equal("persistentAgentMetadata", exception.ParamName);
|
||||
}
|
||||
@@ -504,7 +504,7 @@ public sealed class PersistentAgentsClientExtensionsTests
|
||||
|
||||
// Act & Assert
|
||||
var exception = Assert.Throws<ArgumentNullException>(() =>
|
||||
client.GetAIAgent(persistentAgent, (ChatClientAgentOptions)null!));
|
||||
client.AsAIAgent(persistentAgent, (ChatClientAgentOptions)null!));
|
||||
|
||||
Assert.Equal("options", exception.ParamName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user