@@ -213,6 +213,7 @@ pub async fn chat_completions_handler(
213213 stack_small_id,
214214 estimated_output_tokens,
215215 price_per_one_million_tokens,
216+ user_id,
216217 user_address,
217218 num_input_tokens,
218219 payload_hash,
@@ -243,6 +244,7 @@ pub async fn chat_completions_handler(
243244 payload_hash,
244245 stack_small_id,
245246 price_per_one_million_tokens,
247+ user_id,
246248 user_address. clone ( ) ,
247249 is_stream,
248250 payload. clone ( ) ,
@@ -289,6 +291,7 @@ pub async fn chat_completions_handler(
289291 } else {
290292 update_fiat_amount (
291293 & state. state_manager_sender ,
294+ user_id,
292295 user_address,
293296 model. to_string ( ) ,
294297 num_input_tokens,
@@ -415,6 +418,7 @@ pub async fn confidential_chat_completions_handler(
415418 stack_small_id,
416419 num_input_tokens,
417420 estimated_output_tokens,
421+ user_id,
418422 user_address,
419423 price_per_one_million_tokens,
420424 payload_hash,
@@ -450,6 +454,7 @@ pub async fn confidential_chat_completions_handler(
450454 payload_hash,
451455 stack_small_id,
452456 price_per_one_million_tokens,
457+ user_id,
453458 user_address. clone ( ) ,
454459 is_stream,
455460 payload. clone ( ) ,
@@ -497,6 +502,7 @@ pub async fn confidential_chat_completions_handler(
497502 } else {
498503 update_fiat_amount (
499504 & state. state_manager_sender ,
505+ user_id,
500506 user_address,
501507 model. to_string ( ) ,
502508 num_input_tokens,
@@ -576,6 +582,7 @@ async fn handle_response(
576582 payload_hash : [ u8 ; PAYLOAD_HASH_SIZE ] ,
577583 stack_small_id : Option < i64 > ,
578584 price_per_one_million_tokens : i64 ,
585+ user_id : Option < i64 > ,
579586 user_address : String ,
580587 is_stream : bool ,
581588 payload : Value ,
@@ -601,6 +608,7 @@ async fn handle_response(
601608 num_input_tokens,
602609 estimated_output_tokens,
603610 price_per_one_million_tokens,
611+ user_id,
604612 user_address,
605613 payload_hash,
606614 streaming_encryption_metadata,
@@ -616,6 +624,7 @@ async fn handle_response(
616624 num_input_tokens,
617625 estimated_output_tokens,
618626 price_per_one_million_tokens,
627+ user_id,
619628 user_address,
620629 payload_hash,
621630 client_encryption_metadata,
@@ -694,6 +703,7 @@ async fn handle_non_streaming_response(
694703 num_input_tokens : i64 ,
695704 estimated_output_tokens : i64 ,
696705 price_per_one_million_compute_units : i64 ,
706+ user_id : Option < i64 > ,
697707 user_address : String ,
698708 payload_hash : [ u8 ; PAYLOAD_HASH_SIZE ] ,
699709 client_encryption_metadata : Option < EncryptionMetadata > ,
@@ -734,6 +744,7 @@ async fn handle_non_streaming_response(
734744 num_input_tokens,
735745 estimated_output_tokens,
736746 price_per_one_million_compute_units,
747+ user_id,
737748 user_address,
738749 input_tokens,
739750 output_tokens,
@@ -802,6 +813,7 @@ async fn handle_streaming_response(
802813 num_input_tokens : i64 ,
803814 estimated_output_tokens : i64 ,
804815 price_per_one_million_compute_units : i64 ,
816+ user_id : Option < i64 > ,
805817 user_address : String ,
806818 payload_hash : [ u8 ; 32 ] ,
807819 streaming_encryption_metadata : Option < StreamingEncryptionMetadata > ,
@@ -944,6 +956,7 @@ async fn handle_streaming_response(
944956 request_id,
945957 timer,
946958 price_per_one_million_compute_units,
959+ user_id,
947960 user_address,
948961 Arc :: clone ( & state. running_num_requests ) ,
949962 chat_completions_service_url,
@@ -1504,6 +1517,7 @@ pub mod utils {
15041517 estimated_input_tokens : i64 ,
15051518 estimated_output_tokens : i64 ,
15061519 price_per_one_million_tokens : i64 ,
1520+ user_id : Option < i64 > ,
15071521 user_address : String ,
15081522 input_tokens : i64 ,
15091523 output_tokens : i64 ,
@@ -1608,6 +1622,7 @@ pub mod utils {
16081622 } else {
16091623 update_fiat_amount (
16101624 & state. state_manager_sender ,
1625+ user_id,
16111626 user_address,
16121627 model. to_string ( ) ,
16131628 estimated_input_tokens,
0 commit comments