Browse Source

refac: code_execution.uuid -> id

convention
Timothy J. Baek 6 tháng trước cách đây
mục cha
commit
55f14e37ea

+ 2 - 2
src/lib/components/chat/Chat.svelte

@@ -176,14 +176,14 @@
 				}
 			} else if (type === 'citation') {
 				if (data?.type === 'code_execution') {
-					// Code execution; update existing code execution by UUID,
+					// Code execution; update existing code execution by ID,
 					// otherwise append.
 					if (!message?.code_executions) {
 						message.code_executions = [];
 					}
 					let is_update = false;
 					for (let i = 0; i < message.code_executions.length; i++) {
-						if (message.code_executions[i].uuid === data.uuid) {
+						if (message.code_executions[i].id === data.id) {
 							message.code_executions[i] = data;
 							is_update = true;
 							break;

+ 3 - 3
src/lib/components/chat/Messages/CodeExecutionModal.svelte

@@ -57,7 +57,7 @@
 					</div>
 
 					<CodeBlock
-						id="codeexec-{code_execution?.uuid}-code"
+						id="codeexec-{code_execution?.id}-code"
 						lang={code_execution?.language}
 						code={code_execution?.code}
 						allow_execution={false}
@@ -71,7 +71,7 @@
 						</div>
 
 						<CodeBlock
-							id="codeexec-{code_execution?.uuid}-error"
+							id="codeexec-{code_execution?.id}-error"
 							lang=""
 							code={code_execution?.error}
 							allow_execution={false}
@@ -86,7 +86,7 @@
 						</div>
 
 						<CodeBlock
-							id="codeexec-{code_execution?.uuid}-output"
+							id="codeexec-{code_execution?.id}-output"
 							lang=""
 							code={code_execution?.output}
 							allow_execution={false}

+ 3 - 1
src/lib/components/chat/Messages/CodeExecutions.svelte

@@ -11,6 +11,7 @@
 		let output = null;
 		let files = [];
 		let status = 'PENDING';
+
 		if (code_execution.result) {
 			output = code_execution.result.output;
 			if (code_execution.result.error) {
@@ -23,8 +24,9 @@
 				files = code_execution.result.files;
 			}
 		}
+
 		acc.push({
-			uuid: code_execution.uuid,
+			id: code_execution.id,
 			name: code_execution.name,
 			code: code_execution.code,
 			language: code_execution.language || '',