Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

support 'prompt_summary.json' AutoGPT log file

Vasek Mlejnsky3113f70bd1be
diff --git a/components/AgentLogFileContent.tsx b/components/AgentLogFileContent.tsx
index 20d5a248f..dc9fd377f 100644
--- a/components/AgentLogFileContent.tsx
+++ b/components/AgentLogFileContent.tsx
@@ -34,9 +34,13 @@ function AgentLogFileContent({
if (!logFile) return null
+ console.log('logFile', logFile)
+
return (
<div className="flex-1 flex space-x-2 items-start justify-start overflow-hidden">
- {logFile.filename.includes('full_message_history') || logFile.filename.includes('current_context') ? (
+ {logFile.filename.includes('full_message_history')
+ || logFile.filename.includes('current_context')
+ || logFile.filename.includes('prompt_summary') ? (
<Splitter
gutterClassName={clsx(
'bg-gray-900 hover:bg-[#6366F1] transition-all delay-75 duration-[400ms] px-0.5 rounded-sm group',
diff --git a/components/AgentLogFilesList.tsx b/components/AgentLogFilesList.tsx
index 3acf6b979..45e7e815e 100644
--- a/components/AgentLogFilesList.tsx
+++ b/components/AgentLogFilesList.tsx
@@ -161,7 +161,7 @@ function AgentLogFilesList({
}
return (
- <main className="overflow-hidden flex flex-col max-h-full flex-1">
+ <main className="overflow-hidden flex flex-col max-h-full flex-1 pb-6">
<input
type="file"
style={{ display: 'none' }}
diff --git a/pages/index.tsx b/pages/index.tsx
index 405bb8fb5..ab55df46f 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -26,24 +26,27 @@ function getLastTwoDirsAndFile(fullPath: string): string {
function formatLogFileContent(logFile: Omit<log_files, 'project_id' | 'type' | 'size' | 'last_modified' | 'deployment_id'>) {
const relativePath = getLastTwoDirsAndFile(logFile.relativePath)
- if (logFile.filename.includes('user_input')) {
+ // This parsing is very Ssecific to the AutoGPT format.
+ const filename = logFile.filename
+ if (filename.includes('user_input')) {
return {
...logFile,
relativePath,
content: logFile.content as string,
}
- }
- const parsedFileContent = JSON.parse(logFile.content)
-
- // Specific to AutoGPT
- if (logFile.filename.includes('next_action')) {
+ } else if (filename.includes('next_action')) {
+ const parsedFileContent = JSON.parse(logFile.content)
return {
...logFile,
relativePath,
content: parsedFileContent as AgentNextActionLog,
}
- }
- if (logFile.filename.includes('full_message_history') || logFile.filename.includes('current_context')) {
+ } else if (
+ filename.includes('full_message_history')
+ || filename.includes('current_context')
+ || filename.includes('prompt_summary')
+ ) {
+ const parsedFileContent = JSON.parse(logFile.content)
return {
...logFile,
relativePath,
@@ -51,7 +54,11 @@ function formatLogFileContent(logFile: Omit<log_files, 'project_id' | 'type' | '
logs: parsedFileContent as AgentPromptLogs,
},
}
+ } else {
+ console.error(`Unexpected log file: ${filename}`)
}
+
+ const parsedFileContent = JSON.parse(logFile.content)
return {
...logFile,
relativePath,