-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: add utils to communicate with openai #795
feat: add utils to communicate with openai #795
Conversation
d293ed6
to
2650b00
Compare
|
||
if response_format == 'json': | ||
try: | ||
return simplejson.loads(response_content) |
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.
Note: Will refactor this to add a validation to check that if the json response is of expected type? For example, in our case, we expect list
e9690ea
to
29d9948
Compare
69ec8d0
to
c5167a7
Compare
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.
A few comments, once those are addressed 👍🏼
messages, | ||
response | ||
) | ||
raise InvalidJSONResponseError('Invalid JSON response received from chatgpt', dev_message=ex.message) |
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.
Can we make this error message more user friendly?
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.
This will be returned to the frontend, right?
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.
No. We will not send this to frontend.
1fac05e
to
b9be8c5
Compare
aa3bea2
to
f449ad4
Compare
f449ad4
to
70e7d65
Compare
…bjects-and-keywords feat: add utils to communicate with openai
Description: Add utils for ai curation
Ticket: https://2u-internal.atlassian.net/browse/ENT-8317
Post-review