Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Cleanup; Improve logs
Tomas Valenta4b23692fb1a2
diff --git a/components/Editor/Sidebar/Logs/Thought.tsx b/components/Editor/Sidebar/Logs/Thought.tsxindex e958d4879..c8455bb54 100644--- a/components/Editor/Sidebar/Logs/Thought.tsx+++ b/components/Editor/Sidebar/Logs/Thought.tsx@@ -1,4 +1,5 @@import { ThoughtLog } from 'db/types'+import { useMemo } from 'react'export interface Props {log: ThoughtLog@@ -7,6 +8,14 @@ export interface Props {function Thought({log,}: Props) {+ const content = useMemo(() => {+ return log.content+ .replaceAll('\nAction:', '')+ .replaceAll('Thought:', '')+ .replaceAll('\nFinal Answer:', '')+ .trim()+ }, [log.content])+return (<div className="leading-[24px]@@ -15,7 +24,7 @@ function Thought({text-smtext-slate-500">- {log.content}+ {content}</div>)}diff --git a/components/Editor/Sidebar/Logs/Tool/Base.tsx b/components/Editor/Sidebar/Logs/Tool/Base.tsxindex 7bd01187e..556b11108 100644--- a/components/Editor/Sidebar/Logs/Tool/Base.tsx+++ b/components/Editor/Sidebar/Logs/Tool/Base.tsx@@ -52,7 +52,7 @@ function BaseTool({{body &&<div className="- py-6+ py-4max-w-fulloverflow-x-autoscrollerdiff --git a/components/Editor/Sidebar/Logs/Tool/Curl.tsx b/components/Editor/Sidebar/Logs/Tool/Curl.tsxindex 999c2f80b..be1d63133 100644--- a/components/Editor/Sidebar/Logs/Tool/Curl.tsx+++ b/components/Editor/Sidebar/Logs/Tool/Curl.tsx@@ -23,7 +23,6 @@ function Curl({if (log.tool_input.trim()) {body = (<div className="- pt-2"><pre>{log.tool_input.trim()}diff --git a/components/Editor/Sidebar/Logs/Tool/CurlServer.tsx b/components/Editor/Sidebar/Logs/Tool/CurlServer.tsxdeleted file mode 100644index 999c2f80b..000000000--- a/components/Editor/Sidebar/Logs/Tool/CurlServer.tsx+++ /dev/null@@ -1,44 +0,0 @@-import {- ReactNode-} from 'react'-import {- Terminal,-} from 'lucide-react'--import { ToolName, ToolLog } from 'db/types'--import Base from './Base'---export interface Props {- log: ToolLog-}--function Curl({- log,-}: Props) {- if (log.tool_name !== ToolName.Curl) throw new Error(`'${log.tool_name}': This component supports only logs for '${ToolName.Curl}' tool`)-- let body: ReactNode = null- if (log.tool_input.trim()) {- body = (- <div className="- pt-2- ">- <pre>- {log.tool_input.trim()}- </pre>- </div>- )- }-- return (- <Base- log={log}- icon={<Terminal size="16px" />}- body={body}- />- )-}--export default Curl\ No newline at end of filediff --git a/components/Editor/Sidebar/Logs/Tool/RunCode.tsx b/components/Editor/Sidebar/Logs/Tool/RunCode.tsxdeleted file mode 100644index a4babc2ed..000000000--- a/components/Editor/Sidebar/Logs/Tool/RunCode.tsx+++ /dev/null@@ -1,44 +0,0 @@-import {- ReactNode-} from 'react'-import {- Code2,-} from 'lucide-react'--import { ToolName, ToolLog } from 'db/types'--import Base from './Base'---export interface Props {- log: ToolLog-}--function RunSavedCode({- log,-}: Props) {- if (log.tool_name !== ToolName.RunSavedCode) throw new Error(`'${log.tool_name}': This component supports only logs for '${ToolName.WriteJavaScriptCode}' tool`)-- let body: ReactNode = null- if (log.tool_input.trim()) {- body = (- <div className="- pt-2- ">- <pre>- {log.tool_input.trim()}- </pre>- </div>- )- }-- return (- <Base- log={log}- icon={<Code2 size="16px" />}- body={body}- />- )-}--export default RunSavedCode\ No newline at end of filediff --git a/components/Editor/Sidebar/Logs/Tool/WriteCode.tsx b/components/Editor/Sidebar/Logs/Tool/WriteCode.tsxindex ba021a14f..5041ac378 100644--- a/components/Editor/Sidebar/Logs/Tool/WriteCode.tsx+++ b/components/Editor/Sidebar/Logs/Tool/WriteCode.tsx@@ -23,7 +23,6 @@ function WriteCode({if (log.tool_input.trim()) {body = (<div className="- pt-2"><pre>{log.tool_input.trim()}