betalgo / openai

OpenAI .NET sdk - Azure OpenAI, ChatGPT, Whisper, and DALL-E
https://betalgo.github.io/openai/
MIT License
2.88k stars 520 forks source link

Unable to insert a prompt? #273

Closed fmunim closed 1 year ago

fmunim commented 1 year ago

Describe the bug I am getting this error while trying to build it

error CS0117: 'ChatCompletionCreateRequest' does not contain a definition for 'Prompt'
var completionResult = await openAiService.ChatCompletion.CreateCompletion(
            new ChatCompletionCreateRequest
            {
                Prompt = "Something here",
                Messages = messages,
                Model = Models.ChatGpt3_5Turbo,
                MaxTokens = 66,
                User = userId
            },
            cancellationToken: cancellationToken
        );

Expected behavior Use the prompt

Desktop (please complete the following information):

Additional context How would I pass in the prompt using that function?

kayhantolga commented 1 year ago

Please check the wiki page https://github.com/betalgo/openai/wiki/Chat-GPT.

The error message is accurate. You need to use "message" instead of "prompt". If this is a sample that I shared before in the repository, please let me know so I can update it.