Skip to content

Conversation

@rpanackal
Copy link
Member

@rpanackal rpanackal commented Jan 15, 2025

Context

AI/ai-sdk-java-backlog#144.

Extend the unit test for covering the request serialisation as well.

Feature scope:

  • Add sample request json for grounding

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@rpanackal rpanackal self-assigned this Jan 15, 2025
@rpanackal rpanackal added the please-review Request to review a pull-request label Jan 15, 2025
Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

Comment on lines +160 to +178
final var groundingConfigConfig =
GroundingModuleConfigConfig.create()
.inputParams(List.of("query"))
.outputParam("results")
.addFiltersItem(databaseFilter);
final var groundingConfig =
GroundingModuleConfig.create()
.type(GroundingModuleConfig.TypeEnum.DOCUMENT_GROUNDING_SERVICE)
.config(groundingConfigConfig);
final var configWithGrounding = config.withGroundingConfig(groundingConfig);

final Map<String, String> inputParams =
Map.of("query", "String used for similarity search in database");
final var prompt =
new OrchestrationPrompt(
inputParams,
Message.system("Context message with embedded grounding results. {{?results}}"));

final var response = client.chatCompletion(prompt, configWithGrounding);
Copy link
Contributor

Choose a reason for hiding this comment

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

(Question)

This is supposed to be the expected convenience API usage, right?
Looks tough.

Copy link
Member

Choose a reason for hiding this comment

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

no, this is generated code only.

@MatKuhr MatKuhr merged commit 1b6d286 into main Jan 17, 2025
6 checks passed
@MatKuhr MatKuhr deleted the test/grounding-config branch January 17, 2025 11:08
@rpanackal rpanackal restored the test/grounding-config branch March 31, 2025 13:38
@rpanackal rpanackal deleted the test/grounding-config branch March 31, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please-review Request to review a pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants