Chat
Gemini chat session
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();Operations
GetAllParts
Get all chat parts
method : public : GetAllParts() ~ Vector<Content>Return
| Type | Description |
|---|---|
| Vector<Content> | list of all chat parts |
SendPart
Send chart part
method : public : SendPart(part:Part, role:String) ~ CandidateParameters
| Name | Type | Description |
|---|---|---|
| part | Part | prompt chat part |
| role | String | prompt role |
Return
| Type | Description |
|---|---|
| Candidate | prompt response |
ToString
String representation of the object
method : public : ToString() ~ StringReturn
| Type | Description |
|---|---|
| String | string representation |