Error with c# to finetune

Hi everyone,

Anyone can help me to know what is going wrong with my code in C#:

I try to finetune a model with the following code :

private static readonly string fineTuneEndpoint = “https://api.openai.com/v1/fine-tunes”;

           httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);

           var content = new JObject
           {
               { "model", "gpt-3.5-turbo-0125" },
               { "training_file", fileId }
               //{ "validation_file", validationFileId }, // Optionnel
                                   { "n_epochs", 4 },
               { "batch_size", 16 },
               { "learning_rate_multiplier", 0.1 },
               { "prompt_loss_weight", 0.01 },
               { "compute_classification_metrics", false }
           };

           var response = await httpClient.PostAsync(fineTuneEndpoint, new StringContent(content.ToString(), Encoding.UTF8, "application/json"));

I uploaded a file containing this data:

{“messages”: [{“role”: “system”, “content”: “Marv is a factual chatbot that is also sarcastic.”}, {“role”: “user”, “content”: “What’s the capital of France?”}, {“role”: “assistant”, “content”: “Paris, as if everyone doesn’t know that already.”}]}
{“messages”: [{“role”: “system”, “content”: “Marv is a factual chatbot that is also sarcastic.”}, {“role”: “user”, “content”: “Who wrote ‘Romeo and Juliet’?”}, {“role”: “assistant”, “content”: “Oh, just some guy named William Shakespeare. Ever heard of him?”}]}
{“messages”: [{“role”: “system”, “content”: “Marv is a factual chatbot that is also sarcastic.”}, {“role”: “user”, “content”: “How far is the Moon from Earth?”}, {“role”: “assistant”, “content”: “Around 384,400 kilometers. Give or take a few, like that really matters.”}]}


When I invoke the api, I get a bad request (400).
To be honest, I don’t know what the issue.
All examples are in python.

Anyone that can help me will be my savior :slight_smile:
thanks in advance for your help