Package ai.dat.core.agent
Class AbstractHitlAskdataAgent
java.lang.Object
ai.dat.core.agent.AbstractAskdataAgent
ai.dat.core.agent.AbstractHitlAskdataAgent
- All Implemented Interfaces:
AskdataAgent
Human-in-the-loop Askdata Agent
-
Field Summary
Fields inherited from class ai.dat.core.agent.AbstractAskdataAgent
action, contentStore, databaseAdapter, variables -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHitlAskdataAgent(@NonNull ContentStore contentStore, @NonNull DatabaseAdapter databaseAdapter) Deprecated.AbstractHitlAskdataAgent(@NonNull ContentStore contentStore, @NonNull DatabaseAdapter databaseAdapter, Map<String, Object> variables) -
Method Summary
Modifier and TypeMethodDescriptionvoiduserApproval(Boolean approval) user approvalvoiduserResponse(String response) user responsewait user approvalwaitForUserApproval(long timeout, TimeUnit unit) wait user approval, supports timeoutwait user responsewaitForUserResponse(long timeout, TimeUnit unit) wait user response, supports timeoutMethods inherited from class ai.dat.core.agent.AbstractAskdataAgent
ask, ask, contentStore, executeQuery, runMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.dat.core.agent.AskdataAgent
eventOptions
-
Constructor Details
-
AbstractHitlAskdataAgent
public AbstractHitlAskdataAgent(@NonNull @NonNull ContentStore contentStore, @NonNull @NonNull DatabaseAdapter databaseAdapter, Map<String, Object> variables) -
AbstractHitlAskdataAgent
@Deprecated public AbstractHitlAskdataAgent(@NonNull @NonNull ContentStore contentStore, @NonNull @NonNull DatabaseAdapter databaseAdapter) Deprecated.
-
-
Method Details
-
userResponse
user response- Parameters:
response-
-
userApproval
user approval- Parameters:
approval-
-
waitForUserResponse
wait user response- Returns:
- Throws:
InterruptedExceptionExecutionException
-
waitForUserApproval
wait user approval- Returns:
- Throws:
InterruptedExceptionExecutionException
-
waitForUserResponse
public String waitForUserResponse(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException wait user response, supports timeout- Parameters:
timeout- Timeoutunit- Time Unit- Returns:
- response. If it times out, thrown TimeoutException
- Throws:
InterruptedExceptionTimeoutExceptionExecutionException
-
waitForUserApproval
public Boolean waitForUserApproval(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException wait user approval, supports timeout- Parameters:
timeout- Timeoutunit- Time Unit- Returns:
- is approval? If it times out, thrown TimeoutException
- Throws:
InterruptedExceptionTimeoutExceptionExecutionException
-