Skip to content

Commit

Permalink
Update package
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanot committed Jan 23, 2025
1 parent 44eedb2 commit 2b1f499
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension PromptLiteral {
var components: [_Degenerate.Component] = []

func append(_ component: _Degenerate.Component) throws {
if let last = components.last, component.payload.type == last.payload.type {
if let last = components.last, component.payload.type == last.payload.type, component.payload.type._isConcatenatable {
let merged = try last.appending(contentsOf: component)

components.mutableLast = merged
Expand Down Expand Up @@ -132,6 +132,19 @@ extension PromptLiteral._Degenerate.Component {
case image
case functionCall
case functionInvocation

var _isConcatenatable: Bool {
switch self {
case .string:
return true
case .image:
return false
case .functionCall:
return false
case .functionInvocation:
return false
}
}
}

public enum Payload {
Expand Down

0 comments on commit 2b1f499

Please sign in to comment.