Enable more analyzers and various code tweaks/cleanup (#738)

This commit is contained in:
Stephen Toub
2025-09-18 01:48:25 +00:00
committed by GitHub
parent f3264966ff
commit 5e5761b288
326 changed files with 2402 additions and 3642 deletions
@@ -30,10 +30,8 @@ public class OpenAIChatCompletionFixture : IChatClientAgentFixture
public IChatClient ChatClient => this._agent.ChatClient;
public async Task<List<ChatMessage>> GetChatHistoryAsync(AgentThread thread)
{
return thread.MessageStore is null ? [] : (await thread.MessageStore.GetMessagesAsync()).ToList();
}
public async Task<List<ChatMessage>> GetChatHistoryAsync(AgentThread thread) =>
thread.MessageStore is null ? [] : (await thread.MessageStore.GetMessagesAsync()).ToList();
public Task<ChatClientAgent> CreateChatClientAgentAsync(
string name = "HelpfulAssistant",
@@ -52,25 +50,17 @@ public class OpenAIChatCompletionFixture : IChatClientAgentFixture
}));
}
public Task DeleteAgentAsync(ChatClientAgent agent)
{
public Task DeleteAgentAsync(ChatClientAgent agent) =>
// Chat Completion does not require/support deleting agents, so this is a no-op.
return Task.CompletedTask;
}
Task.CompletedTask;
public Task DeleteThreadAsync(AgentThread thread)
{
public Task DeleteThreadAsync(AgentThread thread) =>
// Chat Completion does not require/support deleting threads, so this is a no-op.
return Task.CompletedTask;
}
Task.CompletedTask;
public async Task InitializeAsync()
{
public async Task InitializeAsync() =>
this._agent = await this.CreateChatClientAgentAsync();
}
public Task DisposeAsync()
{
return Task.CompletedTask;
}
public Task DisposeAsync() =>
Task.CompletedTask;
}