3224d16197
Co-authored-by: Copilot <copilot@github.com>
45 lines
1.1 KiB
HTML
45 lines
1.1 KiB
HTML
{% extends "base.html" %} {% block title %}Text Generation — All You Can GET
|
|
AI{% endblock %} {% block content %}
|
|
<div class="card">
|
|
<h1>Text Generation</h1>
|
|
<form method="post">
|
|
<label for="model">Model</label>
|
|
<input
|
|
id="model"
|
|
name="model"
|
|
type="text"
|
|
required
|
|
placeholder="e.g. openai/gpt-4o"
|
|
value="{{ request.form.get('model', '') }}"
|
|
/>
|
|
|
|
<label for="prompt">Prompt</label>
|
|
<textarea
|
|
id="prompt"
|
|
name="prompt"
|
|
rows="5"
|
|
required
|
|
placeholder="Describe what you want…"
|
|
>
|
|
{{ request.form.get('prompt', '') }}</textarea
|
|
>
|
|
|
|
<button type="submit">Generate text</button>
|
|
</form>
|
|
|
|
{% if error %}
|
|
<div class="alert alert-error mt-2">{{ error }}</div>
|
|
{% endif %} {% if result %}
|
|
<div class="result">
|
|
<h2>Result</h2>
|
|
<pre>{{ result.content }}</pre>
|
|
{% if result.usage %}
|
|
<p class="text-muted mt-1" style="font-size: 0.8rem">
|
|
Tokens: {{ result.usage.get('total_tokens', '—') }}
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|