Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
singhk97 committed Aug 2, 2024
1 parent 67890a1 commit 17af079
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool)

# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = none

# CS0618: Type or member is obsolete
dotnet_diagnostic.CS0618.severity = none

# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public async void Test_CreateOAuthCard_WithSSOEnabled()

var turnState = await TurnStateConfig.GetTurnStateWithConversationStateAsync(turnContext);
var app = new TestApplication(new() { Adapter = testAdapter });
var authSettings = new OAuthSettings() {
var authSettings = new OAuthSettings()
{
ConnectionName = "connectionName",
Title = "title",
Text = "text",
Expand Down Expand Up @@ -131,7 +132,7 @@ public async void Test_VerifyStateRouteSelector_ReturnsTrue()
}

[Fact]
public async void Test_VerifyStateRouteSelector_IncorrectActivity_ReturnsFalse ()
public async void Test_VerifyStateRouteSelector_IncorrectActivity_ReturnsFalse()
{
// Arrange
var testAdapter = new SimpleAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.Bot.Schema;
using Microsoft.Teams.AI.State;
using Microsoft.Teams.AI.Tests.TestUtils;
using Record = Microsoft.Teams.AI.State.Record;

namespace Microsoft.Teams.AI.Tests.Application
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Record = Microsoft.Teams.AI.State.Record;

namespace Microsoft.Teams.AI.Tests.Application
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.Teams.AI.Tests.TestUtils;
using Moq;
using Newtonsoft.Json.Linq;
using Record = Microsoft.Teams.AI.State.Record;

namespace Microsoft.Teams.AI.Tests.Application
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
using Moq;
using System.Reflection;
using Xunit.Abstractions;
using Microsoft.Extensions.Logging;
using Microsoft.Bot.Schema;
using Microsoft.Teams.AI.AI.Tokenizers;
using Microsoft.Teams.AI.AI.Prompts;
using Microsoft.Teams.AI.AI.Prompts.Sections;
using Microsoft.Extensions.Logging;

namespace Microsoft.Teams.AI.Tests.IntegrationTests
{
public sealed class OpenAIModelTests
{
private readonly IConfigurationRoot _configuration;
private readonly RedirectOutput _output;
#pragma warning disable IDE0052 // Remove unread private members
private readonly ILoggerFactory _loggerFactory;
#pragma warning restore IDE0052 // Remove unread private members

public OpenAIModelTests(ITestOutputHelper output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Microsoft.Teams.AI.Tests.TestUtils
{
internal class OpenAIModelFactory
internal sealed class OpenAIModelFactory
{
public static RunCreationOptions CreateRunOptions()
{
Expand Down Expand Up @@ -52,7 +52,7 @@ public static ThreadMessage CreateThreadMessage(string threadId, string message)
return ModelReaderWriter.Read<ThreadMessage>(BinaryData.FromString(json))!;
}

public static ThreadRun CreateThreadRun(string threadId, string runStatus, string? runId = null, IList<RequiredAction> requiredActions = null)
public static ThreadRun CreateThreadRun(string threadId, string runStatus, string? runId = null, IList<RequiredAction> requiredActions = null!)
{
var raJson = "{}";
if (requiredActions != null && requiredActions.Count > 0)
Expand Down Expand Up @@ -91,7 +91,7 @@ public static ThreadRun CreateThreadRun(string threadId, string runStatus, strin
}
}

internal class TestRequiredAction : RequiredAction
internal sealed class TestRequiredAction : RequiredAction
{
public new string FunctionName;

Expand All @@ -107,7 +107,7 @@ public TestRequiredAction(string toolCallId, string functionName, string functio
}
}

internal class TestAsyncPageableCollection<T> : AsyncPageableCollection<T> where T : class
internal sealed class TestAsyncPageableCollection<T> : AsyncPageableCollection<T> where T : class
{
public List<T> Items;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public override Task<ClientResult<AssistantThread>> CreateThreadAsync(ThreadCrea
return Task.FromResult(ClientResult.FromValue(newThread, Mock.Of<PipelineResponse>()));
}

public override Task<ClientResult<ThreadMessage>> CreateMessageAsync(string threadId, MessageRole role, IEnumerable<MessageContent> content, MessageCreationOptions options = null, CancellationToken cancellationToken = default)
public override Task<ClientResult<ThreadMessage>> CreateMessageAsync(string threadId, MessageRole role, IEnumerable<MessageContent> content, MessageCreationOptions options = null!, CancellationToken cancellationToken = default)
{
ThreadMessage newMessage = _CreateMessage(threadId, content.First().Text);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public OpenAIEmbeddings(OpenAIEmbeddingsOptions options, ILoggerFactory? loggerF
options.RetryPolicy = options.RetryPolicy ?? new List<TimeSpan> { TimeSpan.FromMilliseconds(2000), TimeSpan.FromMilliseconds(5000) };
_logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger<OpenAIModel>();

OpenAIEmbeddingsOptions embeddingsOptions = (OpenAIEmbeddingsOptions)_options;
OpenAIClientOptions openAIClientOptions = new()
{
RetryPolicy = new SequentialDelayRetryPolicy(options.RetryPolicy!, options.RetryPolicy!.Count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public class AssistantsPlanner<TState> : IPlanner<TState>

private readonly AssistantsPlannerOptions _options;
private readonly AssistantClient _client;

// TODO: Write trace logs
#pragma warning disable IDE0052 // Remove unread private members
private readonly ILogger _logger;
#pragma warning restore IDE0052 // Remove unread private members

/// <summary>
/// Create new AssistantsPlanner.
Expand Down

0 comments on commit 17af079

Please sign in to comment.