Learn R Programming

tidyllm (version 0.2.0)

get_user_message: Retrieve a User Message by Index

Description

Extracts the content of a user's message from an LLMMessage object at a specific index.

Usage

get_user_message(.llm, .index = NULL)

Value

Returns the content of the user's message at the specified index. If no messages are found, returns NULL.

Arguments

.llm

A LLMMessage object.

.index

A positive integer indicating which user message to retrieve. Defaults to NULL, which retrieves the last message.