minimaxir / simpleaichat

Python package for easily interfacing with chat apps, with robust features and minimal code complexity.
MIT License
3.43k stars 224 forks source link

System messages #58

Open emil2099 opened 11 months ago

emil2099 commented 11 months ago

Hi - great job building this.

I notice that messages doesn't include system message. Would it be better to include system prompt in the messages to mirror Open AI's approach with messages?

message1 = ChatMessage(role="system", content="You are a helpful assistant.")

This may be handy in a couple of use cases:

  1. When we modify message history and system prompt we get consistent API for both
  2. When system prompt is injected mid-conversation (not documented by Open AI and not currently possible in this library?)