diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/administration.hpp | 2 | ||||
| -rw-r--r-- | include/importer.hpp | 6 | ||||
| -rw-r--r-- | include/strops.hpp | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/include/administration.hpp b/include/administration.hpp index 4cd83ee..75f5b52 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -341,6 +341,8 @@ typedef enum { AI_PROVIDER_OPENAI = 0, AI_PROVIDER_DEEPSEEK = 1, + + AI_PROVIDER_END, } ai_provider; typedef struct diff --git a/include/importer.hpp b/include/importer.hpp index fde297a..cb24cf8 100644 --- a/include/importer.hpp +++ b/include/importer.hpp @@ -23,9 +23,10 @@ #define I_ERR_FAILED_QUERY 2 #define I_ERR_FAILED_IMPORT 3 +typedef uint32_t i_err; + namespace importer { - typedef uint32_t i_err; typedef enum { @@ -47,6 +48,7 @@ namespace importer { typedef struct { + char* provider_name; 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; @@ -55,5 +57,5 @@ namespace importer { const char* status_to_string(status status); invoice_request* ai_document_to_invoice(char* file_path); - + ai_provider_impl get_ai_provider_implementation(ai_provider provider); }
\ No newline at end of file diff --git a/include/strops.hpp b/include/strops.hpp index 3a85543..5dc7368 100644 --- a/include/strops.hpp +++ b/include/strops.hpp @@ -23,10 +23,15 @@ namespace strops { size_t copy(char *dst, const char *src, size_t size); char* contains(char* a, char* b); bool equals(const char* a, const char* b); + + s32 format_va(char* s, size_t n, const char* format, va_list args); + s32 format(char* s, size_t n, const char* format, ...); + void replace(char *buf, size_t buf_size, const char *search, const char *replace); void replace_int32(char *buf, size_t buf_size, const char *search, s32 number); void replace_int64(char *buf, size_t buf_size, const char *search, s64 number); void replace_float(char *buf, size_t buf_size, const char *search, float number, int decimals); + bool is_prefixed(const char *pre, const char *str); char* get_filename(const char* path); |
