Skip to content

Add tool result support #1684

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

Merged
merged 5 commits into from
Mar 27, 2025
Merged

Add tool result support #1684

merged 5 commits into from
Mar 27, 2025

Conversation

Kitenite
Copy link
Contributor

@Kitenite Kitenite commented Mar 27, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


Important

Add ToolChatMessageImpl and integrate tool messages into chat system with updated dependencies.

  • Behavior:
    • Adds ToolChatMessageImpl class in message/tool.ts to handle tool messages.
    • Updates ChatConversationImpl in conversation.ts to support ToolChatMessageImpl.
    • Adds addCoreToolMessage() in ConversationManager to append tool messages.
    • Modifies ChatManager in chat/index.ts to handle TOOL role messages.
  • Rendering:
    • Adds ToolMessage component in ToolMessage.tsx to render tool messages.
    • Updates ChatMessages in index.tsx to include tool messages.
  • Dependencies:
    • Updates ai dependency version to ^4.2.6 in package.json files.
  • Misc:
    • Adds TOOL to ChatMessageRole in message.ts.

This description was created by Ellipsis for 5f049c6. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 4bda389 in 1 minute and 46 seconds

More details
  • Looked at 489 lines of code in 14 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. packages/ai/package.json:34
  • Draft comment:
    Dependency 'ai' version updated to ^4.2.6. Ensure consistency across all packages.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. packages/models/package.json:36
  • Draft comment:
    Dependency 'ai' version updated to ^4.2.6 for consistency across projects.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. packages/models/src/chat/message/message.ts:9
  • Draft comment:
    Added TOOL role; ensure CoreToolMessage is compatible with your implementations.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. packages/models/src/chat/message/message.ts:27
  • Draft comment:
    Export interface for ToolChatMessage added; verify that downstream usage handles 'id' correctly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
5. packages/ai/package.json:35
  • Draft comment:
    Dependency upgrade: The 'ai' dependency has been updated to ^4.2.6. Verify that this version is fully compatible with the rest of the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. packages/models/package.json:36
  • Draft comment:
    Consistent dependency update: 'ai' is now ^4.2.6. Ensure version alignment across all packages.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
7. packages/models/src/chat/message/message.ts:27
  • Draft comment:
    The new ToolChatMessage interface extending CoreToolMessage is defined correctly. Confirm that CoreToolMessage now includes the needed structure.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
8. apps/studio/package.json:30
  • Draft comment:
    The script key 'pree2e' looks like it might be a typographical error. Did you mean 'pre:e2e' (with a colon) or something similar? Please verify and fix if needed.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
9. packages/ai/package.json:3
  • Draft comment:
    Typo: In the description ('A AI library for Onlook'), consider changing 'A AI' to 'An AI' for correct grammar.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_H9TIwxCC1V4oLroS


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 5f049c6 in 39 seconds

More details
  • Looked at 27 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. apps/studio/src/lib/editor/engine/chat/conversation/conversation.ts:89
  • Draft comment:
    Removed extraneous console.log. Ensure it's intentional and not needed for debugging.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. apps/studio/src/lib/editor/engine/chat/stream.ts:52
  • Draft comment:
    Updated resolveToolCallPart parameter to accept union types; removal of ts-expect error comment is appropriate.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. apps/studio/src/lib/editor/engine/chat/conversation/conversation.ts:89
  • Draft comment:
    Good removal of debug logging; avoid console.log in production. Use a dedicated logger for debugging if needed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. apps/studio/src/lib/editor/engine/chat/stream.ts:52
  • Draft comment:
    Extending the payload type to include ToolCallPart and ToolResultPart improves type safety; removal of ts-expect-error is appropriate.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
5. apps/studio/src/lib/editor/engine/chat/conversation/conversation.ts:1
  • Draft comment:
    PR title/issue mentions onboarding docs updates, but diff shows only tool-related code changes. Ensure documentation updates are included.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_wDTp1K73g8T29IUG


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Kitenite Kitenite changed the title Add tools Add tool result support Mar 27, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Skipped PR review on 1113746 because no changed files had a supported extension. If you think this was in error, please contact us and we'll fix it right away.

@Kitenite Kitenite merged commit 42b3dc5 into main Mar 27, 2025
@Kitenite Kitenite deleted the feat/add-tools branch March 27, 2025 19:03
zongkelong pushed a commit to zongkelong/coolook that referenced this pull request Mar 28, 2025
…slation_zh

* 'main' of https://github.com/onlook-dev/onlook:
  fix: error when add new color to group (onlook-dev#1683)
  update searching brand color picker (onlook-dev#1681)
  Quicker build with freestyle (onlook-dev#1685)
  Add tool result support (onlook-dev#1684)
  feat: Include tool-result in chat (onlook-dev#1682)
ml-delaurier pushed a commit to ml-delaurier/nolook that referenced this pull request Apr 23, 2025
* feat: Include tool-result in chat

* Add tool impl in conversation

---------

Co-authored-by: Wh1isper <[email protected]>
t1c1 pushed a commit to t1c1/onlookbotcodes that referenced this pull request Jun 5, 2025
* feat: Include tool-result in chat

* Add tool impl in conversation

---------

Co-authored-by: Wh1isper <[email protected]>
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.

2 participants