Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat API endpoint not preserving chat history #43

Open
thecode7 opened this issue Aug 1, 2024 · 0 comments
Open

Chat API endpoint not preserving chat history #43

thecode7 opened this issue Aug 1, 2024 · 0 comments

Comments

@thecode7
Copy link

thecode7 commented Aug 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant