Hymn Creator up and running on your localhost. See README on installation, setup and deployment of Ray, kodosumi and the Hymn Creator agentic service.
Authentication
Use the/login or /api/login endpoint to authenticate, retrieve an API key and a set of cookies for further API interaction. The default username and password is admin and admin. Endpoint /login authenticates with GET plus URL parameters. POST authenticates with URL-encoded form data (application/x-www-form-urlencoded). The API endpoint /api/login authenticates with POST and a JSON body (application/json).
/api/login is
Flow Control
Use theapi_key or cookies with further requests. The following example retrieves the list of flows using api_key.
cookies. This demo uses this approach.
Retrieve Inputs Scheme
Retrieve Hymn Creator input schema atGET /-/localhost/8001/hymn/- and launch flow execution with POST /-/localhost/8001/hymn/- and appropriate inputs data.
openapi_extra. Key elements delivers the list of inputs element.
Launch
kodosumi rendering engine translates all inputselements into a form to post and trigger flow execution at http://localhost:3370/inputs/-/localhost/8001/hymn/-/.
POST follow the inputs scheme as in example:
fid (flow identifier). Use this fid for further requests.
Error Handling
In case of failure the result is empty. The response haserrors as a key/value pair with error information.
topic:
Execution Control
Request and poll for status updates at/outputs/status.
final field. Note: The final field is populated for both successful completions (status == "finished") and errors (status == "error"). For errors, it contains the serialized error message as Text.
/status request might fail due to Ray latencies you should harden the intial request past flow launch with ?extended=true as in the following example:
/outputs/stream.
Runtime Error Handling
During flow execution, errors may occur that raisekodosumi.error.KodosumiError. Important: Only kodosumi.error.KodosumiError exceptions are handled and exposed through the API. All other exceptions are silently ignored and will not appear in the status or results endpoints.
When a kodosumi.error.KodosumiError is raised, the flow status changes to "error" and the error message is made available through the status endpoint’s final field (as serialized Text) as well as the results endpoints.
Error Status
When a flow execution encounters akodosumi.error.KodosumiError, the status endpoint returns status == "error":
Error Message Retrieval
The error message is available through the results endpointsGET /outputs/raw/{fid} and GET /outputs/html/{fid}. The error message is returned as Text (not Markdown):
kodosumi.error.KodosumiError and is formatted as plain text (dtypes.Text), making it suitable for display in user interfaces.
