Class OpenrouterPuppyChatterOld
java.lang.Object
rocks.imsofa.ai.puppychatter.AbstractPuppyChatter<OpenAICompatiblePromptParameters,Response>
rocks.imsofa.ai.puppychatter.openai.OpenAICompatiblePuppyChatter<OpenAICompatiblePromptParameters,Response>
rocks.imsofa.ai.puppychatter.openrouter.OpenrouterPuppyChatterOld
- All Implemented Interfaces:
PuppyChatter<OpenAICompatiblePromptParameters,Response>
public class OpenrouterPuppyChatterOld
extends OpenAICompatiblePuppyChatter<OpenAICompatiblePromptParameters,Response>
an implementation of PuppyChatter based on Open Router
usage:
PuppyChatter<PromptParameters, Response> chatter=new OpenrouterPuppyChatter("open router key");
String session=chatter.createSession();
Response response=chatter.bark(session, "你好", new PromptParameters("user"));
System.out.println(response.getMessage());
chatter.closeSession(session);
when issuing prompt, a leading model:xxx can be used to specify the model to use
PuppyChatter<PromptParameters, Response> chatter=new OpenrouterPuppyChatter("open router key");
String session=chatter.createSession();
Response response=chatter.bark(session, "你好", new PromptParameters("user"));
System.out.println(response.getMessage());
chatter.closeSession(session);
when issuing prompt, a leading model:xxx can be used to specify the model to use
- Author:
- lendle
-
Field Summary
Fields inherited from class rocks.imsofa.ai.puppychatter.openai.OpenAICompatiblePuppyChatter
toolCallProcessor, toolCallRequestsFields inherited from class rocks.imsofa.ai.puppychatter.AbstractPuppyChatter
cacheService, replyRole, sessionHistory -
Constructor Summary
ConstructorsConstructorDescriptionOpenrouterPuppyChatterOld(String apiKey) OpenrouterPuppyChatterOld(String apiKey, String defaultModel, CacheService cacheService) OpenrouterPuppyChatterOld(String apiKey, CacheService cacheService) -
Method Summary
Modifier and TypeMethodDescriptionprotected Response_bark(String sessionId, List<Conversation> messages, OpenAICompatiblePromptParameters parameters) protected void_bark(String sessionId, List<Conversation> messages, OpenAICompatiblePromptParameters parameters, BarkCallback<Response> callback) static voidMethods inherited from class rocks.imsofa.ai.puppychatter.openai.OpenAICompatiblePuppyChatter
createDefaultPromptParameter, createResponseFromConversation, getToolCallProcessor, isCacheable, setToolCallProcessorMethods inherited from class rocks.imsofa.ai.puppychatter.AbstractPuppyChatter
bark, bark, bark, bark, closeSession, createConversationFromPrompt, createSession
-
Constructor Details
-
OpenrouterPuppyChatterOld
-
OpenrouterPuppyChatterOld
-
OpenrouterPuppyChatterOld
-
-
Method Details
-
_bark
protected void _bark(String sessionId, List<Conversation> messages, OpenAICompatiblePromptParameters parameters, BarkCallback<Response> callback) throws Exception - Specified by:
_barkin classAbstractPuppyChatter<OpenAICompatiblePromptParameters,Response> - Throws:
Exception
-
_bark
protected Response _bark(String sessionId, List<Conversation> messages, OpenAICompatiblePromptParameters parameters) throws Exception - Specified by:
_barkin classAbstractPuppyChatter<OpenAICompatiblePromptParameters,Response> - Throws:
Exception
-
main
- Throws:
Exception
-