19 lines
616 B
C#
19 lines
616 B
C#
using System;
|
|
using xAiModels.Models.Dtos;
|
|
using System.Collections.Generic;
|
|
|
|
namespace xAiApi.Models
|
|
{
|
|
public class XAiDocumentSession
|
|
{
|
|
public Guid Id { get; set; }
|
|
public TimeSpan Ttl { get; set; }
|
|
public string OwnerId { get; set; }
|
|
public DateTime CreatedAtUtc { get; set; }
|
|
public DateTime LastAccessAtUtc { get; set; }
|
|
internal object SyncRoot { get; } = new object();
|
|
public IList<XAiVectorDto> Vectors { get; set; } = new List<XAiVectorDto>();
|
|
public bool IsExpired(DateTime utcNow) { return utcNow - LastAccessAtUtc >= Ttl; }
|
|
}
|
|
}
|