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
Add backend controller and client for Gen AI #57944
Conversation
return render(status: :ok, json: {status: filter_result.type, flagged_content: filter_result.content}) if filter_result | ||
inputs = params[:inputs] | ||
temperature = params[:temperature] | ||
# TODO: Format input to send to Sagemaker. |
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.
Still waiting clarification on how to format. Using this ref as a reference for now.
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.
Sorry, kind of got comment happy :) Mostly small things / me trying to understand this stuff better!
One overall q -- is there any value in maintaining the existing API that can actually talk to an AI (ie, openai) in the short term, rather than cutting over to this new version that isn't actually hooked up? I was wondering if Dan and co. might find that useful for taking screenshots/etc.
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.
Nice, this is coming together well! A few comments but looks solid overall
Thanks Ben - this is all great feedback! Posted your overall question in this Slack thread and the response from Dan and Sanchit is that we should go ahead and proceed with getting |
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.
Looks like a good checkpoint to me!
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.
Looks good!
This PR adds the
aichat_controller
which will make requests to Sagemaker when the API is available and the corresponding client fileaichatCompletionApi
which makes a call to the controller. This will be used when a user submits a chat message in the Aichat workspace.The controller receives:
savedAiCustomizations
chatContext
that includes the newest user message text,userId
,currentLevelId
,scriptId
, andchannelId
.The controller sends back a dummy assistant response for now. Screenshot from dev console after adding print statements in
aichatCompletionApi.ts
andaichatRedux
ofresponse
.Response displayed in workspace:
Links
jira
Testing story
Tested locally using /allthethings levels.
Screenshots from Network Tab:
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: