This commit is contained in:
2026-06-22 16:18:13 +02:00
parent b7559d7fb6
commit 2d95d0c6aa
3 changed files with 15 additions and 13 deletions
+4 -4
View File
@@ -100,10 +100,10 @@ impl DataSource for MBQuery {
}
};
let (track, mut new_artifacts) = Self::extract_recording_data(track);
let (track, new_artifacts) = Self::extract_recording_data(track);
ret.push(track.clone());
ret.append(&mut new_artifacts);
ret.extend(new_artifacts);
artifact.merge(track);
}
@@ -125,10 +125,10 @@ impl DataSource for MBQuery {
}
};
let (track, mut new_artifacts) = Self::extract_recording_data(track);
let (track, new_artifacts) = Self::extract_recording_data(track);
ret.push(track);
ret.append(&mut new_artifacts);
ret.extend(new_artifacts);
Ok(ret)
}
+3 -3
View File
@@ -53,7 +53,7 @@ impl Character {
self.header_message.clone(),
context
];
full_conversation.append(&mut self.messages.clone());
full_conversation.extend(self.messages.iter().cloned());
let tools = toolbox.tools();
log::debug!("Sending request..");
@@ -128,7 +128,7 @@ impl Character {
}
let mut tool_messages = vec![];
for (id, mut result) in results {
for (id, result) in results {
let mut msg = ChatCompletionRequestToolMessageArgs::default();
msg.tool_call_id(id);
if let Some(output) = result.result {
@@ -136,7 +136,7 @@ impl Character {
msg.content(output);
}
self.insert(ChatCompletionRequestMessage::Tool(msg.build().unwrap()));
tool_messages.append(&mut result.messages);
tool_messages.extend(result.messages);
}
// OpenAI requires we put all the tool call results before any other message, so we append them manually down here
for message in tool_messages {
+8 -6
View File
@@ -46,16 +46,18 @@ impl StatefulWidget for Options<'_> {
if let Some(direction) = &option.stage_direction {
let padded = format!("({})", direction);
let mut wrapped_direction: Vec<Line> = textwrap::wrap(&padded, wrap_options.clone())
let wrapped = textwrap::wrap(&padded, wrap_options.clone());
let wrapped_direction = wrapped
.iter()
.map(|x| { Line::from(x.to_string()).fg(style::Color::Yellow)}).collect();
contents.append(&mut wrapped_direction);
.map(|x| { Line::from(x.to_string()).fg(style::Color::Yellow)});
contents.extend(wrapped_direction);
}
let mut text: Vec<Line> = textwrap::wrap(&option.text, wrap_options.clone())
let wrapped = textwrap::wrap(&option.text, wrap_options.clone());
let text = wrapped
.iter()
.map(|x| { Line::from(x.to_string())}).collect();
contents.append(&mut text);
.map(|x| { Line::from(x.to_string())});
contents.extend(text);
Text::from_iter(contents)
}).collect();
let list = List::new(options)