Package com.embabel.agent.api.common
Class PromptRunnerKt
-
- All Implemented Interfaces:
public final class PromptRunnerKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> TcreateObject(PromptRunner $self, String prompt)Create an object of the given type final static <T extends Any> TcreateObject(PromptRunner.Rendering $self, Map<String, Object> model)final static <T extends Any> Tcreate(PromptRunner $self, String prompt)Create an object of the given type. final static <T extends Any> TcreateObjectIfPossible(PromptRunner $self, String prompt)final static <T extends Any, Any extends Any> PromptRunner.Creating<T>withProperties(PromptRunner.Creating<T> $self, KProperty1<T, Any> properties)Includes the given properties when creating an object. final static <T extends Any, Any extends Any> PromptRunner.Creating<T>withoutProperties(PromptRunner.Creating<T> $self, KProperty1<T, Any> properties)Excludes the given properties when creating an object. -
-
Method Detail
-
createObject
final static <T extends Any> T createObject(PromptRunner $self, String prompt)
Create an object of the given type
-
createObject
final static <T extends Any> T createObject(PromptRunner.Rendering $self, Map<String, Object> model)
-
create
final static <T extends Any> T create(PromptRunner $self, String prompt)
Create an object of the given type. Method overloading is evil
-
createObjectIfPossible
final static <T extends Any> T createObjectIfPossible(PromptRunner $self, String prompt)
-
withProperties
final static <T extends Any, Any extends Any> PromptRunner.Creating<T> withProperties(PromptRunner.Creating<T> $self, KProperty1<T, Any> properties)
Includes the given properties when creating an object.
Note that each predicate is applied in addition to previously registered predicates, including ObjectCreator::withPropertyFilter, ObjectCreator::withProperties, ObjectCreator::withoutProperties, and withoutProperties.
- Parameters:
properties- the properties that are to be included
-
withoutProperties
final static <T extends Any, Any extends Any> PromptRunner.Creating<T> withoutProperties(PromptRunner.Creating<T> $self, KProperty1<T, Any> properties)
Excludes the given properties when creating an object.
Note that each predicate is applied in addition to previously registered predicates, including ObjectCreator::withPropertyFilter, ObjectCreator::withProperties, ObjectCreator::withoutProperties, and withProperties.
- Parameters:
properties- the properties that are to be included
-
-
-
-