ChatMessageExtensions Class

Definition

Extension methods for ChatMessage.

public ref class ChatMessageExtensions abstract sealed
public static class ChatMessageExtensions
type ChatMessageExtensions = class
Public Module ChatMessageExtensions
Inheritance
ChatMessageExtensions

Methods

RenderText(ChatMessage)

Renders the supplied message to a string. The returned string can used as part of constructing an evaluation prompt to evaluate a conversation that includes the supplied message.

RenderText(IEnumerable<ChatMessage>)

Renders the supplied messages to a string.The returned string can used as part of constructing an evaluation prompt to evaluate a conversation that includes the supplied messages.

TryGetUserRequest(IEnumerable<ChatMessage>, ChatMessage, IReadOnlyList<ChatMessage>)

Decomposes the supplied collection of messages representing an LLM chat conversation into a single ChatMessage representing the last userRequest in this conversation and a collection of remainingMessages representing the rest of the conversation history.

TryGetUserRequest(IEnumerable<ChatMessage>, ChatMessage)

Given a collection of messages representing an LLM chat conversation, returns a single ChatMessage representing the last userRequest in this conversation.

Applies to