chore: add debug log for /chat interface

release-0.2
Meng Zhang 2023-10-03 11:38:58 -07:00
parent 692c2fe0fd
commit 7fc76228f7
1 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@ use axum_streams::StreamBodyAs;
use prompt::ChatPromptBuilder;
use serde::{Deserialize, Serialize};
use tabby_inference::{TextGeneration, TextGenerationOptions, TextGenerationOptionsBuilder};
use tracing::instrument;
use tracing::{debug, instrument};
use utoipa::ToSchema;
pub struct ChatState {
@ -69,6 +69,7 @@ pub async fn completions(
Json(request): Json<ChatCompletionRequest>,
) -> Response {
let (prompt, options) = parse_request(&state, request);
debug!("PROMPT: {}", prompt);
let s = stream! {
for await content in state.engine.generate_stream(&prompt, options).await {
yield ChatCompletionChunk { content }