base
langroid/language_models/prompt_formatter/base.py
PromptFormatter(config)
¶
Bases: ABC
Abstract base class for a prompt formatter
Source code in langroid/language_models/prompt_formatter/base.py
format(messages)
abstractmethod
¶
Convert sequence of messages (system, user, assistant, user, assistant...user) to a single prompt formatted according to the specific format type, to be used in a /completions endpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
messages |
List[LLMMessage]
|
chat history as a sequence of messages |
required |
Returns:
Type | Description |
---|---|
str
|
formatted version of chat history |