using System.Text.Json;
using AIStudio.Provider;
using AIStudio.Provider.Anthropic;
using AIStudio.Provider.Google;
using AIStudio.Provider.Groq;
using AIStudio.Provider.HuggingFace;
using AIStudio.Provider.OpenAI;
using AIStudio.Provider.OpenRouter;
using AIStudio.Provider.Requesty;
using AnthropicResponseStreamLine = AIStudio.Provider.Anthropic.ResponseStreamLine;
using FireworksResponseStreamLine = AIStudio.Provider.Fireworks.ResponseStreamLine;
using PerplexityResponseStreamLine = AIStudio.Provider.Perplexity.ResponseStreamLine;
namespace AIStudio.Tests.Serialization;
public static partial class JsonTestRoots
{
///
/// What AI Studio sends to LLM providers.
///
public static IEnumerable ProviderRequests()
{
TestHost.PrepareStaticState();
var options = ProviderJsonOptions.OPTIONS;
yield return CaseWithNamespace(typeof(ChatCompletionAPIRequest), options);
yield return CaseWithNamespace(typeof(ResponsesAPIRequest), options);
yield return CaseWithNamespace(typeof(ChatRequest), options);
yield return CaseWithNamespace(typeof(EmbeddingRequest), options);
yield return CaseWithNamespace(typeof(GoogleEmbeddingRequest), options);
//
// The messages and their parts, which converters write as the type they are of:
//
foreach (var type in new[] { typeof(IMessageBase), typeof(ISubContent), typeof(ISubContentImageUrl), typeof(ISubContentImageSource) }.SelectMany(ImplementationsOf))
yield return CaseWithNamespace(type, options);
//
// What a request holds as an object, which gets written as the type it is of, too. The additional API
// parameters hold the values the parser of the provider settings reads, and the input of the Responses API
// holds the items of an earlier answer as they came in:
//
foreach (var type in new[] { typeof(string), typeof(int), typeof(long), typeof(double), typeof(decimal), typeof(bool), typeof(Dictionary), typeof(List