One Logo Pool Ball
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

TypeScript
static init(explanation: string, debugDescription: string, metadata?: Record<string, SDKHandle>): LanguageModelError_Refusal
Swift declaration
init(explanation: String, debugDescription: String, metadata: [String : any Sendable] = [:])
get · iOS 27.0+

explanation

TypeScript
get explanation(): Promise<LanguageModelSession_Response<string>>
Swift declaration
nonisolated(nonsending) var explanation: LanguageModelSession.Response<String> { get async throws }
get · iOS 27.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String
set · iOS 27.0+

debugDescription

TypeScript
set debugDescription(value: string)
Swift declaration
var debugDescription: String
get · iOS 27.0+

explanationStream

TypeScript
get explanationStream(): LanguageModelSession_ResponseStream<string>
Swift declaration
var explanationStream: LanguageModelSession.ResponseStream<String> { get }
get · iOS 27.0+

metadata

TypeScript
get metadata(): Record<string, SDKHandle>
Swift declaration
var metadata: [String : any Sendable]
set · iOS 27.0+

metadata

TypeScript
set metadata(value: Record<string, SDKHandle>)
Swift declaration
var metadata: [String : any Sendable]

Skipped declarations

No declarations were skipped in this snapshot.

All FoundationModels types →