Skip to content

Commit

Permalink
Corrected SearchInvokeValue.QueryOptions type
Browse files Browse the repository at this point in the history
  • Loading branch information
Tracy Boehrer committed Jan 29, 2025
1 parent b0d56ce commit 73bdbf2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public SearchInvokeValue()
/// <param name="queryText"> The query text of this search invoke action value. </param>
/// <param name="queryOptions"> The query options for the query. </param>
/// <param name="context"> The context information about the query. </param>
internal SearchInvokeValue(string kind, string queryText, object queryOptions, object context)
internal SearchInvokeValue(string kind, string queryText, SearchInvokeOptions queryOptions, object context)
{
Kind = kind;
QueryText = queryText;
Expand All @@ -31,7 +31,7 @@ internal SearchInvokeValue(string kind, string queryText, object queryOptions, o
/// <summary> The query text of this search invoke action value. </summary>
public string QueryText { get; set; }
/// <summary> The query options for the query. </summary>
public object QueryOptions { get; set; }
public SearchInvokeOptions QueryOptions { get; set; }
/// <summary> The context information about the query. </summary>
public object Context { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Agents.Core.Models;
using System.Text.Json;

namespace Microsoft.Agents.Core.Serialization.Converters
{
internal class SearchInvokeValueConverter : ConnectorConverter<SearchInvokeValue>
{
/// <inheritdoc/>
protected override bool TryReadGenericProperty(ref Utf8JsonReader reader, SearchInvokeValue value, string propertyName, JsonSerializerOptions options)
{
if (propertyName.Equals(nameof(value.Context)))
{
SetGenericProperty(ref reader, data => value.Context = data, options);
}
else
{
return false;
}

return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Text.Json.Serialization;
using Microsoft.Agents.Core.Serialization.Converters;
using Microsoft.Agents.Core.SharePoint.Serialization.Converters;
using Microsoft.Agents.Core.Teams.Models;
using Microsoft.Agents.Core.Teams.Serialization.Converters;

namespace Microsoft.Agents.Core.Serialization
Expand Down Expand Up @@ -57,6 +56,7 @@ private static JsonSerializerOptions ApplyCoreOptions(this JsonSerializerOptions
options.Converters.Add(new Array2DConverter());
options.Converters.Add(new DictionaryOfObjectConverter());
options.Converters.Add(new SuggestedActionsConverter());
options.Converters.Add(new SearchInvokeValueConverter());

return options;
}
Expand Down

0 comments on commit 73bdbf2

Please sign in to comment.