For the complete documentation index, see llms.txt. This page is also available as Markdown.

CallChatGPT

Task for calling ChatGPT API.

Task version: 1.1.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Model : String

Chat GPT model to use.

Find a list of available models from https://platform.openai.com/docs/models.

Default: gpt-3.5-turbo Example: gpt-3.5-turbo

🗝ApiKey : String

Chat GPT API key.

Default: - Example: 1234567qwerty

Messages : InputMessage[]

Array of messages to send to Chat GPT.

Default: - Example: [ { "Content": "How are you?", "Role": "User" }, { "Content": "I'm fine, thanks. How about you?", "Role": "System" }, { "Content": "I'm fine too.", "Role": "User" } ]

Task Result

Name
Description

ChatCompletion : ChatCompletion

Contains the input repeated the specified number of times. Example: { Id: "chatcmpl-123", Created: 1677652288, Model: "gpt-3.5-turbo-0613", SystemFingerprint: "fp_44709d6fcb", Choices: [ { Index: 0, Message: { Role: "assistant", Content: "\n\nHello there, how may I assist you today?" }, FinishReason: "stop" } ], Usage: { PromptTokens: 9, CompletionTokens: 12, TotalTokens: 21 } }

Success : Boolean

Indicates whether the operation was successful. Example: true

Error : String

Error message, if the operation was not successful. Otherwise null. Example: OpenAI API call failed with status code 500 and content ...

Task Changelog

Changelog for Task Frends.OpenAI.CallChatGPT.

[1.1.0] - 2025-02-17

Changed

  • Update packages:

  • RestSharp 110.2.0 -> 112.1.0

  • SonarAnalyzer.CSharp 9.8.0.76515 -> 10.7.0.110445

  • System.ComponentModel.Annotations 4.7.0 -> 5.0.0

[1.0.1] - 2024-01-05

Changed

  • Moved some input parameters to options

  • Moved API key from options to input

[1.0.0] - 2023-12-28

Changed

  • Initial implementation

Last updated

Was this helpful?