using System; using System.Net.Http; using System.Threading; using xAiModels.Models; using xAiModels.Models.Dtos; using System.Threading.Tasks; using Microsoft.Extensions.AI; using Microsoft.AspNetCore.Http; using System.Collections.Generic; namespace xAiApi.Interfaces { /// /// Describe a Base Service Actions of any Ai Based Services ... /// public interface IXAiServiceBase : IDisposable { /// /// Chat Options ... /// ChatOptions Options { get; } /// /// Descriptor of Models which used in Service ... /// XAiModelDescriptor Descriptor { get; } // #region Actions ... /// /// Base Method for Communicate with LLM ... /// /// /// /// Task AskTextAsync( string prompt, CancellationToken cancellationToken = default ); /// /// Base Method for Communicate with LLM ... /// /// /// /// IAsyncEnumerable AskTextAsEnumerable( string prompt, CancellationToken cancellationToken = default ); /// /// Get LLM Client instance for Communicating with LLM ... /// /// IChatClient GetClient(); /// /// Create Custom HttpClient for Communicating with LLM API ... /// /// /// HttpClient GetHttpClient(string url = null); /// /// Prepare a Message History List for LLM Communication based on Prompt ... /// /// /// /// IList GetHistory( string prompt = null, bool forcePrompt = true ); /// /// Prepare a Message History List for LLM Communication based on Prompt ... /// /// /// /// IList GetHistory( ChatMessage message = null, bool forceMessage = true ); #endregion // #region Data Provider Based Actions ... /// /// Load AI Projects ... /// /// /// /// /// Task> LoadProjects( string ownerId, string connectionId = null, CancellationToken cancellationToken = default ); /// /// Ask a Question as Prompt and Retrieve Response ... /// /// /// /// /// /// /// /// /// Task AskAsync( string prompt, string ownerId, Guid projectId, Guid conversationId, string connectionId = null, IFormFileCollection files = null, CancellationToken cancellationToken = default ); /// /// Ask a Question as Prompt and Retrieve Response as Async Enumerable ... /// /// /// /// /// /// /// /// /// IAsyncEnumerable AskAsEnumerable( string prompt, string ownerId, Guid projectId, Guid conversationId, string connectionId = null, IFormFileCollection files = null, CancellationToken cancellationToken = default ); #endregion } }