@@ -2,14 +2,11 @@ import AppKit
22import Foundation
33
44enum Debugger {
5- #if DEBUG
65 @TaskLocal
76 static var id : UUID ?
8- #endif
97
8+ #if DEBUG
109 static func didSendRequestBody( body: CompletionRequestBody ) {
11- #if DEBUG
12-
1310 do {
1411 let json = try JSONEncoder ( ) . encode ( body)
1512 let center = NSWorkspace . shared. notificationCenter
@@ -24,13 +21,9 @@ enum Debugger {
2421 } catch {
2522 print ( " Failed to encode request body: \( error) " )
2623 }
27-
28- #endif
2924 }
3025
3126 static func didReceiveFunction( name: String , arguments: String ) {
32- #if DEBUG
33-
3427 let center = NSWorkspace . shared. notificationCenter
3528 center. post (
3629 name: . init( " ServiceDebugger.ChatRequestDebug.receivedFunctionCall " ) ,
@@ -41,13 +34,9 @@ enum Debugger {
4134 " arguments " : arguments,
4235 ]
4336 )
44-
45- #endif
4637 }
4738
4839 static func didReceiveFunctionResult( result: String ) {
49- #if DEBUG
50-
5140 let center = NSWorkspace . shared. notificationCenter
5241 center. post (
5342 name: . init( " ServiceDebugger.ChatRequestDebug.receivedFunctionResult " ) ,
@@ -57,13 +46,9 @@ enum Debugger {
5746 " result " : result,
5847 ]
5948 )
60-
61- #endif
6249 }
6350
6451 static func didReceiveResponse( content: String ) {
65- #if DEBUG
66-
6752 let center = NSWorkspace . shared. notificationCenter
6853 center. post (
6954 name: . init( " ServiceDebugger.ChatRequestDebug.responseReceived " ) ,
@@ -73,8 +58,6 @@ enum Debugger {
7358 " response " : content,
7459 ]
7560 )
76-
77- #endif
7861 }
7962
8063 static func didFinish( ) {
@@ -87,5 +70,6 @@ enum Debugger {
8770 ]
8871 )
8972 }
73+ #endif
9074}
9175
0 commit comments