Skip to content

Commit af8ba41

Browse files
committed
Add toggle for supportsMultipartMessageContent
1 parent dcb6300 commit af8ba41

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Core/Sources/HostApp/AccountSettings/ChatModelManagement/ChatModelEdit.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct ChatModelEdit {
3232
var openAIOrganizationID: String = ""
3333
var openAIProjectID: String = ""
3434
var customHeaders: [ChatModel.Info.CustomHeaderInfo.HeaderField] = []
35+
var openAICompatibleSupportsMultipartMessageContent = true
3536
}
3637

3738
enum Action: Equatable, BindableAction {
@@ -206,7 +207,11 @@ extension ChatModel {
206207
),
207208
ollamaInfo: .init(keepAlive: state.ollamaKeepAlive),
208209
googleGenerativeAIInfo: .init(apiVersion: state.apiVersion),
209-
openAICompatibleInfo: .init(enforceMessageOrder: state.enforceMessageOrder),
210+
openAICompatibleInfo: .init(
211+
enforceMessageOrder: state.enforceMessageOrder,
212+
supportsMultipartMessageContent: state
213+
.openAICompatibleSupportsMultipartMessageContent
214+
),
210215
customHeaderInfo: .init(headers: state.customHeaders)
211216
)
212217
)
@@ -230,7 +235,9 @@ extension ChatModel {
230235
enforceMessageOrder: info.openAICompatibleInfo.enforceMessageOrder,
231236
openAIOrganizationID: info.openAIInfo.organizationID,
232237
openAIProjectID: info.openAIInfo.projectID,
233-
customHeaders: info.customHeaderInfo.headers
238+
customHeaders: info.customHeaderInfo.headers,
239+
openAICompatibleSupportsMultipartMessageContent: info.openAICompatibleInfo
240+
.supportsMultipartMessageContent
234241
)
235242
}
236243
}

Core/Sources/HostApp/AccountSettings/ChatModelManagement/ChatModelEditView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ struct ChatModelEditView: View {
322322
Text("Enforce message order to be user/assistant alternated")
323323
}
324324

325+
Toggle(isOn: $store.openAICompatibleSupportsMultipartMessageContent) {
326+
Text("Support multi-part message content")
327+
}
328+
325329
Button("Custom Headers") {
326330
isEditingCustomHeader.toggle()
327331
}

0 commit comments

Comments
 (0)