1 /* 2 * Copyright (C) 2021-2023 Alibaba Group Holding Limited 3 */ 4 5 #ifndef _AI_AGENT_H_ 6 #define _AI_AGENT_H_ 7 #include "aiagent_engine.h" 8 #include "aiagent_common.h" 9 10 11 typedef struct _aiagent_context_t { 12 const char *name; 13 const char *desc; 14 int (*available) (void); 15 aiagent_engine_t *(*create) (int engineid); 16 } aiagent_context_t; 17 18 19 /** @defgroup aiagent_aos_api aiagent 20 * @{ 21 */ 22 23 /** 24 * Initialize aiagent service. 25 * @param[in] engine_name engine name. 26 * @param[in] model ai model. 27 * 28 * @return 0 on success, negative error on failure. 29 */ 30 int32_t aiagent_service_init(const char *engine_name, ai_model_t model); 31 32 /** 33 * Uninitialize aiagent service. 34 * 35 * @return 0 on success, negative error on failure. 36 */ 37 int32_t aiagent_service_uninit(void); 38 39 40 /** 41 * Config the aiagent service. 42 * @param[in] config ai engine config. 43 * 44 * @return 0 on success, negative error on failure. 45 */ 46 void aiagent_service_config(ai_config_t *config); 47 48 /** 49 * Init the aiagent service. 50 * @param[in] src1 source data1(image) you want to detect. 51 * @param[in] src2 source data2(image), some cases need to compare with original data. 52 * @param[in] cb callback function to deal with result. 53 * 54 * @return 0 on success, negative error on failure. 55 */ 56 int32_t aiagent_service_model_infer(char *src1, char *src2, ai_engine_cb_t cb); 57 58 /** 59 * Init the aiagent service. 60 * 61 * @return ai model get frome aiagent service. 62 */ 63 ai_model_t aiagent_service_get_cur_model(void); 64 65 /** 66 * @} 67 */ 68 69 #endif // _AI_AGENT_H_ 70