Skip to content

Commit

Permalink
Maintaining dev (#1244)
Browse files Browse the repository at this point in the history
Dev Fix
  • Loading branch information
jedan2506 authored Sep 15, 2023
1 parent edeaf46 commit c96ae0e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
9 changes: 2 additions & 7 deletions gui/pages/Content/Agents/ActivityFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ export default function ActivityFeed({selectedRunId, selectedView, setFetchedDat
const [scheduleTime, setScheduleTime] = useState(null);
const [isLoading, setIsLoading] = useState(true);
const [waitingPeriod, setWaitingPeriod] = useState(null);
const [waitingPeriodOver, setWaitingPeriodOver] = useState(null);
const [errorMsg, setErrorMsg] = useState('');

useEffect(() => {
const interval = window.setInterval(function () {
if (selectedRunStatus === "RUNNING") {
if (selectedRunStatus !== "ERROR_PAUSED") {
fetchFeeds();
}
}, 5000);
Expand Down Expand Up @@ -78,10 +77,6 @@ export default function ActivityFeed({selectedRunId, selectedView, setFetchedDat
EventBus.emit('reFetchAgents', {});
}, [runStatus])

useEffect(() => {
setWaitingPeriodOver(updateDateBasedOnValue(convertWaitingPeriod(waitingPeriod)))
}, [waitingPeriod]);

function fetchFeeds() {
if (selectedRunId !== null) {
setIsLoading(true);
Expand Down Expand Up @@ -157,7 +152,7 @@ export default function ActivityFeed({selectedRunId, selectedView, setFetchedDat
<div className="history_box padding_20 cursor_default bg_secondary">
<div style={{display: 'flex'}}>
<div className="fs_20 lh_24"></div>
<div className={styles.feed_title}>Waiting Block Initiated. The Agent will wait for {convertWaitingPeriod(waitingPeriod) || null} and continue on {waitingPeriodOver || 'soon'}</div>
<div className={styles.feed_title}>Waiting Block Initiated. The Agent will wait for {convertWaitingPeriod(waitingPeriod) || null}</div>
</div>
</div>}
{runStatus === 'RUNNING' &&
Expand Down
40 changes: 20 additions & 20 deletions gui/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,23 +523,23 @@ export const convertWaitingPeriod = (waitingPeriod) => {
return convertedValue + ' ' + unit;
}

export const updateDateBasedOnValue = (convertedValue, inputDate = new Date()) => {
const [value, unit] = convertedValue.split(' ');
const unitConversion = {
'seconds': 1000,
'minutes': 1000 * 60,
'hours': 1000 * 60 * 60,
'days': 1000 * 60 * 60 * 24,
'weeks': 1000 * 60 * 60 * 24 * 7
};

const updatedDate = new Date(inputDate.getTime() + parseInt(value, 10) * unitConversion[unit]);

return updatedDate.toLocaleString('en-US', {
day: 'numeric',
month: 'long',
year: 'numeric',
hour: 'numeric',
minute: 'numeric'
});
}
// export const updateDateBasedOnValue = (convertedValue, inputDate = new Date()) => {
// const [value, unit] = convertedValue.split(' ');
// const unitConversion = {
// 'seconds': 1000,
// 'minutes': 1000 * 60,
// 'hours': 1000 * 60 * 60,
// 'days': 1000 * 60 * 60 * 24,
// 'weeks': 1000 * 60 * 60 * 24 * 7
// };
//
// const updatedDate = new Date(inputDate.getTime() + parseInt(value, 10) * unitConversion[unit]);
//
// return updatedDate.toLocaleString('en-US', {
// day: 'numeric',
// month: 'long',
// year: 'numeric',
// hour: 'numeric',
// minute: 'numeric'
// });
// }
3 changes: 2 additions & 1 deletion superagi/agent/agent_iteration_step_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def execute_step(self):
print("Decoding JSON has failed")
tool_name = ''

CallLogHelper(session=self.session, organisation_id=organisation.id).create_call_log(execution.name,agent_config['agent_id'],total_tokens, tool_name,agent_config['model'])
CallLogHelper(session=self.session, organisation_id=organisation.id).create_call_log(execution.name,
agent_config['agent_id'], total_tokens, tool_name, agent_config['model'])

assistant_reply = response['content']
output_handler = get_output_handler(iteration_workflow_step.output_type,
Expand Down

0 comments on commit c96ae0e

Please sign in to comment.