get_logprobs {tidyllm}R Documentation

Retrieve Log Probabilities from Assistant Replies

Description

Extracts token log probabilities from assistant replies within an LLMMessage object. Each row represents a token with its log probability and top alternative tokens.

Usage

get_logprobs(.llm, .index = NULL)

Arguments

.llm

An LLMMessage object containing the message history.

.index

A positive integer specifying which assistant reply's log probabilities to extract. If NULL (default), log probabilities for all replies are returned.

Details

An empty tibble is output if no logprobs were requested. Currently only works with openai_chat()

Columns include:

Value

A tibble containing log probabilities for the specified assistant reply or all replies.

See Also

get_metadata()


[Package tidyllm version 0.3.4 Index]