-
Notifications
You must be signed in to change notification settings - Fork 0
Johnhuang/12768045 rank processor #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution | |
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{0F88C67F-34D2-4C68-B5BF-08A547D4CC2E}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core", "..\core\Azure.Core\src\Azure.Core.csproj", "{CFB35402-69EB-448F-82B7-2D284730B0A6}" | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have to add this project because Azure.Core.TestFramework depends on this. |
||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
|
|
@@ -35,6 +37,10 @@ Global | |
| {0F88C67F-34D2-4C68-B5BF-08A547D4CC2E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {0F88C67F-34D2-4C68-B5BF-08A547D4CC2E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {0F88C67F-34D2-4C68-B5BF-08A547D4CC2E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {CFB35402-69EB-448F-82B7-2D284730B0A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {CFB35402-69EB-448F-82B7-2D284730B0A6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {CFB35402-69EB-448F-82B7-2D284730B0A6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {CFB35402-69EB-448F-82B7-2D284730B0A6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <AssemblyTitle>Microsoft Azure.AI.Personalizer client library</AssemblyTitle> | ||
| <Version>2.0.0-beta.2</Version> | ||
|
|
@@ -33,6 +33,7 @@ | |
| <ItemGroup> | ||
| <PackageReference Include="Azure.Core" /> | ||
| <PackageReference Include="Microsoft.RL" VersionOverride="1.0.18120003-INTERNAL" /> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Need to take time to investigate whether we can remove VersionOverride in this file. |
||
| <PackageReference Include="System.Text.Json" VersionOverride="6.0.1" /> | ||
|
||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Text.Json; | ||
| using System.Text.Json.Serialization; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
|
|
||
| namespace Azure.AI.Personalizer | ||
| { | ||
| /// <summary> The Decision Context. </summary> | ||
| public class DecisionContext | ||
| { | ||
| /// <summary> The Decision Context used to serialize an object. </summary> | ||
| public DecisionContext() | ||
| { | ||
| } | ||
|
|
||
| /// <summary> Initializes a new instance of DecisionContext. </summary> | ||
| /// <param name="contextFeatures"> The context feature </param> | ||
| /// <param name="rankableActions"> Rankable actions </param> | ||
| public DecisionContext(IEnumerable<object> contextFeatures, List<PersonalizerRankableAction> rankableActions) | ||
| { | ||
| this.ContextFeatures = contextFeatures.Select(f => JsonSerializer.Serialize(f)).ToList(); | ||
| this.Documents = rankableActions | ||
| .Select(action => | ||
| { | ||
| List<string> actionFeatures = action.Features.Select(f => JsonSerializer.Serialize(f)).ToList(); | ||
|
|
||
| return new DecisionContextDocument(action.Id, actionFeatures); | ||
| }).ToArray(); | ||
| } | ||
|
|
||
| /// <summary> Properties from url </summary> | ||
| [JsonPropertyName("FromUrl")] | ||
| [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
| [JsonConverter(typeof(JsonRawStringListConverter))] | ||
| public List<string> ContextFeatures { get; } | ||
|
|
||
| /// <summary> Properties of documents </summary> | ||
| [JsonPropertyName("_multi")] | ||
| public DecisionContextDocument[] Documents { get; set; } | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. |
||
|
|
||
| /// <summary> Properties of slots </summary> | ||
| [JsonPropertyName("_slots")] | ||
| [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
| public DecisionContextDocument[] Slots { get; set; } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is external code, I dont think we should be changing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, without this change, building will fail.