Skip to content
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

Add generativeDirectAnswer service #263

Merged
merged 14 commits into from
Jun 6, 2024
Merged

Add generativeDirectAnswer service #263

merged 14 commits into from
Jun 6, 2024

Conversation

anguyen-yext2
Copy link
Contributor

J=CLIP-1226
TEST=auto,manual

ran and saw jest test pass.
tested the gda endpoint locally via core test site, saw appropriate api resp
onse.

Yen Truong and others added 2 commits May 14, 2024 14:24
J=CLIP-1226
TEST=auto,manual

ran and saw jest test pass.
tested the gda endpoint locally via core test site, saw appropriate api resp
onse.
@anguyen-yext2 anguyen-yext2 requested a review from a team as a code owner June 4, 2024 15:25
@coveralls
Copy link

coveralls commented Jun 4, 2024

Pull Request Test Coverage Report for Build 9369880764

Details

  • 16 of 20 (80.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.1%) to 88.286%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 10 11 90.91%
src/transformers/generativedirectanswerservice/createGenerativeDirectAnswerResponse.ts 3 5 60.0%
Totals Coverage Status
Change from base Build 7701374089: -1.1%
Covered Lines: 234
Relevant Lines: 258

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 4, 2024

Pull Request Test Coverage Report for Build 9369891182

Details

  • 16 of 20 (80.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.1%) to 88.286%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 10 11 90.91%
src/transformers/generativedirectanswerservice/createGenerativeDirectAnswerResponse.ts 3 5 60.0%
Totals Coverage Status
Change from base Build 7701374089: -1.1%
Covered Lines: 234
Relevant Lines: 258

💛 - Coveralls

@EmilyZhang777 EmilyZhang777 requested a review from a team June 4, 2024 15:28
@coveralls
Copy link

coveralls commented Jun 4, 2024

Pull Request Test Coverage Report for Build 9370359911

Details

  • 16 of 20 (80.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.1%) to 88.286%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 10 11 90.91%
src/transformers/generativedirectanswerservice/createGenerativeDirectAnswerResponse.ts 3 5 60.0%
Totals Coverage Status
Change from base Build 7701374089: -1.1%
Covered Lines: 234
Relevant Lines: 258

💛 - Coveralls

should have been covered in api response validator
@coveralls
Copy link

coveralls commented Jun 4, 2024

Pull Request Test Coverage Report for Build 9370662744

Details

  • 14 of 16 (87.5%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.962%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 10 11 90.91%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 232
Relevant Lines: 254

💛 - Coveralls

Copy link
Contributor

@EmilyZhang777 EmilyZhang777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But will defer to Clippy. Only have a nit

src/validation/ApiResponseValidator.ts Outdated Show resolved Hide resolved
Copy link

@nbramblett nbramblett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all seems fine to me but I would definitely like for Yen to TAL

@nbramblett nbramblett requested a review from yen-tt June 4, 2024 18:53
@coveralls
Copy link

coveralls commented Jun 4, 2024

Pull Request Test Coverage Report for Build 9372673931

Details

  • 13 of 15 (86.67%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.938%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 10 11 90.91%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 231
Relevant Lines: 253

💛 - Coveralls

/** The text of the user-written query that prompted Search results. */
searchTerm: string,
/** The complete set of Search Results */
results: VerticalResults | Record<string, VerticalResults[]>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps I missed something, but why is the type a map of key to results? why not just an array of VerticalResults?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we defined results in GDAApiRequestBody to be of type struct, so we can't pass in array. VerticalResults is for a Vertical Search Result, Record<string, VerticalResults[]> is for a Universal Search Result.
I think there is another way I could accomplish this: keep results to be of type VerticalResults[], then in GDAServiceImpl, convert request.results to object before sending the api request. Something like this:

let results: Object = {}
if (request.results.length === 1) {
    results = request.results[1]
} else if (request.results.length > 1) {
    results = {verticals: request.results}
}

let me know if you prefer this way, then I can change and test it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think that would work better so user of core don't have to transform the universal results themselves

@coveralls
Copy link

coveralls commented Jun 5, 2024

Pull Request Test Coverage Report for Build 9389260743

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 15 16 93.75%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 236
Relevant Lines: 258

💛 - Coveralls

Copy link
Contributor

@yen-tt yen-tt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you going to publish a new version or wait for search's publish cycle? If it's the former, then you should bump the version in package.json

src/infra/GenerativeDirectAnswerServiceImpl.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jun 5, 2024

Pull Request Test Coverage Report for Build 9389682713

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 15 16 93.75%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 236
Relevant Lines: 258

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 5, 2024

Pull Request Test Coverage Report for Build 9391319665

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 15 16 93.75%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 236
Relevant Lines: 258

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 5, 2024

Pull Request Test Coverage Report for Build 9391326582

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 15 16 93.75%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 236
Relevant Lines: 258

💛 - Coveralls

package.json Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jun 6, 2024

Pull Request Test Coverage Report for Build 9403239505

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 15 16 93.75%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 236
Relevant Lines: 258

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 6, 2024

Pull Request Test Coverage Report for Build 9403250729

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 88.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SearchCore.ts 0 1 0.0%
src/infra/GenerativeDirectAnswerServiceImpl.ts 15 16 93.75%
Totals Coverage Status
Change from base Build 7701374089: -0.4%
Covered Lines: 236
Relevant Lines: 258

💛 - Coveralls

@anguyen-yext2 anguyen-yext2 merged commit e2fe1fd into master Jun 6, 2024
11 of 12 checks passed
@anguyen-yext2 anguyen-yext2 deleted the dev/gda-support branch June 6, 2024 16:34
anguyen-yext2 pushed a commit that referenced this pull request Jun 10, 2024
Add generativeDirectAnswer service (#263)

J=CLIP-1226
TEST=auto,manual

Co-authored-by: Yen Truong <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
anguyen-yext2 added a commit that referenced this pull request Jun 10, 2024
anguyen-yext2 added a commit that referenced this pull request Jun 26, 2024
Fondryext pushed a commit that referenced this pull request Dec 9, 2024
Add generativeDirectAnswer service (#263)

J=CLIP-1226
TEST=auto,manual

Co-authored-by: Yen Truong <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants