Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions Demo/DemoChat/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Demo/DemoChat/Sources/ResponsesStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ public final class ResponsesStore: ObservableObject {
case .mcpToolCall(_ /* let mcpCall */):
// MCP tool call in progress - no UI action needed
break
case .reasoning(let reasoningItem):
print("reasoning output item added, summary: \(reasoningItem.summary)")
default:
throw StoreError.unhandledOutputItem(outputItem)
}
Expand Down Expand Up @@ -693,6 +695,8 @@ public final class ResponsesStore: ObservableObject {
if let output = mcpCall.output {
print("Result: \(output)")
}
case .reasoning(let reasoningItem):
print("reasoning output item done, summary: \(reasoningItem.summary)")
default:
throw StoreError.unhandledOutputItem(outputItem)
}
Expand Down
31 changes: 31 additions & 0 deletions Sources/OpenAI/Private/ChatQuery+CustomStringConvertible.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// ChatQuery+CustomStringConvertible.swift
// OpenAI
//
// Created by Oleksii Nezhyborets on 19.11.2025.
//

import Foundation

extension ChatQuery: CustomStringConvertible, CustomDebugStringConvertible {

public var description: String { jsonDescription(prettyPrinted: true) }

public var debugDescription: String { jsonDescription(prettyPrinted: true) }

private func jsonDescription(prettyPrinted: Bool) -> String {
let encoder = JSONEncoder()
var formatting: JSONEncoder.OutputFormatting = [.sortedKeys]
if prettyPrinted {
formatting.insert(.prettyPrinted)
}
encoder.outputFormatting = formatting
guard
let data = try? encoder.encode(self),
let string = String(data: data, encoding: .utf8)
else {
return "ChatQuery(model: \(model), messages: \(messages.count))"
}
return string
}
}