Skip to content

Semantic Reranking: Refactors RerankResult.Document to return string type#5528

Merged
kirankumarkolli merged 4 commits into
masterfrom
users/nalutripician/semanticRerankParseFix
Dec 16, 2025
Merged

Semantic Reranking: Refactors RerankResult.Document to return string type#5528
kirankumarkolli merged 4 commits into
masterfrom
users/nalutripician/semanticRerankParseFix

Conversation

@NaluTripician
Copy link
Copy Markdown
Contributor

Pull Request Template

Description

This pull request updates the handling of the Document property in the RerankScore class and its deserialization logic to consistently use a string type instead of a generic object. This change simplifies the type system and ensures that document content or identifiers are always represented as strings which is returned by the service.

Type consistency and deserialization improvements:

  • Changed the Document property in the RerankScore class from object to string, and updated the constructor accordingly to require a string document. [1] [2]
  • Updated the deserialization logic in DeserializeSemanticRerankResult to always store the document as a string, either by using the raw JSON text for objects or the string value directly, ensuring type consistency throughout the codebase.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)

Closing issues

To automatically close an issue: closes #IssueNumber

@kirankumarkolli kirankumarkolli enabled auto-merge (squash) December 16, 2025 19:04
@kirankumarkolli kirankumarkolli merged commit f27899a into master Dec 16, 2025
32 checks passed
@kirankumarkolli kirankumarkolli deleted the users/nalutripician/semanticRerankParseFix branch December 16, 2025 19:35
NaluTripician added a commit that referenced this pull request Dec 17, 2025
…ng` type (#5528)

# Pull Request Template

## Description

This pull request updates the handling of the `Document` property in the
`RerankScore` class and its deserialization logic to consistently use a
`string` type instead of a generic `object`. This change simplifies the
type system and ensures that document content or identifiers are always
represented as strings which is returned by the service.

Type consistency and deserialization improvements:

* Changed the `Document` property in the `RerankScore` class from
`object` to `string`, and updated the constructor accordingly to require
a `string` document.
[[1]](diffhunk://#diff-8278775c5227f8e0f3aa61d4b0a96434387143cde3ea6a4e1d4445362a559530L21-R21)
[[2]](diffhunk://#diff-8278775c5227f8e0f3aa61d4b0a96434387143cde3ea6a4e1d4445362a559530L39-R39)
* Updated the deserialization logic in `DeserializeSemanticRerankResult`
to always store the document as a string, either by using the raw JSON
text for objects or the string value directly, ensuring type consistency
throughout the codebase.

## Type of change

Please delete options that are not relevant.

- [] Bug fix (non-breaking change which fixes an issue)

## Closing issues

To automatically close an issue: closes #IssueNumber
microsoft-github-policy-service Bot pushed a commit that referenced this pull request Dec 17, 2025
# Pull Request Template

## Description

Adds cherry-picks for release branch: 
#5528 - Semantic Reranking type fix
#5531 - Version change / contracts

## Type of change

Please delete options that are not relevant.

- [] New feature (non-breaking change which adds functionality)

## Closing issues

To automatically close an issue: closes #IssueNumber
NaluTripician added a commit that referenced this pull request Jan 14, 2026
…ng` type (#5528)

# Pull Request Template

## Description

This pull request updates the handling of the `Document` property in the
`RerankScore` class and its deserialization logic to consistently use a
`string` type instead of a generic `object`. This change simplifies the
type system and ensures that document content or identifiers are always
represented as strings which is returned by the service.

Type consistency and deserialization improvements:

* Changed the `Document` property in the `RerankScore` class from
`object` to `string`, and updated the constructor accordingly to require
a `string` document.
[[1]](diffhunk://#diff-8278775c5227f8e0f3aa61d4b0a96434387143cde3ea6a4e1d4445362a559530L21-R21)
[[2]](diffhunk://#diff-8278775c5227f8e0f3aa61d4b0a96434387143cde3ea6a4e1d4445362a559530L39-R39)
* Updated the deserialization logic in `DeserializeSemanticRerankResult`
to always store the document as a string, either by using the raw JSON
text for objects or the string value directly, ensuring type consistency
throughout the codebase.

## Type of change

Please delete options that are not relevant.

- [] Bug fix (non-breaking change which fixes an issue)

## Closing issues

To automatically close an issue: closes #IssueNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Integration auto-merge Enables automation to merge PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants