Skip to content

chore: Improve UX for Orchestration chat scenario#543

Merged
shibeshduw merged 25 commits intomainfrom
orchestration-chat-ux
May 6, 2025
Merged

chore: Improve UX for Orchestration chat scenario#543
shibeshduw merged 25 commits intomainfrom
orchestration-chat-ux

Conversation

@shibeshduw
Copy link
Contributor

@shibeshduw shibeshduw commented Feb 12, 2025

Context

Closes SAP/ai-sdk-js-backlog#228.

What this PR does and why it is needed

Summary:

  • Added helper functions getAllMessages(), getAssistantMessages, getToolCalls() and getRefusal().
  • Added unit tests for the above.
  • Added test cases for using getAllMessages() to provide messageHistory in subsequent chat completion requests.
  • Added test case to check if orchestration responses with tool_calls can now be added to the messageHistory on subsequent chat completion requests.

Tested on intber landscape with latest spec: https://github.tools.sap/AI/llm-orchestration/blob/main/src/spec/api.yaml

Docs PR: SAP/ai-sdk#79

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

@shibeshduw shibeshduw marked this pull request as ready for review February 13, 2025 09:44
@shibeshduw shibeshduw changed the title feat: Add helper functions to improve Orchestration UX chore: Improve UX for Orchestration chat scenario Feb 13, 2025
Copy link
Contributor

@KavithaSiva KavithaSiva left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but I would prefer a test added with the a sample multiChat response.

@shibeshduw shibeshduw marked this pull request as draft February 25, 2025 09:13
@deekshas8 deekshas8 added the blocked Issue or PR blocked due to other issues. label Mar 10, 2025
@shibeshduw shibeshduw marked this pull request as ready for review April 25, 2025 07:50
@shibeshduw shibeshduw requested a review from KavithaSiva April 25, 2025 08:38
Copy link
Contributor

@ZhongpinWang ZhongpinWang left a comment

Choose a reason for hiding this comment

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

will continue

@ZhongpinWang ZhongpinWang removed the blocked Issue or PR blocked due to other issues. label Apr 25, 2025
@shibeshduw shibeshduw dismissed stale reviews from deekshas8 and KavithaSiva May 6, 2025 11:33

Stale Review

Co-authored-by: Zhongpin Wang <zhongpin.wang@sap.com>
@shibeshduw shibeshduw enabled auto-merge (squash) May 6, 2025 11:48
@shibeshduw shibeshduw merged commit 77efa15 into main May 6, 2025
10 checks passed
@shibeshduw shibeshduw deleted the orchestration-chat-ux branch May 6, 2025 11:49
const response: OrchestrationResponse = await orchestrationToolCalling();
const allMessages: ChatMessages = response.getAllMessages();
const initialResponse: AssistantChatMessage | undefined =
response.getAssistantMessage();
Copy link
Member

Choose a reason for hiding this comment

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

this would only be undefined, if there was a content filter hit, right? If so, maybe response.getAssistantMessage()! is clearer.


return orchestrationClient(
[{ role: 'user', content: 'What is the corresponding roman numeral?' }],
addNumbersTool
Copy link
Member

Choose a reason for hiding this comment

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

this tool is not really required for this request, right? For simplicity, maybe leave it out?

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