Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: in progress : add Token Usage Statistics #887

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/commit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "commit": "f4554f5f5c30e7f79b002e67442e1b1fa277e76f" }
25 changes: 10 additions & 15 deletions app/components/chat/BaseChat.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* @ts-nocheck
* Preventing TS checks with files presented in the video for a better presentation.
*/
import type { Message } from 'ai';
import React, { type RefCallback, useEffect, useState } from 'react';
import { ClientOnly } from 'remix-utils/client-only';
Expand Down Expand Up @@ -33,12 +29,19 @@ import type { ActionAlert } from '~/types/actions';
import ChatAlert from './ChatAlert';
import type { ModelInfo } from '~/lib/modules/llm/types';

declare global {
interface Window {
SpeechRecognition: typeof SpeechRecognition;
webkitSpeechRecognition: typeof SpeechRecognition;
}
}

const TEXTAREA_MIN_HEIGHT = 76;

interface BaseChatProps {
textareaRef?: React.RefObject<HTMLTextAreaElement> | undefined;
messageRef?: RefCallback<HTMLDivElement> | undefined;
scrollRef?: RefCallback<HTMLDivElement> | undefined;
textareaRef?: React.RefObject<HTMLTextAreaElement>;
messageRef?: RefCallback<HTMLDivElement>;
scrollRef?: RefCallback<HTMLDivElement>;
showChat?: boolean;
chatStarted?: boolean;
isStreaming?: boolean;
Expand Down Expand Up @@ -83,8 +86,6 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
input = '',
enhancingPrompt,
handleInputChange,

// promptEnhanced,
enhancePrompt,
sendMessage,
handleStop,
Expand Down Expand Up @@ -340,12 +341,6 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
<div
className={classNames(
'bg-bolt-elements-background-depth-2 p-3 rounded-lg border border-bolt-elements-borderColor relative w-full max-w-chat mx-auto z-prompt',

/*
* {
* 'sticky bottom-2': chatStarted,
* },
*/
)}
>
<svg className={classNames(styles.PromptEffectContainer)}>
Expand Down
Loading
Loading