View source: R/message_retrieval.R
get_metadata | R Documentation |
Retrieves metadata from assistant replies within an LLMMessage
object.
It returns the metadata as a tibble.
get_metadata(.llm, .index = NULL)
last_metadata(.llm)
.llm |
An |
.index |
A positive integer specifying which assistant reply's metadata to extract.
If |
Metadata columns may include:
model
: The model used for generating the reply.
timestamp
: The time when the reply was generated.
prompt_tokens
: The number of tokens in the input prompt.
completion_tokens
: The number of tokens in the assistant's reply.
total_tokens
: The total number of tokens (prompt + completion).
api_specific
: A list column with API-specific metadata.
For convenience, last_metadata()
is provided to retrieve the metadata for the last message.
A tibble containing metadata for the specified assistant reply or all replies.
last_metadata()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.