del token exceed
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user