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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAbstract Data Type (ADT) modeling filter metadata for all prompts sent during an AI request. -
Method Summary
Modifier and TypeMethodDescriptionstatic PromptMetadataempty()Factory method used to create emptyPromptMetadatawhen the information is not supplied by the AI provider.findByPromptIndex(int promptIndex) Returns anOptionalPromptMetadata.PromptFilterMetadataat the given index.static PromptMetadataof(Iterable<PromptMetadata.PromptFilterMetadata> iterable) Factory method used to create a newPromptMetadatacomposed of anIterableofPromptMetadata.PromptFilterMetadata.static PromptMetadataof(PromptMetadata.PromptFilterMetadata... array) Factory method used to create a newPromptMetadatacomposed of an array ofPromptMetadata.PromptFilterMetadata.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
empty
Factory method used to create emptyPromptMetadatawhen the information is not supplied by the AI provider.- Returns:
- empty
PromptMetadata.
-
of
Factory method used to create a newPromptMetadatacomposed of an array ofPromptMetadata.PromptFilterMetadata.- Parameters:
array- array ofPromptMetadata.PromptFilterMetadataused to compose thePromptMetadata.- Returns:
- a new
PromptMetadatacomposed of an array ofPromptMetadata.PromptFilterMetadata.
-
of
Factory method used to create a newPromptMetadatacomposed of anIterableofPromptMetadata.PromptFilterMetadata.- Parameters:
iterable-IterableofPromptMetadata.PromptFilterMetadataused to compose thePromptMetadata.- Returns:
- a new
PromptMetadatacomposed of anIterableofPromptMetadata.PromptFilterMetadata.
-
findByPromptIndex
Returns anOptionalPromptMetadata.PromptFilterMetadataat the given index.- Parameters:
promptIndex- index of thePromptMetadata.PromptFilterMetadatacontained in thisPromptMetadata.- Returns:
OptionalPromptMetadata.PromptFilterMetadataat the given index.- Throws:
IllegalArgumentException- if the prompt index is less than 0.
-