last ...
This commit is contained in:
@@ -0,0 +1,73 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.Extensions.AI;
|
||||||
|
|
||||||
|
namespace xAiApi.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describe a Base Service Actions of any Ai Based Services ...
|
||||||
|
/// </summary>
|
||||||
|
public interface IAIServiceBase : IDisposable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Base Method for Communicate with LLM ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> AskAsync(
|
||||||
|
string prompt,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Base Method for Communicate with LLM ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IAsyncEnumerable<string> AskAsEnumerable(
|
||||||
|
string prompt,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get LLM Client instance for Communicating with LLM ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="llm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IChatClient GetClient(string llm = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create Custom HttpClient for Communicating with LLM API ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
HttpClient GetHttpClient(string url = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Prepare a Message History List for LLM Communication based on Prompt ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="forcePrompt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IList<ChatMessage> GetHistory(
|
||||||
|
string prompt = null,
|
||||||
|
bool forcePrompt = true
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Prepare a Message History List for LLM Communication based on Prompt ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="forceMessage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IList<ChatMessage> GetHistory(
|
||||||
|
ChatMessage message = null,
|
||||||
|
bool forceMessage = true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user