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 from django import forms
class Statement(forms.Form): class Statement(forms.Form):
input = forms.CharField(required=True) input = forms.CharField(required=True, label='')
class Reset(forms.Form):
input = "__reset__"

View File

@ -29,8 +29,16 @@
{{ form.as_p }} {{ form.as_p }}
<input type="submit" value="Submit"> <input type="submit" value="Submit">
</form> </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 }} {{ points }}
</body> </body>
</body>
</html> </html>

View File

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