-
Notifications
You must be signed in to change notification settings - Fork 57
Make session_id optional #115
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
Conversation
|
Hey @schumannc thanks for your PR, just to clarify: the intention here is to have a chat endpoint that does not have a session id, thus not creating memory instances and everything else, right? Talking to @walison17, we could maintain this endpoint, but we should rename this endpoint to |
|
Also @schumannc could you share more of the use case you think makes this change necessary? |
|
Another way would be implement the router using plugins, but I would keep the other changes to bypass the memory chat. |
src/main.py
Outdated
|
|
||
|
|
||
| @app.post("/chat") | ||
| async def post_message(message: Chat): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a route with the same name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ask sounds better, right?
src/tests/test_views.py
Outdated
| self.assertIn("message", response.json()) | ||
|
|
||
| def test_post_message_no_session_id(self): | ||
| response = client.post(f"/chat", json={"message": "Hello"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| response = client.post(f"/chat", json={"message": "Hello"}) | |
| response = client.post("/chat", json={"message": "Hello"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with this suggestion
src/tests/test_views.py
Outdated
| self.assertIn("message", response.json()) | ||
|
|
||
| def test_post_message_no_session_id(self): | ||
| response = client.post(f"/chat", json={"message": "Hello"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with this suggestion
src/main.py
Outdated
|
|
||
|
|
||
| @app.post("/chat") | ||
| async def post_message(message: Chat): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ask sounds better, right?
New Endpoint for Chat Responses without Session ID:
Adding an endpoint to handle chats without a session ID. This could be especially useful for stateless interactions where context retention isn't necessary.
#118