Skip to content

Fix as_user_turn for Content objects - #597

Merged
hadley merged 7 commits into
tidyverse:mainfrom
thisisnic:as-turn-list
Jul 1, 2025
Merged

hadley merged 7 commits into
tidyverse:mainfrom
thisisnic:as-turn-list

Conversation

@thisisnic

Copy link
Copy Markdown
Collaborator

Fixes #596

Comment thread R/turns.R Outdated
if (length(contents) == 0) {
cli::cli_abort("{.arg {arg}} must contain at least one input.", call = call)
}
if (length(contents) == 1 && S7_inherits(contents, Content)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think you need the length check here? And maybe this could be an early return, like return(Turn("user", list(contents))?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That makes sense; updated now.

@hadley

hadley commented Jun 30, 2025

Copy link
Copy Markdown
Member

Perfect, thanks! Can you please add a bullet to the top of NEWS.md? It should briefly describe the change and end with (@yourname, #issuenumber).

@hadley
hadley merged commit 8d038db into tidyverse:main Jul 1, 2025
@hadley

hadley commented Jul 1, 2025

Copy link
Copy Markdown
Member

Thanks @thisisnic!

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.

Using parallel_chat_structured() with ContentImageRemote objects errors unless objects wrapped in nested list

2 participants