feat(app): a chat names its model (recorded, last reply's, or the agent default) and each reply shows the model that answered
This commit is contained in:
@@ -21,8 +21,13 @@ class ChatModelControl extends StatefulWidget {
|
||||
required this.sessionId,
|
||||
required this.session,
|
||||
this.onChanged,
|
||||
this.answeredBy = '',
|
||||
});
|
||||
|
||||
/// The model the latest reply recorded, shown when the session itself has
|
||||
/// no model on record.
|
||||
final String answeredBy;
|
||||
|
||||
final ApiGateway gateway;
|
||||
final String sessionId;
|
||||
|
||||
@@ -104,7 +109,12 @@ class _ChatModelControlState extends State<ChatModelControl> {
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino =
|
||||
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
||||
final label = chatModelLabel(_model, _selection);
|
||||
final backend = '${widget.session['backend'] ?? ''}'.trim();
|
||||
final label = _model.isNotEmpty
|
||||
? chatModelLabel(_model, _selection)
|
||||
: widget.answeredBy.isNotEmpty
|
||||
? widget.answeredBy
|
||||
: '${backend.isEmpty ? 'opencode' : backend} default';
|
||||
final content = Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
||||
@@ -683,6 +683,7 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
sessionId: widget.sessionId,
|
||||
session: session,
|
||||
onChanged: widget.onModelChanged,
|
||||
answeredBy: latestReplyModel(_controller.messages),
|
||||
),
|
||||
),
|
||||
ChatBarAction(
|
||||
|
||||
Reference in New Issue
Block a user