Phase 1: v1 single-bot roleplay engine #1
@@ -26,7 +26,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<form class="turn-input" method="post" action="/chats/{{ chat.id }}/turns">
|
<form class="turn-input" method="post" action="/chats/{{ chat.id }}/turns">
|
||||||
<textarea name="prose" rows="3" placeholder="What do you say or do?"></textarea>
|
<textarea name="prose" rows="3" placeholder="What do you say or do?" required></textarea>
|
||||||
<button type="submit">Send</button>
|
<button type="submit">Send</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ async def post_turn(
|
|||||||
conn=Depends(get_conn),
|
conn=Depends(get_conn),
|
||||||
client=Depends(get_llm_client),
|
client=Depends(get_llm_client),
|
||||||
):
|
):
|
||||||
|
if not prose.strip():
|
||||||
|
raise HTTPException(status_code=400, detail="prose cannot be empty")
|
||||||
|
|
||||||
chat = get_chat(conn, chat_id)
|
chat = get_chat(conn, chat_id)
|
||||||
if chat is None:
|
if chat is None:
|
||||||
raise HTTPException(status_code=404, detail=f"chat not found: {chat_id}")
|
raise HTTPException(status_code=404, detail=f"chat not found: {chat_id}")
|
||||||
|
|||||||
Reference in New Issue
Block a user