Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: generate article summaries with chat gpt #203
feat: generate article summaries with chat gpt #203
Changes from 7 commits
dad1e79
13bda40
90e6547
b015690
182edbb
96e3449
4b789e8
e393972
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
🛠️ Refactor suggestion
Move system prompt to settings or constants
The system prompt should be moved to a settings file or constants module for better maintainability and reusability.
📝 Committable suggestion
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.
💡 Codebase verification
The
gpt_summary
field exists in the Article model but with a different field typeThe
gpt_summary
field exists in both the Article model and the migration file, but there's a discrepancy in the field type:models.TextField(blank=True, null=True)
tinymce.models.HTMLField(blank=True, null=True)
This inconsistency needs to be addressed to match the field types.
🔗 Analysis chain
Verify the Article model schema.
Ensure that the
gpt_summary
field exists in the Article model schema as referenced in both serializers.Also applies to: 41-41
Let me gather more information about the
gpt_summary
field from the migration file and the complete Article model.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1180
Script:
Length of output: 6230
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 still remains an issue here to be resolved
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.
@losndu, to resolve the remaining issue, please ensure that the
gpt_summary
field in theArticle
model and the migration have the same field type. Currently, there is a mismatch:In
server/apps/research/models/article.py
,gpt_summary
is defined as:In
server/apps/research/migrations/0017_article_gpt_summary_alter_article_summary.py
, it is defined as:To fix the inconsistency, you can update the model to use
HTMLField
. Here's how:Import
HTMLField
fromtinymce.models
in your model file:Update the
gpt_summary
field in theArticle
model:Alternatively, if you prefer to keep
gpt_summary
as aTextField
, you should update the migration file to reflectTextField
instead ofHTMLField
. However, it's generally recommended to have rich text fields like summaries useHTMLField
for better content management.After making the changes, don't forget to run:
This will create a new migration to reflect the changes and apply it to your database.
Let me know if you have any questions or need further assistance!