- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4
 
Implement websocket to be used for AI batch edit #4862
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
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.
I think I have this working. I am seeing that the response back from the mutation is the data that is sent in:
{
  "data": {
    "sendChatMessage": {
      "conversationId": "3336",
      "prompt": "Please add subject headings",
      "query": "id:(207de63a-af53-4ef7-b05a-615a30721745 OR 1352daa3-a274-430e-a80e-a782066afc38)",
      "type": "chat"
    }
  }
}
Should I be seeing?
{
  conversation_id: conversation_id,
  message: "Here is your plan....",
  type: "plan",
}
| 
           mathewjordan - No, because the response to the mutation is immediate. The real response will come through the subscription after the chat has done it's work. It probably could just be on "OK" kind of a response in the mutation.  | 
    
| 
           I noticed that when I send the chat message a second time (re-submitting the mutation in graphiql) it gives a  Are you seeing that as well @kdid ?  | 
    
| 
           I am not seeing the 403.  | 
    
| 
           @bmquinn - try again. I removed the editor auth on the subscription. I think that was not the right way to do that. Or - it doesn't work via Postman.  | 
    
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.
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.
Works great on my end! 👍

Summary
Barebones implementation of websocket to be used for AI batch edit.
fixes https://github.com/nulib/repodev_planning_and_docs/issues/5669
Specific Changes in this PR
Two GraphQL endpoints implemented. Return dummy data, no streaming.
chatResponsesubscriptionsendChatMessagemutationVersion bump required by the PR
See Semantic Versioning 2.0.0 for help discerning which is required.
Steps to Test
*Log into Meadow as Editor or above.
I've been testing it in postman by directly connecting to the websocket and then sending:
followed by:
And then separately sending in a GraphQL mutation in GraphiQL (conversation id must match the subscription):
(I couldn't the GQL subscription to work using the GraphQL type request in Postman - if you do please let me know how you did it)
🚀 Deployment Notes
Note - if you check any of these boxes go to the (always open)
main<-stagingPR and add detailed notes and instructions to help out others who may end up deploying your changes to productionmix meadow.pipeline.setuprun)miscellanyTested/Verified