A2AAgent.CreateSessionAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| CreateSessionAsync(String) |
Get a new AgentSession instance using an existing context id, to continue that conversation. |
| CreateSessionAsync(String, String) |
Get a new AgentSession instance using an existing context id and task id, to resume that conversation from a specific task. |
CreateSessionAsync(String)
Get a new AgentSession instance using an existing context id, to continue that conversation.
public System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSession> CreateSessionAsync(string contextId);
override this.CreateSessionAsync : string -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSession>
Public Function CreateSessionAsync (contextId As String) As ValueTask(Of AgentSession)
Parameters
- contextId
- String
The context id to continue.
Returns
A value task representing the asynchronous operation. The task result contains a new AgentSession instance.
Applies to
CreateSessionAsync(String, String)
Get a new AgentSession instance using an existing context id and task id, to resume that conversation from a specific task.
public System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSession> CreateSessionAsync(string contextId, string taskId);
override this.CreateSessionAsync : string * string -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSession>
Public Function CreateSessionAsync (contextId As String, taskId As String) As ValueTask(Of AgentSession)
Parameters
- contextId
- String
The context id to continue.
- taskId
- String
The task id to resume from.
Returns
A value task representing the asynchronous operation. The task result contains a new AgentSession instance.