Skip to content

Commit aa84de0

Browse files
authored
Short-Term fix for SendTelemetry API Validation errors (#2694)
1 parent 8aed0e4 commit aa84de0

File tree

1 file changed

+6
-1
lines changed
  • crates/chat-cli/src/telemetry

1 file changed

+6
-1
lines changed

crates/chat-cli/src/telemetry/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,17 @@ impl TelemetryClient {
572572
} = &event.ty
573573
{
574574
let user_context = self.user_context().unwrap();
575+
// Short-Term fix for Validation errors -
576+
// chatAddMessageEvent.timeBetweenChunks' : Member must have length less than or equal to 100
577+
let time_between_chunks_truncated = time_between_chunks_ms
578+
.as_ref()
579+
.map(|chunks| chunks.iter().take(100).cloned().collect());
575580

576581
let chat_add_message_event = match ChatAddMessageEvent::builder()
577582
.conversation_id(conversation_id)
578583
.message_id(message_id.clone().unwrap_or("not_set".to_string()))
579584
.set_time_to_first_chunk_milliseconds(*time_to_first_chunk_ms)
580-
.set_time_between_chunks(time_between_chunks_ms.clone())
585+
.set_time_between_chunks(time_between_chunks_truncated)
581586
.set_response_length(*assistant_response_length)
582587
.build()
583588
{

0 commit comments

Comments
 (0)