Module rust_gpt::chat

source ·
Expand description

Chat API

The chat API is used to have a conversation with the GPT-3.5 model which runs ChatGPT.

The main structs used in here are ChatResponse and ChatMessage.

Chat

This is a new experimental struct that allows you to have a conversation with the GPT-3.5 model. It will automatically remember the messages you send and the messages the model sends so the model can remember the conversation.

See the ChatBuilder and Chat structs for more information.

Structs

  • A struct that represents a chat session This struct makes it easy to interact with the chat api, as well as remembering messages. This struct guarantees that messages are sent and stored in the order that ask is called.
  • Builds a Chat struct for initiating a chat session.
  • Represents the choice object returned by the chat API.
  • Represents one of the messages sent to or received from the chat API.
  • Represents a response from the chat API.
  • Represents the usage information returned by the chat API.

Enums

  • Represents one of the roles that can be used in the chat API.