All Bundles

Chat

Gemini chat session

Derived from: Content

Operations

Code example:

session := Chat->New("models/gemini-pro", EndPoint->GetApiKey());

content := session->SendPart(TextPart->New("What is the tallest mountain in the California?"), "user");
content->GetFirstPart()->ToString()->PrintLine();

content := session->SendPart(TextPart->New("How tall is it?"), "user");
content->GetFirstPart()->ToString()->PrintLine();

content := session->SendPart(TextPart->New("Why is it so tall?"), "user");
content->GetFirstPart()->ToString()->PrintLine();

content := session->SendPart(TextPart->New("Where is it located?"), "user");
content->GetFirstPart()->ToString()->PrintLine();
"======"->PrintLine();

session->ToString()->PrintLine();

GetAllParts

Get all chat parts

method : public : GetAllParts() ~ Vector<Content>
Return
TypeDescription
Vector<Content>list of all chat parts

SendPart

Send chart part

method : public : SendPart(part:Part, role:String) ~ Candidate
Parameters
NameTypeDescription
partPartprompt chat part
roleStringprompt role

Return
TypeDescription
Candidateprompt response

ToString

String representation of the object

method : public : ToString() ~ String
Return
TypeDescription
Stringstring representation