Skip to content

Commit

Permalink
fix: new init
Browse files Browse the repository at this point in the history
Signed-off-by: rawnly <[email protected]>
  • Loading branch information
rawnly committed Nov 19, 2023
1 parent fc91863 commit 723a688
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Sources/OpenAI/Public/Models/Chat/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,27 @@ public struct Message: Codable, Equatable {
self.init(role: role, content: stringOrCodable, name: name, functionCall: functionCall)
}

public init(role: Role, content: StringOrCodable<[ChatContent]>? = nil, name: String? = nil, functionCall: ChatFunctionCall? = nil) {
public init(role: Role, content: StringOrCodable<[ChatContent]>? = nil, name: String? = nil) {
self.role = role
self.content = content
self.name = name
self.functionCall = nil
self.toolCalls = []
}

public init(role: Role, content: StringOrCodable<[ChatContent]>? = nil, name: String? = nil, functionCall: ChatFunctionCall?) {
self.role = role
self.content = content
self.name = name
self.functionCall = functionCall
self.toolCalls = nil
self.toolCalls = []
}

public init(
role: Role,
content: StringOrCodable<[ChatContent]>? = nil,
name: String? = nil,
toolCalls: [ToolCall]? = nil
toolCalls: [ToolCall]?
) {
self.role = role
self.content = content
Expand Down

0 comments on commit 723a688

Please sign in to comment.