-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
53b2ada
to
1a9beb2
Compare
@@ -254,6 +255,7 @@ struct DeckDetailStackCursor: CursorProtocol { | |||
// MARK: Model | |||
struct DeckModel: ModelProtocol { | |||
public static let backlinksToDraw = 1 | |||
public static let maxRewardCardBufferSize = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3, 4 and 5 all feel good in different ways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Two requests for followup, but in another PR.
import Foundation | ||
import KeychainSwift | ||
|
||
actor KeychainService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
public let instruction: String | ||
} | ||
|
||
actor OpenAIService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A followup I'd like us to do:
- I'd like to think about how to "protocolize" this API surface to avoid getting two entangled with the specifics of one model.
- The chat API is a natural fit here. Most of the API vendors have converged on something nearly exactly the same shape as OpenAI's chat API.
- The service should probably talk back and forth in a
Codable
AIChat
type that can be serialized/deserialized to JSON. Similar shape to the chat API request/response, with an array of messages withsystem
,assistant
, anduser
roles, but free of model specifics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more consideration. Let's think about how this might route through our PromptService
. In principle, I like the idea of routing everything through it as a dispatcher.
I introduced a dependency on a keychain interfacing library, I was tempted to avoid it but the direct interface to keychain immediately made me understand why everyone is using a library.
AI features can be enabled from the Developer Settings menu:
Screen.Recording.2024-03-19.at.3.58.54.pm.mov