You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an idea to store existing conversation id to use next call. Hovewer, I did not get conversation id from this object.
Is there any method or strategy to get conversation id? StageBag is empty which has zero count.
AgentSession session = await agent.CreateSessionAsync();
// First turn
Console.WriteLine(await agent.RunAsync("My name is Alice and I love hiking.", session));
var conversationHistory = session.ConversationId;
// Second turn — the agent remembers the user's name and hobby
Console.WriteLine(await agent.RunAsync("What do you remember about me?", session));
EDIT: Serialized session could be stored in db. If needed, get json string and deserialize it to continue to session. But I am not sure that is suitable solution.
JsonElement serialized = agent.SerializeSession(session);
// Store serialized payload in durable storage.
AgentSession resumed = await agent.DeserializeSessionAsync(serialized);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Folks,
I have an idea to store existing conversation id to use next call. Hovewer, I did not get conversation id from this object.
Is there any method or strategy to get conversation id? StageBag is empty which has zero count.
Framework: .NET 10
Package: Microsoft.Agent.AI 1.0.0-rc2
EDIT: Serialized session could be stored in db. If needed, get json string and deserialize it to continue to session. But I am not sure that is suitable solution.
Beta Was this translation helpful? Give feedback.
All reactions