assistant2: Only add context if it is non-empty (#22141)
This PR fixes an issue where we were attaching empty message content even if there was no context. Release Notes: - N/A
This commit is contained in:
parent
a6b717b97b
commit
6fa5a17586
1 changed files with 3 additions and 1 deletions
|
@ -73,5 +73,7 @@ pub fn attach_context_to_message(
|
||||||
context_text.push_str(&thread_context);
|
context_text.push_str(&thread_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
message.content.push(MessageContent::Text(context_text));
|
if !context_text.is_empty() {
|
||||||
|
message.content.push(MessageContent::Text(context_text));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue