Package rocks.imsofa.ai.puppychatter
Class AbstractPuppyChatter<T extends PromptParameters,S extends Response>
java.lang.Object
rocks.imsofa.ai.puppychatter.AbstractPuppyChatter<T,S>
- All Implemented Interfaces:
PuppyChatter<T,S>
- Direct Known Subclasses:
GeminiAqaPuppyChatter,OpenrouterPuppyChatter
public abstract class AbstractPuppyChatter<T extends PromptParameters,S extends Response>
extends Object
implements PuppyChatter<T,S>
- Author:
- USER
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CacheServiceprotected Stringprotected Map<String,List<Conversation>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract S_bark(String sessionId, List<Conversation> messages, T parameters) protected abstract void_bark(String sessionId, List<Conversation> messages, T parameters, BarkCallback callback) bark with default PromptParameters, implementation should automatically providevoidbark(String sessionId, String prompt, BarkCallback barkCallback) async bark with default PromptParameters, implementation should automatically providebark(String sessionId, String prompt, ResponseVerifier verifier) bark with default PromptParameters, implementation should automatically providevoidbark(String sessionId, String prompt, T parameters, BarkCallback barkCallback) a asynchronous version of barkbark(String sessionId, String prompt, T parameters, ResponseVerifier verifier) voidcloseSession(String sessionId) protected abstract Tprotected abstract ScreateResponseFromConversation(Conversation conversation) initialize a chat session with a default model and return a session id to be used in further chats
-
Field Details
-
sessionHistory
-
cacheService
-
replyRole
-
-
Constructor Details
-
AbstractPuppyChatter
-
AbstractPuppyChatter
public AbstractPuppyChatter()
-
-
Method Details
-
createSession
Description copied from interface:PuppyChatterinitialize a chat session with a default model and return a session id to be used in further chats- Specified by:
createSessionin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Returns:
-
bark
- Specified by:
barkin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Throws:
BarkException
-
bark
public void bark(String sessionId, String prompt, T parameters, BarkCallback barkCallback) throws BarkException Description copied from interface:PuppyChattera asynchronous version of bark- Specified by:
barkin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Throws:
BarkException
-
bark
public S bark(String sessionId, String prompt, T parameters, ResponseVerifier verifier) throws BarkException - Specified by:
barkin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Throws:
BarkException
-
closeSession
- Specified by:
closeSessionin interfacePuppyChatter<T extends PromptParameters,S extends Response>
-
_bark
protected abstract S _bark(String sessionId, List<Conversation> messages, T parameters) throws Exception - Throws:
Exception
-
_bark
protected abstract void _bark(String sessionId, List<Conversation> messages, T parameters, BarkCallback callback) throws Exception - Throws:
Exception
-
createDefaultPromptParameter
-
bark
Description copied from interface:PuppyChatterasync bark with default PromptParameters, implementation should automatically provide- Specified by:
barkin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Throws:
BarkException
-
bark
Description copied from interface:PuppyChatterbark with default PromptParameters, implementation should automatically provide- Specified by:
barkin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Returns:
- Throws:
BarkException
-
bark
Description copied from interface:PuppyChatterbark with default PromptParameters, implementation should automatically provide- Specified by:
barkin interfacePuppyChatter<T extends PromptParameters,S extends Response> - Returns:
- Throws:
BarkException
-
createResponseFromConversation
-