Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In what way is this a “list of dicts”? It’s an implicitly structured list of dict, str pairs. And it is WEIRD.


yeah it doesn't match the API format anyway, which is a list of dicts.


I agree it seems weird on first contact.

To me it makes a bit of sense because I had built a GPT3-based chat two weeks ago, based on their completion documentation^1

The "format" for this prompt already has everything needed: System prompt and history of messages.

```

The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

Human: Hello, who are you?

AI: I am an AI created by OpenAI. How can I help you today?

Human: Please translate "Hello" to German

AI:

```

To retain context, I kept the system prompt on top and added the prior prompt/completions to the history stack in-between.

End-user-experience-wise, this worked really, really well. Practically as good as the ChatGPT UI.

As a developer though, it was a lot of fiddling, splicing, and dicing of strings. But again, this worked well and I would have kept it as-is for as long as possible.

When I saw the ChatML format, it wasn't a giant leap.

```

<|im_start|>system

You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. Knowledge cutoff: 2021-09-01 Current date: 2023-03-01<|im_end|>

<|im_start|>user

Hello, who are you?<|im_end|>

<|im_start|>assistant

I am an AI created by OpenAI. How can I help you today? <|im_end|>

<|im_start|>user

Please translate "Hello" to German<|im_end|>

```

I've used that, too. Handling of prior conversations became a bit more manageable. But to honest, there's a lot of markup to keep track of.

To me, the less-discussed JSON format^2 works best. (I'm building a macOS app in Swift)

```

{

  "model": "gpt-3.5-turbo",
  "messages": [

 {
  "role": "system", 
  "content": "You are a helpful and succinct assistant AI created by OpenAI."
 },

 {
  "role": "user", 
  "content": "Hello, who are you?"
 },

 {
  "role": "assistant", 
  "content": "I am an AI created by OpenAI. How can I help you today?"
 },

 {
  "role": "user", 
  "content": "Please translate "Hello" to German"
 }
}

```

What do you think?

^1: https://platform.openai.com/docs/guides/completion/conversat...

^2: https://platform.openai.com/docs/api-reference/chat/create




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: