Remove initial-prompt field from new_session.ui form and update create_session.dspy to handle empty initial message

This commit is contained in:
yumoqing 2026-04-23 11:23:09 +08:00
parent 2115829274
commit 9494a235f2
3 changed files with 3 additions and 12 deletions

BIN
wwwroot/.new_session.ui.swp Normal file

Binary file not shown.

View File

@ -33,15 +33,6 @@
"options": {
"url": "/hermes-web-cli/hermes_services/options"
}
},
{
"uitype": "text",
"name": "initial-prompt",
"label": "Initial Prompt (Optional)",
"placeholder": "Enter initial context or instructions...",
"width": "100%",
"height": "100px",
"marginBottom": "24px"
}
]
},

View File

@ -1,6 +1,6 @@
# Create a new session with the selected Hermes service
# This .dspy file handles the POST request from new_session.ui form submission
# It receives form data with service_id and initial-prompt fields
# It receives form data with service_id field
try:
# Extract form data from request context
@ -12,7 +12,6 @@ try:
# Get required parameters
service_id = form_data.get('service_id')
initial_prompt = form_data.get('initial-prompt', '')
if not service_id:
# Redirect back to form with error
@ -20,7 +19,8 @@ try:
# Use the function provided by the hermes-web-cli module
# This will call the remote hermes-service API
session_result = create_session(service_id, initial_prompt)
# Pass empty string as initial message since we don't collect it in the form
session_result = create_session(service_id, "")
if session_result:
# Redirect to the new session's user interaction page