|
6 | 6 | #import <Foundation/NSString.h>
|
7 | 7 | #import <Foundation/NSValue.h>
|
8 | 8 |
|
9 |
| -@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, YChatKotlinArray<T>, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; |
| 9 | +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, YChatKotlinArray<T>, YChatKotlinException, NSData, YChatKotlinByteArray, YChatKotlinRuntimeException, YChatKotlinIllegalStateException, YChatKotlinByteIterator; |
10 | 10 |
|
11 |
| -@protocol YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; |
| 11 | +@protocol YChatAudioTranscriptions, YChatAudioTranslations, YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; |
12 | 12 |
|
13 | 13 | NS_ASSUME_NONNULL_BEGIN
|
14 | 14 | #pragma clang diagnostic push
|
@@ -147,6 +147,8 @@ __attribute__((swift_name("KotlinBoolean")))
|
147 | 147 | __attribute__((swift_name("YChat")))
|
148 | 148 | @protocol YChatYChat
|
149 | 149 | @required
|
| 150 | +- (id<YChatAudioTranscriptions>)audioTranscriptions __attribute__((swift_name("audioTranscriptions()"))); |
| 151 | +- (id<YChatAudioTranslations>)audioTranslations __attribute__((swift_name("audioTranslations()"))); |
150 | 152 | - (id<YChatChatCompletions>)chatCompletions __attribute__((swift_name("chatCompletions()")));
|
151 | 153 | - (id<YChatCompletion>)completion __attribute__((swift_name("completion()")));
|
152 | 154 | - (id<YChatEdits>)edits __attribute__((swift_name("edits()")));
|
@@ -272,6 +274,39 @@ __attribute__((swift_name("ChatGptException")))
|
272 | 274 | @property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode")));
|
273 | 275 | @end
|
274 | 276 |
|
| 277 | +__attribute__((swift_name("AudioTranscriptions"))) |
| 278 | +@protocol YChatAudioTranscriptions |
| 279 | +@required |
| 280 | + |
| 281 | +/** |
| 282 | + * @note This method converts instances of CancellationException, ChatGptException to errors. |
| 283 | + * Other uncaught Kotlin exceptions are fatal. |
| 284 | +*/ |
| 285 | +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); |
| 286 | +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id<YChatYChatCallback>)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); |
| 287 | +- (id<YChatAudioTranscriptions>)setLanguageLanguage:(NSString *)language __attribute__((swift_name("setLanguage(language:)"))); |
| 288 | +- (id<YChatAudioTranscriptions>)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); |
| 289 | +- (id<YChatAudioTranscriptions>)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); |
| 290 | +- (id<YChatAudioTranscriptions>)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); |
| 291 | +- (id<YChatAudioTranscriptions>)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); |
| 292 | +@end |
| 293 | + |
| 294 | +__attribute__((swift_name("AudioTranslations"))) |
| 295 | +@protocol YChatAudioTranslations |
| 296 | +@required |
| 297 | + |
| 298 | +/** |
| 299 | + * @note This method converts instances of CancellationException, ChatGptException to errors. |
| 300 | + * Other uncaught Kotlin exceptions are fatal. |
| 301 | +*/ |
| 302 | +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); |
| 303 | +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id<YChatYChatCallback>)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); |
| 304 | +- (id<YChatAudioTranslations>)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); |
| 305 | +- (id<YChatAudioTranslations>)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); |
| 306 | +- (id<YChatAudioTranslations>)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); |
| 307 | +- (id<YChatAudioTranslations>)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); |
| 308 | +@end |
| 309 | + |
275 | 310 | __attribute__((swift_name("ChatCompletions")))
|
276 | 311 | @protocol YChatChatCompletions
|
277 | 312 | @required
|
@@ -364,6 +399,12 @@ __attribute__((swift_name("RetrieveModel")))
|
364 | 399 | - (void)executeId:(NSString *)id callback:(id<YChatYChatCallback>)callback __attribute__((swift_name("execute(id:callback:)")));
|
365 | 400 | @end
|
366 | 401 |
|
| 402 | +__attribute__((objc_subclassing_restricted)) |
| 403 | +__attribute__((swift_name("FileBytesKt"))) |
| 404 | +@interface YChatFileBytesKt : YChatBase |
| 405 | ++ (YChatKotlinByteArray *)toByteArray:(NSData *)receiver __attribute__((swift_name("toByteArray(_:)"))); |
| 406 | +@end |
| 407 | + |
367 | 408 | __attribute__((objc_subclassing_restricted))
|
368 | 409 | __attribute__((swift_name("KotlinArray")))
|
369 | 410 | @interface YChatKotlinArray<T> : YChatBase
|
@@ -408,13 +449,34 @@ __attribute__((swift_name("KotlinCancellationException")))
|
408 | 449 | - (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
|
409 | 450 | @end
|
410 | 451 |
|
| 452 | +__attribute__((objc_subclassing_restricted)) |
| 453 | +__attribute__((swift_name("KotlinByteArray"))) |
| 454 | +@interface YChatKotlinByteArray : YChatBase |
| 455 | ++ (instancetype)arrayWithSize:(int32_t)size __attribute__((swift_name("init(size:)"))); |
| 456 | ++ (instancetype)arrayWithSize:(int32_t)size init:(YChatByte *(^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); |
| 457 | ++ (instancetype)alloc __attribute__((unavailable)); |
| 458 | ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); |
| 459 | +- (int8_t)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); |
| 460 | +- (YChatKotlinByteIterator *)iterator __attribute__((swift_name("iterator()"))); |
| 461 | +- (void)setIndex:(int32_t)index value:(int8_t)value __attribute__((swift_name("set(index:value:)"))); |
| 462 | +@property (readonly) int32_t size __attribute__((swift_name("size"))); |
| 463 | +@end |
| 464 | + |
411 | 465 | __attribute__((swift_name("KotlinIterator")))
|
412 | 466 | @protocol YChatKotlinIterator
|
413 | 467 | @required
|
414 | 468 | - (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
415 | 469 | - (id _Nullable)next __attribute__((swift_name("next()")));
|
416 | 470 | @end
|
417 | 471 |
|
| 472 | +__attribute__((swift_name("KotlinByteIterator"))) |
| 473 | +@interface YChatKotlinByteIterator : YChatBase <YChatKotlinIterator> |
| 474 | +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); |
| 475 | ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); |
| 476 | +- (YChatByte *)next __attribute__((swift_name("next()"))); |
| 477 | +- (int8_t)nextByte __attribute__((swift_name("nextByte()"))); |
| 478 | +@end |
| 479 | + |
418 | 480 | #pragma pop_macro("_Nullable_result")
|
419 | 481 | #pragma clang diagnostic pop
|
420 | 482 | NS_ASSUME_NONNULL_END
|
0 commit comments