Improve Gradio UI and fix arch_state bug (#227)

This commit is contained in:
Adil Hafeez 2024-10-29 11:27:13 -07:00 committed by GitHub
parent 662a840ac5
commit 60299244b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 209 additions and 262 deletions

View file

@ -900,7 +900,11 @@ impl StreamContext {
// don't send tools message and api response to chat gpt
for m in callout_context.request_body.messages.iter() {
if m.role == TOOL_ROLE || m.content.is_none() {
// don't send api response and tool calls to upstream LLMs
if m.role == TOOL_ROLE
|| m.content.is_none()
|| (m.tool_calls.is_some() && !m.tool_calls.as_ref().unwrap().is_empty())
{
continue;
}
messages.push(m.clone());