FoundationModels · IOS API REFERENCE
LanguageModelError.Refusal
struct · iOS 27.0+ · SDK 27.1
struct Refusal
Information about a model refusal.
Refusal failures indicate that the model chose not to respond to a prompt.
Members (7)
init · iOS 27.0+init
TypeScriptstatic init(explanation: string, debugDescription: string, metadata?: Record<string, SDKHandle>): LanguageModelError_Refusal
Swift declarationinit(explanation: String, debugDescription: String, metadata: [String : any Sendable] = [:])
get · iOS 27.0+explanation
TypeScriptget explanation(): Promise<LanguageModelSession_Response<string>>
Swift declarationnonisolated(nonsending) var explanation: LanguageModelSession.Response<String> { get async throws }
get · iOS 27.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String
set · iOS 27.0+debugDescription
TypeScriptset debugDescription(value: string)
Swift declarationvar debugDescription: String
get · iOS 27.0+explanationStream
TypeScriptget explanationStream(): LanguageModelSession_ResponseStream<string>
Swift declarationvar explanationStream: LanguageModelSession.ResponseStream<String> { get }
get · iOS 27.0+metadata
TypeScriptget metadata(): Record<string, SDKHandle>
Swift declarationvar metadata: [String : any Sendable]
set · iOS 27.0+metadata
TypeScriptset metadata(value: Record<string, SDKHandle>)
Swift declarationvar metadata: [String : any Sendable]
Skipped declarations
No declarations were skipped in this snapshot.
All FoundationModels types →