Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7fa80a3
Merge tag '0.25.0' into develop
intitni Oct 11, 2023
4dd4f2f
Add SuggestionServiceMiddleware
intitni Oct 15, 2023
e1a6722
Update
intitni Oct 15, 2023
5116c1d
Fix calling middleware creates infinite loop
intitni Oct 16, 2023
daab571
Merge branch 'feature/suggestion-cheatsheet-2' into develop
intitni Oct 16, 2023
b8ae34e
Support chat tab self-closing
intitni Oct 16, 2023
08b0d76
Add TerminalChatTab
intitni Oct 16, 2023
6cfab90
Update TerminalChatTab to support restoration
intitni Oct 16, 2023
c674551
Add icons to chat tab
intitni Oct 16, 2023
9c1a592
Update
intitni Oct 17, 2023
0e8cad3
Merge branch 'feature/terminal-tab' into develop
intitni Oct 17, 2023
f531278
Support ChatGPTService in debug window
intitni Oct 17, 2023
2ad4d33
Adjust system prompt
intitni Oct 18, 2023
6e1e387
Revert SwiftFocusCodeFinder behavior
intitni Oct 19, 2023
ec796af
Update
intitni Oct 19, 2023
4281a6a
Merge branch 'feature/adjust-symbol-detection-from-conversation' into…
intitni Oct 19, 2023
eec4881
Update
intitni Oct 20, 2023
8099410
Update
intitni Oct 20, 2023
0a28d58
Merge branch 'feature/retrieve-from-active-document-pre' into develop
intitni Oct 20, 2023
6f970de
Update getEditorContent to actively get the focused editor content wh…
intitni Oct 20, 2023
2d864ea
Update custom command template to support {{clipboard}}
intitni Oct 20, 2023
7701377
Update custom prompt to code to support templates
intitni Oct 20, 2023
f71eb47
Merge branch 'feature/custom-command-template-clipboard' into develop
intitni Oct 20, 2023
8dbb5eb
Add global hotkey to show/hide widget
intitni Oct 21, 2023
e77fd16
Allow making hotkey non-global
intitni Oct 21, 2023
9982ee3
Fix the timing of KeyboardShortcuts initialization
intitni Oct 21, 2023
88fc06b
Update README.md
intitni Oct 21, 2023
4983750
Fix that command+M is not hiding chat panel
intitni Oct 21, 2023
c2837ee
Update
intitni Oct 22, 2023
0b93f92
Move MessageScopeParser to ChatContextCollector
intitni Oct 22, 2023
27c9cdc
Fix that the host app is observing the global shortcut
intitni Oct 22, 2023
dd398b5
Fix archiving
intitni Oct 22, 2023
b72dcca
Update README.md
intitni Oct 22, 2023
2cbd4b6
Update
intitni Oct 22, 2023
48f92d5
Update
intitni Oct 22, 2023
d64c817
Bump version to 0.26.0
intitni Oct 22, 2023
f9d2241
Update appcast.xml
intitni Oct 22, 2023
cd41739
Merge branch 'release/0.26.0'
intitni Oct 22, 2023
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
Prev Previous commit
Next Next commit
Update
  • Loading branch information
intitni committed Oct 20, 2023
commit eec4881a7a4fc59b5e966632fce333ffbe190afa
4 changes: 4 additions & 0 deletions Tool/Sources/OpenAIService/ChatGPTService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ public class ChatGPTService: ChatGPTServiceType {
#endif
}

#if DEBUG
Debugger.didFinish()
#endif
continuation.finish()
} catch {
continuation.finish(throwing: error)
Expand Down Expand Up @@ -185,8 +187,10 @@ public class ChatGPTService: ChatGPTServiceType {
functionCall = nextMessage.functionCall
}

#if DEBUG
Debugger.didReceiveResponse(content: finalResult ?? "N/A")
Debugger.didFinish()
#endif

return finalResult
}
Expand Down
20 changes: 2 additions & 18 deletions Tool/Sources/OpenAIService/Debug/Debug.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import AppKit
import Foundation

enum Debugger {
#if DEBUG
@TaskLocal
static var id: UUID?
#endif

#if DEBUG
static func didSendRequestBody(body: CompletionRequestBody) {
#if DEBUG

do {
let json = try JSONEncoder().encode(body)
let center = NSWorkspace.shared.notificationCenter
Expand All @@ -24,13 +21,9 @@ enum Debugger {
} catch {
print("Failed to encode request body: \(error)")
}

#endif
}

static func didReceiveFunction(name: String, arguments: String) {
#if DEBUG

let center = NSWorkspace.shared.notificationCenter
center.post(
name: .init("ServiceDebugger.ChatRequestDebug.receivedFunctionCall"),
Expand All @@ -41,13 +34,9 @@ enum Debugger {
"arguments": arguments,
]
)

#endif
}

static func didReceiveFunctionResult(result: String) {
#if DEBUG

let center = NSWorkspace.shared.notificationCenter
center.post(
name: .init("ServiceDebugger.ChatRequestDebug.receivedFunctionResult"),
Expand All @@ -57,13 +46,9 @@ enum Debugger {
"result": result,
]
)

#endif
}

static func didReceiveResponse(content: String) {
#if DEBUG

let center = NSWorkspace.shared.notificationCenter
center.post(
name: .init("ServiceDebugger.ChatRequestDebug.responseReceived"),
Expand All @@ -73,8 +58,6 @@ enum Debugger {
"response": content,
]
)

#endif
}

static func didFinish() {
Expand All @@ -87,5 +70,6 @@ enum Debugger {
]
)
}
#endif
}