Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6217946
Intial commit
johnyrahul Apr 3, 2024
756137a
Updated the admin page
johnyrahul Apr 9, 2024
cf4e3ae
Fritcionless onbaodring changes
johnyrahul Apr 17, 2024
8dc9306
Merge branch 'main' into feat/friction_less_onboarding
johnyrahul Apr 18, 2024
0b7f6aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 18, 2024
c76a7ee
Updated the authenication helper
johnyrahul Apr 19, 2024
998f6a6
Merge branch 'main' into feat/friction_less_onboarding
johnyrahul Apr 19, 2024
e9ea57f
Historical model fix in migration
johnyrahul Apr 19, 2024
9ee64b0
added adapter identfiers
johnyrahul Apr 19, 2024
4bf71ad
Merge branch 'main' into feat/friction_less_onboarding
Deepak-Kesavan Apr 21, 2024
c151be8
Made token_usage table tenant specific
Deepak-Kesavan Apr 22, 2024
201c518
Updated the migrations
johnyrahul Apr 23, 2024
dfeade0
Validating adapter state in prompt and workflow run
johnyrahul Apr 23, 2024
64c4c06
Validating adapter state in prompt and workflow run
johnyrahul Apr 23, 2024
65a3cd8
Added method for usage in pusbsub helper
johnyrahul Apr 23, 2024
0df2a34
Removed organization_id field from token_usage table
Deepak-Kesavan Apr 24, 2024
00ecc16
Made admin page as plugin
Deepak-Kesavan Apr 24, 2024
2282a5e
usage table changes
Deepak-Kesavan Apr 24, 2024
7f9e368
Pass adapter_instance_id to run_completion function
Deepak-Kesavan Apr 24, 2024
b5629ea
Updated field model_type -> model_name
Deepak-Kesavan Apr 24, 2024
9ccbda2
Merge branch 'main' into feat/friction_less_onboarding
johnyrahul Apr 24, 2024
19e1154
added description for adapters
johnyrahul Apr 24, 2024
b91f791
Added the error messages
johnyrahul Apr 24, 2024
5be3a17
Updated serilizer to display description
johnyrahul Apr 24, 2024
b9b5db8
Updated organziation with token limit
johnyrahul Apr 25, 2024
50a76a3
Support description for adapters
Deepak-Kesavan Apr 25, 2024
2bc37c8
Save total token usage
Deepak-Kesavan Apr 25, 2024
d4c3578
Merge branch 'main' into feat/friction_less_onboarding
johnyrahul Apr 25, 2024
5497982
resolved conflict
johnyrahul Apr 25, 2024
d6bf555
Implemented the SocketMessages component globally
tahierhussain Apr 25, 2024
f04e632
Minor fix
Deepak-Kesavan Apr 25, 2024
8615e6f
Merge remote-tracking branch 'origin/feat/friction_less_onboarding' i…
Deepak-Kesavan Apr 25, 2024
c796aa0
Merge remote-tracking branch 'origin/global-websocket-component' into…
Deepak-Kesavan Apr 25, 2024
aad8318
Merge branch 'main' into feat/friction_less_onboarding
johnyrahul Apr 26, 2024
25fa9e2
Rverted the git ignore
johnyrahul Apr 26, 2024
d2b22e9
Reverted the git ignore
johnyrahul Apr 26, 2024
2a86ee8
Correct the error message
johnyrahul Apr 26, 2024
107cf7f
Make token usage 0 if negative
Deepak-Kesavan Apr 26, 2024
3f79e26
Merge remote-tracking branch 'origin/feat/friction_less_onboarding' i…
Deepak-Kesavan Apr 26, 2024
ff8f03a
SDk version bump
johnyrahul Apr 26, 2024
97e9f63
Review comment fixes
Deepak-Kesavan Apr 26, 2024
3af46f9
Merge branch 'main' into feat/friction_less_onboarding
Deepak-Kesavan Apr 26, 2024
13b9fb5
Merge branch 'main' into feat/friction_less_onboarding
nehabagdia Apr 27, 2024
5dffc24
Update backend/adapter_processor/models.py
johnyrahul Apr 29, 2024
40f5ce2
Addressed the review comments
johnyrahul Apr 29, 2024
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
Prev Previous commit
Next Next commit
Save total token usage
  • Loading branch information
Deepak-Kesavan committed Apr 25, 2024
commit 2bc37c8d1b77a68c7c72702a2c425127b846d4d1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useAlertStore } from "../../../store/alert-store";
import { useSocketLogsStore } from "../../../store/socket-logs-store";
import { useSocketMessagesStore } from "../../../store/socket-messages-store";
import { useSocketCustomToolStore } from "../../../store/socket-custom-tool";
import { useUsageStore } from "../../../store/usage-store";
function SocketMessages({ logId }) {
const {
pushStagedMessage,
Expand All @@ -20,6 +21,7 @@ function SocketMessages({ logId }) {
const socket = useContext(SocketContext);
const { setAlertDetails } = useAlertStore();
const handleException = useExceptionHandler();
const { setLLMTokenUsage } = useUsageStore();

const onMessage = (data) => {
try {
Expand All @@ -37,6 +39,9 @@ function SocketMessages({ logId }) {
if (msg?.type === "LOG" && msg?.service === "prompt") {
updateCusToolMessages(msg);
}
if (msg?.type === "LOG" && msg?.service === "usage") {
setLLMTokenUsage(msg?.added_token_count);
}
} catch (err) {
setAlertDetails(handleException(err, "Failed to process socket message"));
}
Expand Down
53 changes: 32 additions & 21 deletions frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { Alert, Button, Col, Dropdown, Image, Row, Typography } from "antd";
import {
Alert,
Button,
Col,
Dropdown,
Image,
Row,
Space,
Typography,
} from "antd";
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import axios from "axios";
Expand Down Expand Up @@ -163,26 +172,28 @@ function TopNavBar() {
</Col>
<Col span={4}>
<Row justify="end" align="middle">
{TrialDaysInfo && (
<TrialDaysInfo remainingTrialDays={remainingTrialDays} />
)}
<Dropdown menu={{ items }} placement="bottomLeft" arrow>
<div className="top-navbar-dp">
{sessionDetails?.picture ? (
<Image
className="navbar-img"
height="100%"
width="100%"
preview={false}
src={sessionDetails?.picture}
/>
) : (
<Typography.Text className="initials">
{getInitials(sessionDetails?.name)}
</Typography.Text>
)}
</div>
</Dropdown>
<Space>
{TrialDaysInfo && (
<TrialDaysInfo remainingTrialDays={remainingTrialDays} />
)}
<Dropdown menu={{ items }} placement="bottomLeft" arrow>
<div className="top-navbar-dp">
{sessionDetails?.picture ? (
<Image
className="navbar-img"
height="100%"
width="100%"
preview={false}
src={sessionDetails?.picture}
/>
) : (
<Typography.Text className="initials">
{getInitials(sessionDetails?.name)}
</Typography.Text>
)}
</div>
</Dropdown>
</Space>
</Row>
</Col>
</Row>
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/store/usage-store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { create } from "zustand";

const useUsageStore = create((setState) => ({
llmTokenUsage: null,
setLLMTokenUsage: (data) => {
setState({ llmTokenUsage: data });
},
}));

export { useUsageStore };