Skip to content

Conversation Service

Overview

The ConversationService manages chat conversations between users and the AI system. It handles the storage, retrieval, and processing of conversation histories in Azure Blob Storage.

Key Methods

initializeNewConversation

async initializeNewConversation(
  conversationUUID: string,
  userID: string
): Promise<void>

Initializes a new conversation: - Creates a new conversation with empty chat history - Sets up initial metadata with user ID and timestamp - Stores the conversation data in Azure Blob Storage

getConversationHistoryAndStatus

async getConversationHistoryAndStatus(conversationUUID: string): Promise<{
  chatHistory: any[];
  metadata: any;
}>

Retrieves conversation history and metadata: - Fetches conversation data from Azure Blob Storage - Returns chat history and metadata - Handles errors gracefully

updateConversationHistory

async updateConversationHistory(
  conversationUUID: string,
  message: any
): Promise<void>

Updates conversation history with a new message: - Retrieves existing conversation data - Adds the new message to chat history - Stores the updated data back to Azure Blob Storage

updateConversationMetadata

async updateConversationMetadata(
  conversationUUID: string,
  updates: any
): Promise<void>

Updates conversation metadata: - Retrieves existing conversation data - Updates the metadata with provided values - Stores the updated data back to Azure Blob Storage

Dependencies

  • BlobService: For storing and retrieving conversation data in Azure Blob Storage