类 Prompt
java.lang.Object
dev.langchain4j.model.input.Prompt
Represents a prompt (an input text sent to the LLM).
A prompt usually contains instructions, contextual information, end-user input, etc.
A Prompt is typically created by applying one or multiple values to a PromptTemplate.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanstatic PromptCreate a new Prompt.inthashCode()text()The text of the prompt.Convert this prompt to an AiMessage.toString()Convert this prompt to a SystemMessage.Convert this prompt to a UserMessage.toUserMessage(String userName) Convert this prompt to a UserMessage with specified userName.
-
构造器详细资料
-
Prompt
Create a new Prompt.- 参数:
text- the text of the prompt.
-
-
方法详细资料
-
text
The text of the prompt.- 返回:
- the text of the prompt.
-
toSystemMessage
Convert this prompt to a SystemMessage.- 返回:
- the SystemMessage.
-
toUserMessage
Convert this prompt to a UserMessage with specified userName.- 返回:
- the UserMessage.
-
toUserMessage
Convert this prompt to a UserMessage.- 返回:
- the UserMessage.
-
toAiMessage
Convert this prompt to an AiMessage.- 返回:
- the AiMessage.
-
equals
-
hashCode
public int hashCode() -
toString
-
from
Create a new Prompt.- 参数:
text- the text of the prompt.- 返回:
- the new Prompt.
-