Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AIProjectClientCreateTests
public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string createMechanism)
{
// Arrange.
const string AgentName = "IntegrationTestAgent";
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("IntegrationTestAgent");
const string AgentDescription = "An agent created during integration tests";
const string AgentInstructions = "You are an integration test agent";

Expand Down Expand Up @@ -86,7 +86,7 @@ public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string create
public async Task CreateAgent_CreatesAgentWithVectorStoresAsync(string createMechanism)
{
// Arrange.
const string AgentName = "VectorStoreAgent";
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("VectorStoreAgent");
const string AgentInstructions = """
You are a helpful agent that can help fetch data from files you know about.
Use the File Search Tool to look up codes for words.
Expand Down Expand Up @@ -159,7 +159,7 @@ You are a helpful agent that can help fetch data from files you know about.
public async Task CreateAgent_CreatesAgentWithCodeInterpreterAsync(string createMechanism)
{
// Arrange.
const string AgentName = "CodeInterpreterAgent";
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("CodeInterpreterAgent");
const string AgentInstructions = """
You are a helpful coding agent. A Python file is provided. Use the Code Interpreter Tool to run the file
and report the SECRET_NUMBER value it prints. Respond only with the number.
Expand Down Expand Up @@ -229,7 +229,7 @@ and report the SECRET_NUMBER value it prints. Respond only with the number.
public async Task CreateAgent_CreatesAgentWithAIFunctionToolsAsync(string createMechanism)
{
// Arrange.
const string AgentName = "WeatherAgent";
string AgentName = AIProjectClientFixture.GenerateUniqueAgentName("WeatherAgent");
const string AgentInstructions = "You are a helpful weather assistant. Always call the GetWeather function to answer questions about weather.";

static string GetWeather(string location) => $"The weather in {location} is sunny with a high of 23C.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public async Task<ChatClientAgent> CreateChatClientAgentAsync(
return await this._client.CreateAIAgentAsync(GenerateUniqueAgentName(name), model: s_config.DeploymentName, instructions: instructions, tools: aiTools);
}

private static string GenerateUniqueAgentName(string baseName) =>
public static string GenerateUniqueAgentName(string baseName) =>
$"{baseName}-{Guid.NewGuid().ToString("N").Substring(0, 8)}";

public Task DeleteAgentAsync(ChatClientAgent agent) =>
Expand Down
Loading