2025-02-10 19:39:48 +08:00
|
|
|
//
|
|
|
|
// LLMInferenceEngineWrapper.h
|
|
|
|
// mnn-llm
|
|
|
|
//
|
|
|
|
// Created by wangzhaode on 2023/12/14.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef LLMInferenceEngineWrapper_h
|
|
|
|
#define LLMInferenceEngineWrapper_h
|
|
|
|
|
|
|
|
|
|
|
|
// LLMInferenceEngineWrapper.h
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
typedef void (^CompletionHandler)(BOOL success);
|
|
|
|
typedef void (^OutputHandler)(NSString * _Nonnull output);
|
|
|
|
|
|
|
|
@interface LLMInferenceEngineWrapper : NSObject
|
|
|
|
|
|
|
|
- (instancetype)initWithModelPath:(NSString *)modelPath completion:(CompletionHandler)completion;
|
|
|
|
- (void)processInput:(NSString *)input withOutput:(OutputHandler)output;
|
|
|
|
|
|
|
|
- (void)addPromptsFromArray:(NSArray<NSDictionary *> *)array;
|
|
|
|
|
2025-03-19 17:03:51 +08:00
|
|
|
- (void)setConfigWithJSONString:(NSString *)jsonStr;
|
|
|
|
|
2025-02-10 19:39:48 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
|
|
|
|
#endif /* LLMInferenceEngineWrapper_h */
|