Table of Contents

Interface ISessionRESTClient

Namespace
FoundationaLLM.Client.Core.Interfaces
Assembly
FoundationaLLM.Client.Core.dll

Provides methods to manage calls to the Core API's session endpoints.

public interface ISessionRESTClient
Extension Methods

Methods

CreateSessionAsync(ChatSessionProperties)

Creates a new session with the specified name.

Task<string> CreateSessionAsync(ChatSessionProperties chatSessionProperties)

Parameters

chatSessionProperties ChatSessionProperties

The session properties.

Returns

Task<string>

Returns the new Session ID.

DeleteSessionAsync(string)

Deletes a chat session.

Task DeleteSessionAsync(string sessionId)

Parameters

sessionId string

Returns

Task

GetAllChatSessionsAsync()

Retrieves all chat sessions.

Task<IEnumerable<Conversation>> GetAllChatSessionsAsync()

Returns

Task<IEnumerable<Conversation>>

GetChatSessionMessagesAsync(string)

Returns the chat messages related to an existing session.

Task<IEnumerable<Message>> GetChatSessionMessagesAsync(string sessionId)

Parameters

sessionId string

Returns

Task<IEnumerable<Message>>

GetCompletionPromptAsync(string, string)

Gets a completion prompt by session ID and completion prompt ID.

Task<CompletionPrompt> GetCompletionPromptAsync(string sessionId, string completionPromptId)

Parameters

sessionId string
completionPromptId string

Returns

Task<CompletionPrompt>

RateMessageAsync(string, string, MessageRatingRequest)

Sets the rating for a message.

Task RateMessageAsync(string sessionId, string messageId, MessageRatingRequest rating)

Parameters

sessionId string

The chat session ID that contains the message to rate.

messageId string

The ID of the message to rate.

rating MessageRatingRequest

The rating and optional comments to assign to the message.

Returns

Task

RenameChatSession(string, ChatSessionProperties)

Renames a chat session.

Task<string> RenameChatSession(string sessionId, ChatSessionProperties chatSessionProperties)

Parameters

sessionId string

The chat session ID.

chatSessionProperties ChatSessionProperties

The session properties.

Returns

Task<string>