Skip to content

Conversation

@LavaCxx
Copy link

@LavaCxx LavaCxx commented Apr 16, 2025

Context

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Update convertToOpenAiMessages in openai-format.ts to join non-tool user messages with newline separator.

  • Behavior:
    • In convertToOpenAiMessages in openai-format.ts, non-tool messages for user role are now joined with a newline separator using .join("\n").
  • Misc:
    • Minor formatting change to ensure proper concatenation of text parts in user messages.

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 16, 2025

⚠️ No Changeset found

Latest commit: 98d38c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 16, 2025
@LavaCxx LavaCxx closed this Apr 16, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 16, 2025
@LavaCxx LavaCxx deleted the dev branch April 16, 2025 08:33
}
return { type: "text", text: part.text }
}),
}).join("\n") ?? "",
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential bug: The mapping of non-tool messages returns objects (e.g. { type: 'image_url', image_url: { url: '...' } } or { type: 'text', text: ... }), but the join function expects an array of strings. Joining these objects will result in undesired '[object Object]' strings. Consider transforming each block to an appropriate string format before joining.

Suggested change
}).join("\n") ?? "",
content: nonToolMessages.map((part) => part.type === "image" ? `data:${part.source.media_type};base64,${part.source.data}` : part.text).join("\n") ?? "",

@LavaCxx
Copy link
Author

LavaCxx commented Apr 16, 2025

Sorry, wrong operation

SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant