Skip to content

Conversation

@Jonas-Isr
Copy link
Member

@Jonas-Isr Jonas-Isr commented Jan 23, 2025

Context

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

We want to support using images and prompts with multiple text messages as input for Orchestration.

Feature scope:

  • Added possibility of using image and multiple text messages in prompts
  • Added Convenience layer

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

@Jonas-Isr

This comment was marked as outdated.

@Jonas-Isr Jonas-Isr self-assigned this Jan 27, 2025
Comment on lines 76 to 77
default ChatMessagesInner createChatMessage() {
if (this.getContent() instanceof MessageContentSingle) {
return ChatMessage.create().role(role()).content(content());
} else if (this.getContent() instanceof MessageContentMulti mCMulti) {
if (this.content() instanceof MessageContentSingle) {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Minor/Opinion)

I think it's a mistake to have this method on public API.
Maybe we could address this in another PR.

@Jonas-Isr

This comment was marked as outdated.

Copy link
Contributor

@newtork newtork left a comment

Choose a reason for hiding this comment

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

I want to explain my assumptions for convenience API behavior / contract.

  • For request:

    • the user will only use public constructors and factory methods for easy instantiation.
    • low API hierarchy requirement; we'll try to avoid users to define helper classes.
    • strict value checking on design time; only allow what's aligned in spec.
  • For responses:

    • developer uses public accessors.
    • while casting may be necessary, let's try to minimalize the effort.
    • hierarchy can be high as long as it's reasonable.
    • loose value checking; whatever is sent back from server can be read with our API.

newtork
newtork previously approved these changes Feb 9, 2025
# Conflicts:
#	docs/release-notes/release_notes.md
@Jonas-Isr Jonas-Isr merged commit 0b6bc03 into main Feb 10, 2025
6 checks passed
@Jonas-Isr Jonas-Isr deleted the orchestration-image-support branch February 10, 2025 10:20
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.

6 participants