refactor: integrate heromodels RPC with heroserver

- Integrate heromodels RPC as a handler within heroserver
- Update API endpoint to use standard JSON-RPC format
- Add generated curl examples with copy button to docs
- Improve error handling to return JSON-RPC errors
- Simplify heromodels server example script
This commit is contained in:
Mahmoud-Emad
2025-09-17 21:08:17 +03:00
parent 380a8dea1b
commit 386fae3421
10 changed files with 314 additions and 122 deletions

View File

@@ -145,5 +145,8 @@ pub fn (handler Handler) handle(request Request) !Response {
}
// Execute the procedure handler with the request payload
return procedure_func(request) or { panic(err) }
return procedure_func(request) or {
// Return proper JSON-RPC error instead of panicking
return new_error(request.id, internal_error)
}
}