| Case | AIChatSessionStatus.error | case error | Sources/SwiftAISDK/AIChatSession.swift |
| Case | AIChatSessionStatus.ready | case ready | Sources/SwiftAISDK/AIChatSession.swift |
| Case | AIChatSessionStatus.streaming | case streaming | Sources/SwiftAISDK/AIChatSession.swift |
| Case | AIChatSessionStatus.submitted | case submitted | Sources/SwiftAISDK/AIChatSession.swift |
| Case | AIChatTransportTrigger.regenerateMessage | case regenerateMessage | Sources/SwiftAISDK/AIChatTransport.swift |
| Case | AIChatTransportTrigger.submitMessage | case submitMessage | Sources/SwiftAISDK/AIChatTransport.swift |
| Class | AIChatSession | @MainActor final class AIChatSession | Sources/SwiftAISDK/AIChatSession.swift |
| Enumeration | AIChatSessionStatus | enum AIChatSessionStatus | Sources/SwiftAISDK/AIChatSession.swift |
| Enumeration | AIChatTransportTrigger | enum AIChatTransportTrigger | Sources/SwiftAISDK/AIChatTransport.swift |
| Function | convertToModelMessage(_:) | func convertToModelMessage(_ message: AIUIMessage) throws -> AIMessage | Sources/SwiftAISDK/AIUIMessageConversion.swift |
| Function | convertToModelMessages(_:) | func convertToModelMessages(_ messages: [AIUIMessage]) throws -> [AIMessage] | Sources/SwiftAISDK/AIUIMessageConversion.swift |
| Function | convertToModelMessages(_:ignoreIncompleteToolCalls:) | func convertToModelMessages(_ messages: [AIUIMessage], ignoreIncompleteToolCalls: Bool) throws -> [AIMessage] | Sources/SwiftAISDK/AIUIMessageConversion.swift |
| Function | safeValidateUIMessages(_:) | func safeValidateUIMessages(_ messages: [AIUIMessage]) -> AIUIMessageValidationResult | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Function | validateUIMessages(_:) | @discardableResult func validateUIMessages(_ messages: [AIUIMessage]) throws -> [AIUIMessage] | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Initializer | init(chatID:abortSignal:headers:body:metadata:) | init(chatID: String, abortSignal: AIAbortSignal? = nil, headers: [String : String] = [:], body: [String : JSONValue] = [:], metadata: JSONValue? = nil) | Sources/SwiftAISDK/AIChatTransport.swift |
| Initializer | init(chatID:transport:messages:generateMessageID:onError:onFinish:sendAutomaticallyWhen:) | @MainActor init(chatID: String = UUID().uuidString, transport: any AIChatTransport, messages: [AIUIMessage] = [], generateMessageID: @escaping @Sendable () -> String = { UUID().uuidString }, onError: (@MainActor @Sendable (any Error) -> Void)? = nil, onFinish: (@MainActor @Sendable (AIChatSessionFinishEvent) -> Void)? = nil, sendAutomaticallyWhen: (@MainActor @Sendable ([AIUIMessage]) -> Bool)? = nil) | Sources/SwiftAISDK/AIChatSession.swift |
| Initializer | init(chatID:trigger:messageID:responseMessageID:messages:abortSignal:headers:body:metadata:) | init(chatID: String, trigger: AIChatTransportTrigger = .submitMessage, messageID: String? = nil, responseMessageID: String? = nil, messages: [AIUIMessage], abortSignal: AIAbortSignal? = nil, headers: [String : String] = [:], body: [String : JSONValue] = [:], metadata: JSONValue? = nil) | Sources/SwiftAISDK/AIChatTransport.swift |
| Initializer | init(headers:body:metadata:) | init(headers: [String : String] = [:], body: [String : JSONValue] = [:], metadata: JSONValue? = nil) | Sources/SwiftAISDK/AIChatSession.swift |
| Initializer | init(message:) | init(message: AIUIMessage = .assistant()) | Sources/SwiftAISDK/AIUIMessageStreamReducer.swift |
| Initializer | init(message:messages:isAbort:isDisconnect:isError:finishReason:) | init(message: AIUIMessage?, messages: [AIUIMessage], isAbort: Bool, isDisconnect: Bool, isError: Bool, finishReason: String? = nil) | Sources/SwiftAISDK/AIChatSession.swift |
| Initializer | init(messages:issues:) | init(messages: [AIUIMessage], issues: [AIUIMessageValidationIssue]) | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Initializer | init(model:executableTools:maxSteps:stopWhen:prepareStep:toolApproval:requestOptions:timeoutNanoseconds:retryPolicy:telemetry:sendReasoning:sendSources:sendFinish:generateMessageID:) | init(model: any LanguageModel, executableTools: [AITool] = [], maxSteps: Int = 5, stopWhen: [AIStopCondition] = [], prepareStep: AIPrepareStep? = nil, toolApproval: AIToolApproval? = nil, requestOptions: AIChatRequestOptions = AIChatRequestOptions(), timeoutNanoseconds: UInt64? = nil, retryPolicy: AIRetryPolicy = .default, telemetry: Telemetry.Options? = nil, sendReasoning: Bool = true, sendSources: Bool = false, sendFinish: Bool = true, generateMessageID: @escaping @Sendable () -> String = { UUID().uuidString }) | Sources/SwiftAISDK/AIChatTransport.swift |
| Initializer | init(path:message:) | init(path: String, message: String) | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Initializer | init(temperature:topP:topK:presencePenalty:frequencyPenalty:seed:maxOutputTokens:stopSequences:responseFormat:reasoning:tools:toolContexts:toolChoice:includeRawChunks:providerOptions:extraBody:headers:) | init(temperature: Double? = nil, topP: Double? = nil, topK: Int? = nil, presencePenalty: Double? = nil, frequencyPenalty: Double? = nil, seed: Int? = nil, maxOutputTokens: Int? = nil, stopSequences: [String] = [], responseFormat: AIResponseFormat? = nil, reasoning: String? = nil, tools: [String : JSONValue] = [:], toolContexts: [String : JSONValue] = [:], toolChoice: JSONValue? = nil, includeRawChunks: Bool = false, providerOptions: [String : JSONValue] = [:], extraBody: [String : JSONValue] = [:], headers: [String : String] = [:]) | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | addToolApprovalResponse(_:id:metadata:options:) | @MainActor func addToolApprovalResponse(_ response: AIToolApprovalResponse, id: String? = nil, metadata: [String : JSONValue] = [:], options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | addToolOutput(_:id:metadata:options:) | @MainActor func addToolOutput(_ result: AIToolResult, id: String? = nil, metadata: [String : JSONValue] = [:], options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | addToolResult(_:id:metadata:options:) | @MainActor func addToolResult(_ result: AIToolResult, id: String? = nil, metadata: [String : JSONValue] = [:], options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | clearError() | @MainActor func clearError() | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | consume(_:) | @discardableResult mutating func consume(_ part: LanguageStreamPart) throws -> AIUIMessage | Sources/SwiftAISDK/AIUIMessageStreamReducer.swift |
| Instance Method | consume(contentsOf:) | @discardableResult mutating func consume<S>(contentsOf parts: S) throws -> AIUIMessage where S : Sequence, S.Element == LanguageStreamPart | Sources/SwiftAISDK/AIUIMessageStreamReducer.swift |
| Instance Method | languageModelRequest(messages:abortSignal:headers:) | func languageModelRequest(messages: [AIMessage], abortSignal: AIAbortSignal? = nil, headers additionalHeaders: [String : String] = [:]) -> LanguageModelRequest | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | reconnectToStream(_:) | func reconnectToStream(_ request: AIChatReconnectRequest) async throws -> AsyncThrowingStream<AIUIMessage, any Error>? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | reconnectToStream(_:) | func reconnectToStream(_ request: AIChatReconnectRequest) async throws -> AsyncThrowingStream<AIUIMessage, any Error>? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | reconnectToStream(_:) | func reconnectToStream(_ request: AIChatReconnectRequest) async throws -> AsyncThrowingStream<AIUIMessage, any Error>? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | regenerate(messageID:options:) | @discardableResult @MainActor func regenerate(messageID: String? = nil, options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) -> Task<Void, Never> | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | resumeStream(options:) | @discardableResult @MainActor func resumeStream(options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) -> Task<Void, Never> | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | sendMessage(_:id:metadata:replacingMessageID:options:) | @discardableResult @MainActor func sendMessage(_ text: String, id: String? = nil, metadata: [String : JSONValue] = [:], replacingMessageID: String? = nil, options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) -> Task<Void, Never> | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | sendMessage(_:replacingMessageID:options:) | @discardableResult @MainActor func sendMessage(_ message: AIUIMessage, replacingMessageID: String? = nil, options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) -> Task<Void, Never> | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | sendMessage(options:) | @discardableResult @MainActor func sendMessage(options: AIChatSessionRequestOptions = AIChatSessionRequestOptions()) -> Task<Void, Never> | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | sendMessages(_:) | func sendMessages(_ request: AIChatTransportRequest) throws -> AsyncThrowingStream<AIUIMessage, any Error> | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | sendMessages(_:) | func sendMessages(_ request: AIChatTransportRequest) throws -> AsyncThrowingStream<AIUIMessage, any Error> | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Method | setMessages(_:) | @MainActor func setMessages(_ messages: [AIUIMessage]) | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Method | stop(reason:) | @MainActor func stop(reason: String? = "stopped") | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | abortSignal | var abortSignal: AIAbortSignal? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | abortSignal | var abortSignal: AIAbortSignal? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | body | var body: [String : JSONValue] | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | body | var body: [String : JSONValue] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | body | var body: [String : JSONValue] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | chatID | @MainActor let chatID: String | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | chatID | var chatID: String | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | chatID | var chatID: String | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | description | var description: String { get } | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Instance Property | error | @Published @MainActor var error: (any Error)? { get set } | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | executableTools | var executableTools: [AITool] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | extraBody | var extraBody: [String : JSONValue] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | finishReason | var finishReason: String? | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | frequencyPenalty | var frequencyPenalty: Double? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | generateMessageID | @MainActor var generateMessageID: @Sendable () -> String | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | generateMessageID | var generateMessageID: @Sendable () -> String | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | headers | var headers: [String : String] | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | headers | var headers: [String : String] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | headers | var headers: [String : String] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | headers | var headers: [String : String] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | includeRawChunks | var includeRawChunks: Bool | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | isAbort | var isAbort: Bool | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | isDisconnect | var isDisconnect: Bool | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | isError | var isError: Bool | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | isRunning | @MainActor var isRunning: Bool { get } | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | issues | var issues: [AIUIMessageValidationIssue] | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Instance Property | isValid | var isValid: Bool { get } | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Instance Property | maxOutputTokens | var maxOutputTokens: Int? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | maxSteps | var maxSteps: Int | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | message | var message: AIUIMessage? | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | message | var message: AIUIMessage { get } | Sources/SwiftAISDK/AIUIMessageStreamReducer.swift |
| Instance Property | message | var message: String | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Instance Property | messageID | var messageID: String? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | messages | var messages: [AIUIMessage] | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | messages | @Published @MainActor var messages: [AIUIMessage] { get set } | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | messages | var messages: [AIUIMessage] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | messages | var messages: [AIUIMessage] | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Instance Property | metadata | var metadata: JSONValue? | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | metadata | var metadata: JSONValue? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | metadata | var metadata: JSONValue? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | model | var model: any LanguageModel | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | onError | @MainActor var onError: (@MainActor @Sendable (any Error) -> Void)? | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | onFinish | @MainActor var onFinish: (@MainActor @Sendable (AIChatSessionFinishEvent) -> Void)? | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | path | var path: String | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Instance Property | prepareStep | var prepareStep: AIPrepareStep? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | presencePenalty | var presencePenalty: Double? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | providerOptions | var providerOptions: [String : JSONValue] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | reasoning | var reasoning: String? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | requestOptions | var requestOptions: AIChatRequestOptions | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | responseFormat | var responseFormat: AIResponseFormat? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | responseMessageID | var responseMessageID: String? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | retryPolicy | var retryPolicy: AIRetryPolicy | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | seed | var seed: Int? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | sendAutomaticallyWhen | @MainActor var sendAutomaticallyWhen: (@MainActor @Sendable ([AIUIMessage]) -> Bool)? | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | sendFinish | var sendFinish: Bool | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | sendReasoning | var sendReasoning: Bool | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | sendSources | var sendSources: Bool | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | status | @Published @MainActor var status: AIChatSessionStatus { get set } | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | stopSequences | var stopSequences: [String] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | stopWhen | var stopWhen: [AIStopCondition] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | telemetry | var telemetry: Telemetry.Options? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | temperature | var temperature: Double? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | timeoutNanoseconds | var timeoutNanoseconds: UInt64? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | toolApproval | var toolApproval: AIToolApproval? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | toolChoice | var toolChoice: JSONValue? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | toolContexts | var toolContexts: [String : JSONValue] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | tools | var tools: [String : JSONValue] | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | topK | var topK: Int? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | topP | var topP: Double? | Sources/SwiftAISDK/AIChatTransport.swift |
| Instance Property | transport | @MainActor var transport: any AIChatTransport | Sources/SwiftAISDK/AIChatSession.swift |
| Instance Property | trigger | var trigger: AIChatTransportTrigger | Sources/SwiftAISDK/AIChatTransport.swift |
| Protocol | AIChatTransport | protocol AIChatTransport : Sendable | Sources/SwiftAISDK/AIChatTransport.swift |
| Structure | AIChatReconnectRequest | struct AIChatReconnectRequest | Sources/SwiftAISDK/AIChatTransport.swift |
| Structure | AIChatRequestOptions | struct AIChatRequestOptions | Sources/SwiftAISDK/AIChatTransport.swift |
| Structure | AIChatSessionFinishEvent | struct AIChatSessionFinishEvent | Sources/SwiftAISDK/AIChatSession.swift |
| Structure | AIChatSessionRequestOptions | struct AIChatSessionRequestOptions | Sources/SwiftAISDK/AIChatSession.swift |
| Structure | AIChatTransportRequest | struct AIChatTransportRequest | Sources/SwiftAISDK/AIChatTransport.swift |
| Structure | AIUIMessageStreamReducer | struct AIUIMessageStreamReducer | Sources/SwiftAISDK/AIUIMessageStreamReducer.swift |
| Structure | AIUIMessageValidationIssue | struct AIUIMessageValidationIssue | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Structure | AIUIMessageValidationResult | struct AIUIMessageValidationResult | Sources/SwiftAISDK/AIUIMessageValidation.swift |
| Structure | DirectAIChatTransport | struct DirectAIChatTransport | Sources/SwiftAISDK/AIChatTransport.swift |
| Type Method | snapshots(from:messageID:terminateOnError:) | static func snapshots(from stream: AsyncThrowingStream<LanguageStreamPart, any Error>, messageID: String = UUID().uuidString, terminateOnError: Bool = false) -> AsyncThrowingStream<AIUIMessage, any Error> | Sources/SwiftAISDK/AIUIMessageStreamReducer.swift |