Skip to content

Commit

Permalink
Add query logs (#1089)
Browse files Browse the repository at this point in the history
* add query logs

* lower log level
  • Loading branch information
ggordonhall authored Oct 26, 2023
1 parent 8c5d815 commit a8e84d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion server/bleep/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,14 @@ impl Agent {
.try_fold(
llm_gateway::api::FunctionCall::default(),
|acc, e| async move {
let e: FunctionCall = serde_json::from_str(&e)?;
let e: FunctionCall = serde_json::from_str(&e).map_err(|err| {
tracing::error!(
"Failed to deserialize to FunctionCall: {:?}. Error: {:?}",
e,
err
);
err
})?;
Ok(FunctionCall {
name: acc.name.or(e.name),
arguments: acc.arguments + &e.arguments,
Expand Down
2 changes: 1 addition & 1 deletion server/bleep/src/indexes/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ impl RepoFile {
let mut buffer = match self.buffer() {
Ok(b) => b,
Err(err) => {
error!(?err, "failed to open file buffer; skipping file");
warn!(?err, "failed to open file buffer; skipping file");
return None;
}
};
Expand Down
5 changes: 4 additions & 1 deletion server/bleep/src/webserver/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use axum::{
use futures::{future::Either, stream, StreamExt};
use reqwest::StatusCode;
use serde_json::json;
use tracing::{error, warn};
use tracing::{debug, error, info, warn};

use self::conversations::ConversationId;

Expand Down Expand Up @@ -91,6 +91,7 @@ pub(super) async fn answer(
Extension(app): Extension<Application>,
Extension(user): Extension<User>,
) -> super::Result<impl IntoResponse> {
info!(?params.q, "handling /answer query");
let query_id = uuid::Uuid::new_v4();

let conversation_id = ConversationId {
Expand Down Expand Up @@ -135,6 +136,8 @@ pub(super) async fn answer(
.clone()
.into_owned();

debug!(?query_target, "parsed query target");

let action = Action::Query(query_target);
exchanges.push(Exchange::new(query_id, query));

Expand Down

0 comments on commit a8e84d9

Please sign in to comment.