server: support OAI /v1/audio/transcriptions API (#21863)

* server: support OAI /v1/audio/transcriptions API

* address autoreview comments

* correct default response_format value
This commit is contained in:
Xuan-Son Nguyen
2026-04-14 11:09:52 +02:00
committed by GitHub
parent e21cdc11a0
commit e489a5ca0e
9 changed files with 194 additions and 38 deletions
+4
View File
@@ -5,6 +5,8 @@
#include <map>
#include <string>
#include <thread>
#include <vector>
#include <cstdint>
struct common_params;
@@ -32,6 +34,7 @@ struct server_http_res {
// unique pointer, used by set_chunked_content_provider
// httplib requires the stream provider to be stored in heap
using server_http_res_ptr = std::unique_ptr<server_http_res>;
using raw_buffer = std::vector<uint8_t>;
struct server_http_req {
std::map<std::string, std::string> params; // path_params + query_params
@@ -39,6 +42,7 @@ struct server_http_req {
std::string path;
std::string query_string; // query parameters string (e.g. "action=save")
std::string body;
std::map<std::string, raw_buffer> files; // used for file uploads (form data)
const std::function<bool()> & should_stop;
std::string get_param(const std::string & key, const std::string & def = "") const {