diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-04 18:36:31 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-04 18:36:31 +0200 |
| commit | cd827834f9ee329c27b82d987f0d1d48a854a954 (patch) | |
| tree | 3f2b63cc88f7d01ac6c55ff6c8cd5ff26dae55b5 /include/importer.hpp | |
| parent | 83cbf0e4a142ab2c57fd4fdfc056517b7149828b (diff) | |
namespace importer
Diffstat (limited to 'include/importer.hpp')
| -rw-r--r-- | include/importer.hpp | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/include/importer.hpp b/include/importer.hpp index 7e23e20..fde297a 100644 --- a/include/importer.hpp +++ b/include/importer.hpp @@ -18,40 +18,42 @@ #include "administration.hpp" -typedef uint32_t i_err; - #define I_ERR_SUCCESS 0 #define I_ERR_FAILED_UPLOAD 1 #define I_ERR_FAILED_QUERY 2 #define I_ERR_FAILED_IMPORT 3 -typedef enum -{ - IMPORT_STARTING, - IMPORT_UPLOADING_FILE, - IMPORT_QUERYING, - IMPORT_WAITING_FOR_RESPONSE, - IMPORT_DONE, -} import_status; - -typedef struct -{ - time_t started_at; - invoice result; - char file_path[MAX_LEN_PATH]; - i_err error; - import_status status; -} import_invoice_request; - -typedef struct -{ - bool (*upload_file)(char* file_path, char* file_id, size_t file_id_len); - bool (*query_with_file)(char* query, size_t query_length, char* file_id, char** response); -} ai_provider_impl; - -extern ai_provider_impl _chatgpt_api_provider; -extern ai_provider_impl _deepseek_api_provider; - -const char* import_error_to_str(i_err error); -const char* import_status_to_str(import_status status); -import_invoice_request* ai_document_to_invoice(char* file_path);
\ No newline at end of file +namespace importer { + + typedef uint32_t i_err; + + typedef enum + { + IMPORT_STARTING, + IMPORT_UPLOADING_FILE, + IMPORT_QUERYING, + IMPORT_WAITING_FOR_RESPONSE, + IMPORT_DONE, + } status; + + typedef struct + { + time_t started_at; + invoice result; + char file_path[MAX_LEN_PATH]; + i_err error; + status status; + } invoice_request; + + typedef struct + { + bool (*upload_file)(char* file_path, char* file_id, size_t file_id_len); + bool (*query_with_file)(char* query, size_t query_length, char* file_id, char** response); + } ai_provider_impl; + + const char* error_to_string(i_err error); + const char* status_to_string(status status); + + invoice_request* ai_document_to_invoice(char* file_path); + +}
\ No newline at end of file |
