del token exceed

This commit is contained in:
2026-02-23 14:49:06 +01:00
parent dda0773ad1
commit 3757874f37
6 changed files with 4 additions and 16 deletions

View File

@@ -41,8 +41,7 @@ public class ChatEntryController {
eventPublisher.publishQuerySent(
chat.getIdOwner().toString(),
chatId.toString(),
0); // TODO: add tokensUsed when usage info is available from Groq response
chatId.toString());
return ResponseEntity.ok(entry);
}

View File

@@ -22,8 +22,6 @@ public class UserEvent {
private EventType type;
private String userId;
private String chatId;
private Integer tokensUsed;
private Integer documentsFound;
@Builder.Default
private Instant timestamp = Instant.now();

View File

@@ -6,7 +6,7 @@ public interface EventPublisher {
void publishChatDeleted(String userId, String chatId);
void publishQuerySent(String userId, String chatId, int tokensUsed);
void publishQuerySent(String userId, String chatId);
void publishUserCreated(String userId);
}

View File

@@ -38,12 +38,11 @@ public class EventPublisherImpl implements EventPublisher {
}
@Override
public void publishQuerySent(String userId, String chatId, int tokensUsed) {
public void publishQuerySent(String userId, String chatId) {
publish(UserEvent.builder()
.type(EventType.QUERY_SENT)
.userId(userId)
.chatId(chatId)
.tokensUsed(tokensUsed)
.build());
}