Using SmartSession
Overview
How to Use
using static Wisej.AI.SmartSession;
var session = new SmartSession(new OpenAIEndpoint{ ApiKey = "..." });
// Add a message to the history
session.Messages.Add(new Message {
Role = MessageRole.User,
Text = "Fact: My name is Billy."
});
Console.WriteLine((await session.AskAsync("What is my name?")).Text);
// Output
/*
Your name is Billy.
*/Imports Wisej.AI.SmartSession
Dim session As New SmartSession(New OpenAIEndpoint With {.ApiKey = "..."})
' Add a message to the history
session.Messages.Add(New Message With {
.Role = MessageRole.User,
.Text = "Fact: My name is Billy."
})
Console.WriteLine((Await session.AskAsync("What is my name?")).Text)
' Output
'
' Your name is Billy.
'Memory Trimming
Examples
Last updated
