fail to add reset button

This commit is contained in:
Daniel Cronin 2024-11-12 04:07:36 -06:00
parent 7b9237b028
commit 97f0755b31
4 changed files with 21 additions and 9 deletions

View File

@ -37,7 +37,7 @@ chat_session = model.start_chat(
]
)
# print(chat_session.send_message("hello world!").text)
print(chat_session.send_message("hello world!").text)

View File

@ -1,4 +1,7 @@
from django import forms
class Statement(forms.Form):
input = forms.CharField(required=True)
input = forms.CharField(required=True, label='')
class Reset(forms.Form):
input = "__reset__"

View File

@ -30,7 +30,15 @@
<input type="submit" value="Submit">
</form>
<ul>
<li>
<strong>Talk to the AI with the box above.</strong>
</li>
<li>
<strong>Ask the AI to start over when starting on a new bullet.</strong>
</li>
</ul>
{{ points }}
</body>
</body>
</html>

View File

@ -1,8 +1,10 @@
# appname/views.py
from django.shortcuts import render
from django.http import HttpResponse
from .models import Statement
from django.shortcuts import redirect
from django.template.defaultfilters import title
from django.utils.termcolors import RESET
from .models import *
from . import gemini
import markdown
@ -12,13 +14,12 @@ def home(request):
md = markdown.Markdown()
response = md.convert(response)
# formatted_response = re.sub('\*\*', r'\n\n', response)
form = Statement()
reset_button = Reset()
return render(request, 'home.html', {'form': form, 'response': response})
else:
form = Statement()
return render(request, 'home.html', {'form': form, 'response': 'Enter some basic data to begin:'})
return render(request, 'home.html', {'form': form, 'title': 'Enter data', 'response': 'Enter some basic data to begin:'})
def about(request):
return HttpResponse("This is the about page")