llm_chain

Module prompt

Source
Expand description

Module implementing prompts and prompt templates. Contains the prompt! macro, Prompts and PromptTemplates.

Structs§

ChatMessage
The ChatMessage struct represents a chat message. It has two fields:
ChatMessageCollection
A collection of chat messages with various roles (e.g., user, assistant, system).
StringTemplate
A template for a prompt. This is a string that can be formatted with a set of parameters.
StringTemplateError
An error that can occur when formatting a prompt template. This is a wrapper around the underlying error type, as the underlying error type doesn’t have a stable API.

Enums§

ChatRole
The ChatRole enum represents the role of a chat message sender in a conversation.
Data
An enum representing either a collection of chat messages or a single text.

Type Aliases§

Conversation
A chat conversation.
ConversationTemplate
A chat conversation of string templates.
Prompt
A prompt.
PromptTemplate
A prompt template.