worlds simplest logging to see where things are blocked (#3888)
Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -437,8 +437,14 @@ impl Agent {
|
||||
};
|
||||
}
|
||||
|
||||
let sub_recipe_manager = self.sub_recipe_manager.lock().await;
|
||||
let result: ToolCallResult = if sub_recipe_manager.is_sub_recipe_tool(&tool_call.name) {
|
||||
debug!("WAITING_TOOL_START: {}", tool_call.name);
|
||||
let result: ToolCallResult = if self
|
||||
.sub_recipe_manager
|
||||
.lock()
|
||||
.await
|
||||
.is_sub_recipe_tool(&tool_call.name)
|
||||
{
|
||||
let sub_recipe_manager = self.sub_recipe_manager.lock().await;
|
||||
sub_recipe_manager
|
||||
.dispatch_sub_recipe_tool_call(
|
||||
&tool_call.name,
|
||||
@@ -616,6 +622,8 @@ impl Agent {
|
||||
})
|
||||
};
|
||||
|
||||
debug!("WAITING_TOOL_END: {}", tool_call.name);
|
||||
|
||||
(
|
||||
request_id,
|
||||
Ok(ToolCallResult {
|
||||
|
||||
@@ -4,6 +4,7 @@ use std::sync::Arc;
|
||||
|
||||
use async_stream::try_stream;
|
||||
use futures::stream::StreamExt;
|
||||
use tracing::debug;
|
||||
|
||||
use super::super::agents::Agent;
|
||||
use crate::conversation::message::{Message, MessageContent, ToolRequest};
|
||||
@@ -173,14 +174,18 @@ impl Agent {
|
||||
let provider = provider.clone();
|
||||
|
||||
let mut stream = if provider.supports_streaming() {
|
||||
provider
|
||||
debug!("WAITING_LLM_STREAM_START");
|
||||
let msg_stream = provider
|
||||
.stream(
|
||||
system_prompt.as_str(),
|
||||
messages_for_provider.messages(),
|
||||
&tools,
|
||||
)
|
||||
.await?
|
||||
.await?;
|
||||
debug!("WAITING_LLM_STREAM_END");
|
||||
msg_stream
|
||||
} else {
|
||||
debug!("WAITING_LLM_START");
|
||||
let (message, mut usage) = provider
|
||||
.complete(
|
||||
system_prompt.as_str(),
|
||||
@@ -188,6 +193,7 @@ impl Agent {
|
||||
&tools,
|
||||
)
|
||||
.await?;
|
||||
debug!("WAITING_LLM_END");
|
||||
|
||||
// Ensure we have token counts for non-streaming case
|
||||
usage
|
||||
|
||||
Reference in New Issue
Block a user