diff options
Diffstat (limited to 'vespajlib/src/main/java/ai/vespa/llm/completion/Prompt.java')
-rw-r--r-- | vespajlib/src/main/java/ai/vespa/llm/completion/Prompt.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/ai/vespa/llm/completion/Prompt.java b/vespajlib/src/main/java/ai/vespa/llm/completion/Prompt.java new file mode 100644 index 00000000000..d5d0247d6b0 --- /dev/null +++ b/vespajlib/src/main/java/ai/vespa/llm/completion/Prompt.java @@ -0,0 +1,23 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package ai.vespa.llm.completion; + +import com.yahoo.api.annotations.Beta; + +/** + * A prompt that can be given to a large language model to generate a completion. + * + * @author bratseth + */ +@Beta +public abstract class Prompt { + + public abstract String asString(); + + /** Returns a new prompt with the text of the given completion appended. */ + public Prompt append(Completion completion) { + return append(completion.text()); + } + + public abstract Prompt append(String text); + +} |