MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / make_metadata

Method make_metadata

crates/chat-cli/src/cli/chat/parser.rs:642–663  ·  view source on GitHub ↗
(&self, chat_conversation_type: Option<ChatConversationType>)

Source from the content-addressed store, hash-verified

640 }
641
642 fn make_metadata(&self, chat_conversation_type: Option<ChatConversationType>) -> RequestMetadata {
643 RequestMetadata {
644 request_id: self.response.request_id().map(String::from),
645 message_id: self.message_id.clone(),
646 time_to_first_chunk: self.time_to_first_chunk,
647 time_between_chunks: self.time_between_chunks.clone(),
648 response_size: self.received_response_size,
649 chat_conversation_type,
650 request_start_timestamp_ms: system_time_to_unix_ms(self.request_start_time_sys),
651 // We always end the stream when this method is called, so just set the end timestamp
652 // here.
653 stream_end_timestamp_ms: system_time_to_unix_ms(SystemTime::now()),
654 user_prompt_length: self.user_prompt_length,
655 message_meta_tags: self.message_meta_tags.clone(),
656 tool_use_ids_and_names: self
657 .tool_uses
658 .iter()
659 .map(|t| (t.id.clone(), t.name.clone()))
660 .collect::<_>(),
661 model_id: self.model_id.clone(),
662 }
663 }
664}
665
666#[derive(Debug)]

Callers 2

recvMethod · 0.45
errorMethod · 0.45

Calls 4

system_time_to_unix_msFunction · 0.85
mapMethod · 0.80
request_idMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected