Interface PromptMetadata
- All Superinterfaces:
Iterable<PromptMetadata.PromptFilterMetadata>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface PromptMetadata
extends Iterable<PromptMetadata.PromptFilterMetadata>
Abstract Data Type (ADT) modeling metadata gathered by the AI during request
processing.
- Since:
- 0.7.0
- Author:
- John Blum
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Abstract Data Type (ADT) modeling filter metadata for all prompts sent during an AI request. -
Method Summary
Modifier and TypeMethodDescriptionstatic PromptMetadata
empty()
Factory method used to create emptyPromptMetadata
when the information is not supplied by the AI provider.findByPromptIndex
(int promptIndex) Returns anOptional
PromptMetadata.PromptFilterMetadata
at the given index.static PromptMetadata
of
(Iterable<PromptMetadata.PromptFilterMetadata> iterable) Factory method used to create a newPromptMetadata
composed of anIterable
ofPromptMetadata.PromptFilterMetadata
.static <T> PromptMetadata
of
(PromptMetadata.PromptFilterMetadata... array) Factory method used to create a newPromptMetadata
composed of an array ofPromptMetadata.PromptFilterMetadata
.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
empty
Factory method used to create emptyPromptMetadata
when the information is not supplied by the AI provider.- Returns:
- empty
PromptMetadata
.
-
of
Factory method used to create a newPromptMetadata
composed of an array ofPromptMetadata.PromptFilterMetadata
.- Parameters:
array
- array ofPromptMetadata.PromptFilterMetadata
used to compose thePromptMetadata
.- Returns:
- a new
PromptMetadata
composed of an array ofPromptMetadata.PromptFilterMetadata
.
-
of
Factory method used to create a newPromptMetadata
composed of anIterable
ofPromptMetadata.PromptFilterMetadata
.- Parameters:
iterable
-Iterable
ofPromptMetadata.PromptFilterMetadata
used to compose thePromptMetadata
.- Returns:
- a new
PromptMetadata
composed of anIterable
ofPromptMetadata.PromptFilterMetadata
.
-
findByPromptIndex
Returns anOptional
PromptMetadata.PromptFilterMetadata
at the given index.- Parameters:
promptIndex
- index of thePromptMetadata.PromptFilterMetadata
contained in thisPromptMetadata
.- Returns:
Optional
PromptMetadata.PromptFilterMetadata
at the given index.- Throws:
IllegalArgumentException
- if the prompt index is less than 0.
-