All Classes and Interfaces
Class
Description
Used in async mode
a conversation message
an implementation of PuppyChatter that uses the google gemini aqa api
must be used with GeminiAqaPromptParameters and requires a fact source
usage:
PuppyChatter chatter
= new GeminiAqaPuppyChatter("{google api key}",
null
);
String sessionId=chatter.createSession();
InlinePassages inlinePassages=new InlinePassages();
inlinePassages.setPassages(List.of(
"只見在影片中網紅酷的夢不解台灣影片在國外為何比較不紅,對此,魏德聖認為影視是最容易打文化認同的,但台灣在經濟起飛的時候選擇了科技,相比之下南韓就選擇娛樂,所以會透過電視、電影的方式來達到韓式文化的行銷,魏德聖也認為對民眾來說電影就是生活跟自己比較有關係,但是台灣選擇了台積電就跟我們比較沒關係「這是我最無力感的地方。」"
must be used with GeminiAqaPromptParameters and requires a fact source
usage:
PuppyChatter chatter
= new GeminiAqaPuppyChatter("{google api key}",
null
);
String sessionId=chatter.createSession();
InlinePassages inlinePassages=new InlinePassages();
inlinePassages.setPassages(List.of(
"只見在影片中網紅酷的夢不解台灣影片在國外為何比較不紅,對此,魏德聖認為影視是最容易打文化認同的,但台灣在經濟起飛的時候選擇了科技,相比之下南韓就選擇娛樂,所以會透過電視、電影的方式來達到韓式文化的行銷,魏德聖也認為對民眾來說電影就是生活跟自己比較有關係,但是台灣選擇了台積電就跟我們比較沒關係「這是我最無力感的地方。」"
a fact source that connects to google drive
to use this class, first, add codenote@api-project-437674419610.iam.gserviceaccount.com
as a viewer to the target google drive folder
and then pass the id of the folder as a parameter to the
constructor
a rag handler that use google drive to extract chunks from the conversation
a special type of inlinepassages that use a google search to obtain passages
a baseQuery can be specified as as the initial query the implementation will
use the last conversation to construct additional query terms
a rag handler that use google search to extract chunks from the conversation
Several functionalities in the gemini package require a PuppyChatter instance,
this class facilitates the initialization of that instance.
OpenAICompatibleInputStreamPuppyChatter<S extends OpenAICompatiblePromptParameters,T extends Response>
an implementation of OpenAICompatiblePromptParameters that uses an
InputStream to process the response
sometimes, it may be necessary to transform the original messages,
to fulfill the requirements, use this class as a bridge between
the original prompts and the effective prompts
the default puppychatter for openai compatible endpoints
the default implementation of rag puppychatter for openai compatible
endpoints
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
Parameters for configuring a prompt
this implementation expect the given url to be a html page
the response of a prompt
verify a reponse, return whether it is good, ask again, or give up
a simple rag handler that just return a predefined list of chunks
a rag handler that use travily to extract chunks from the conversation
the first level is a partial key i.e. a key that may have conflicts
the second level is a map with a real key and content
the cache implementation allows only text contents
whether a response is good, have to try a gain, or give up and failed