Skip to content

Commit

Permalink
Fix: Line breaks and spaces in Frequently prompts are filtered out.
Browse files Browse the repository at this point in the history
  • Loading branch information
WongSaang committed Apr 11, 2023
1 parent ea78ce8 commit 5041587
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions chat/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class Meta:


class PromptSerializer(serializers.ModelSerializer):

prompt = serializers.CharField(trim_whitespace=False, allow_blank=True)

class Meta:
model = Prompt
fields = ['id', 'title', 'prompt', 'created_at', 'updated_at']
Expand Down
3 changes: 0 additions & 3 deletions chat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ def stream_content():
# print(event)
if event['choices'][0]['finish_reason'] is not None:
break
# if debug
if settings.DEBUG:
print(event)
if 'content' in event['choices'][0]['delta']:
event_text = event['choices'][0]['delta']['content']
completion_text += event_text # append the text
Expand Down

0 comments on commit 5041587

Please sign in to comment.