-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bcde83
commit bfd719a
Showing
9 changed files
with
278 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// ChatGPT+CoreDataClass.swift | ||
// OSXChatGPT | ||
// | ||
// Created by CoderChan on 2023/4/19. | ||
// | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
|
||
public class ChatGPT: NSManagedObject { | ||
var modelType: ChatGPTModel { | ||
get { | ||
return ChatGPTModel(rawValue: model) ?? .gpt432k0314 | ||
} | ||
set { | ||
model = newValue.rawValue | ||
} | ||
} | ||
var context: ChatGPTContext { | ||
get { | ||
return ChatGPTContext(rawValue: contextCount) ?? .context3 | ||
} | ||
set { | ||
contextCount = newValue.rawValue | ||
} | ||
} | ||
var temperatureValue: String { | ||
let formattedValue = String(format: "%.1f", temperature) | ||
return formattedValue | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
OSXChatGPT/OSXChatGPT/Models/ChatGPT+CoreDataProperties.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// ChatGPT+CoreDataProperties.swift | ||
// OSXChatGPT | ||
// | ||
// Created by CoderChan on 2023/4/19. | ||
// | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
|
||
extension ChatGPT { | ||
|
||
@nonobjc public class func fetchRequest() -> NSFetchRequest<ChatGPT> { | ||
return NSFetchRequest<ChatGPT>(entityName: "ChatGPT") | ||
} | ||
|
||
@NSManaged public var contextCount: Int16 | ||
@NSManaged public var model: Int16 | ||
@NSManaged public var temperature: Double | ||
@NSManaged public var id: UUID? | ||
|
||
} | ||
|
||
extension ChatGPT : Identifiable { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
OSXChatGPT/OSXChatGPT/OSXChatGPT.xcdatamodeld/OSXChatGPT.xcdatamodel/contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.