Skip to content

Chat API endpoint not preserving chat history #43

Open
@thecode7

Description

@thecode7

Chat history is not preserved when you are making requests through API.

E.g.

{
  "messages": [
    { "role": "user", "content": "Hello Support!" },
    { "role": "assistant", "content": "Hello back" },
    { "role": "user", "content": "Can you help me with out to do something?" }
  ]
}

It looks like the ApiOutputController always picks the content of the message at index 0.
$input = data_get($validate, 'messages.0.content');

Rest of the message array history can not be seen in the Chat with your Collection history.

Every following prompt is registered as a new chat with different session ID and not continuation of previous conversation.

For what it's worth chatting with collection within the the dashboard works as expected. Could this be a session handler issue or a bug?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions