Так как же это сделать на C#?
Я написал код на основе документации openai на Python.
Код: Выделить всё
from openai import OpenAI
client = OpenAI()
batch_input_file = client.files.create(
file=open("batchinput.jsonl", "rb"),
purpose="batch"
) batch_input_file_id = batch_input_file.id
client.batches.create(
input_file_id=batch_input_file_id,
endpoint="/v1/chat/completions",
completion_window="24h",
metadata={
"description": "nightly eval job"
}
) from openai import OpenAI
client = OpenAI()
client.batches.retrieve("batch_abc123") from openai import OpenAI
client = OpenAI()
file_response = client.files.content("file-xyz123")
print(file_response.text)
Подробнее здесь: https://stackoverflow.com/questions/790 ... in-c-sharp
Мобильная версия