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.push(track.clone());
ret.append(&mut new_artifacts); ret.extend(new_artifacts);
artifact.merge(track); 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.push(track);
ret.append(&mut new_artifacts); ret.extend(new_artifacts);
Ok(ret) Ok(ret)
} }
+3 -3
View File
@@ -53,7 +53,7 @@ impl Character {
self.header_message.clone(), self.header_message.clone(),
context context
]; ];
full_conversation.append(&mut self.messages.clone()); full_conversation.extend(self.messages.iter().cloned());
let tools = toolbox.tools(); let tools = toolbox.tools();
log::debug!("Sending request.."); log::debug!("Sending request..");
@@ -128,7 +128,7 @@ impl Character {
} }
let mut tool_messages = vec![]; let mut tool_messages = vec![];
for (id, mut result) in results { for (id, result) in results {
let mut msg = ChatCompletionRequestToolMessageArgs::default(); let mut msg = ChatCompletionRequestToolMessageArgs::default();
msg.tool_call_id(id); msg.tool_call_id(id);
if let Some(output) = result.result { if let Some(output) = result.result {
@@ -136,7 +136,7 @@ impl Character {
msg.content(output); msg.content(output);
} }
self.insert(ChatCompletionRequestMessage::Tool(msg.build().unwrap())); 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 // 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 { for message in tool_messages {
+8 -6
View File
@@ -46,16 +46,18 @@ impl StatefulWidget for Options<'_> {
if let Some(direction) = &option.stage_direction { if let Some(direction) = &option.stage_direction {
let padded = format!("({})", 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() .iter()
.map(|x| { Line::from(x.to_string()).fg(style::Color::Yellow)}).collect(); .map(|x| { Line::from(x.to_string()).fg(style::Color::Yellow)});
contents.append(&mut wrapped_direction); 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() .iter()
.map(|x| { Line::from(x.to_string())}).collect(); .map(|x| { Line::from(x.to_string())});
contents.append(&mut text); contents.extend(text);
Text::from_iter(contents) Text::from_iter(contents)
}).collect(); }).collect();
let list = List::new(options) let list = List::new(options)