@brief Handle the show request @param request the request @param send_response the send response @param send_streaming_response the send streaming response
| 554 | ///@param send_response the send response |
| 555 | ///@param send_streaming_response the send streaming response |
| 556 | void RestHandler::handle_show(const json& request, |
| 557 | std::function<void(const json&)> send_response, |
| 558 | StreamResponseCallback send_streaming_response) { |
| 559 | try { |
| 560 | std::string model = request["model"]; |
| 561 | json info = { |
| 562 | {"modelfile", ""}, |
| 563 | {"parameters", ""}, |
| 564 | {"template", ""}, |
| 565 | {"details", { |
| 566 | {"parent_model", ""}, |
| 567 | {"format", ""}, |
| 568 | {"family", ""}, |
| 569 | {"families", {""}}, |
| 570 | {"parameter_size", ""}, |
| 571 | {"quantization_level", ""} |
| 572 | } |
| 573 | }, |
| 574 | {"model_info", { |
| 575 | {"general.architecture", "flm" } |
| 576 | }}, |
| 577 | {"capabilities", {"chat", "vision", "completion"}} |
| 578 | }; |
| 579 | |
| 580 | |
| 581 | send_response(info); |
| 582 | } |
| 583 | catch (const std::exception& e) { |
| 584 | json error_response = { {"error", e.what()} }; |
| 585 | send_response(error_response); |
| 586 | } |
| 587 | } |
| 588 | |
| 589 | ///@brief Handle the generate request |
| 590 | ///@param request the request |