Bug gixes, features added, GUI updates and more
This commit is contained in:
@@ -84,19 +84,38 @@ struct MessageRow: View {
|
||||
.padding(.top, 4)
|
||||
}
|
||||
|
||||
// Token/cost info
|
||||
if let tokens = message.tokens, let cost = message.cost {
|
||||
// Token/cost/time info
|
||||
if message.role == .assistant && (message.tokens != nil || message.cost != nil || message.responseTime != nil || message.wasInterrupted) {
|
||||
HStack(spacing: 8) {
|
||||
Label("\(tokens)", systemImage: "chart.bar.xaxis")
|
||||
Text("\u{2022}")
|
||||
Text(String(format: "$%.4f", cost))
|
||||
if let tokens = message.tokens {
|
||||
Label("\(tokens)", systemImage: "chart.bar.xaxis")
|
||||
if message.cost != nil || message.responseTime != nil || message.wasInterrupted {
|
||||
Text("\u{2022}")
|
||||
}
|
||||
}
|
||||
if let cost = message.cost {
|
||||
Text(String(format: "$%.4f", cost))
|
||||
if message.responseTime != nil || message.wasInterrupted {
|
||||
Text("\u{2022}")
|
||||
}
|
||||
}
|
||||
if let responseTime = message.responseTime {
|
||||
Text(String(format: "%.1fs", responseTime))
|
||||
if message.wasInterrupted {
|
||||
Text("\u{2022}")
|
||||
}
|
||||
}
|
||||
if message.wasInterrupted {
|
||||
Text("⚠️ interrupted")
|
||||
.foregroundColor(.orange)
|
||||
}
|
||||
}
|
||||
.font(.caption2)
|
||||
.foregroundColor(.oaiSecondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(12)
|
||||
.padding(16)
|
||||
.background(Color.messageBackground(for: message.role))
|
||||
.cornerRadius(8)
|
||||
.overlay(
|
||||
|
||||
Reference in New Issue
Block a user