e2b-dev / e2b-dev/code-interpreter

results.html generated HTML file has multiple issues

Abierto
#156 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug Code Interpreter
Lenguaje dominante
Python
Estrellas
2.4k
Forks
228
Merge medio
48 min
PR fusionados (30 d)
5

Descripción

Issue: results.html generated HTML file has multiple issues
[1] It has only javascript content, no HTML container tags.
[2] The HTML file is so huge that it resolves CDN hosted javascript content instead of referring it.

The E2B code executed:

from dotenv import load_dotenv
load_dotenv()
from e2b_code_interpreter import Sandbox

api_key = E2B_API_KEY
code = "...."

sbx = Sandbox.create(api_key=api_key) 
execution = sbx.run_code(code)  

In [11]: execution.results
Out[11]: [Result(Formats: html), Result(Formats: html, application/vnd.plotly.v1+json)]

html_content = execution.results[0].html

In [12]: html_content
Out[12]: '        <script type="text/javascript">\n        window.PlotlyConfig = {MathJaxConfig: \'local\'};\n        if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}\n        </script>\n        <script type="module">/**\n* plotly.js v3.0.1\n* Copyright 2012-2025, Plotly, Inc.\n* All rights reserved.\n* Licensed under the MIT license\n*/\n(\n function(root, factory) {\n  if (typeof module === "object" && module.exports) {\n   module.exports = factory();\n  } else {\n   root.moduleName = factory();\n  }\n} (typeof self !== "undefined" ? self : this, () => {\n"use strict";var Plotly=(()=>{var VQe=Object.create;var MS=Object.defineProperty,HQe=Object.defineProperties,GQe=Object.getOwnPropertyDescriptor,jQe=Object.getOwnPropertyDescriptors,WQ
...
....
  • The above html_content shows only javascript content, no HTML container tags.
  • It has resolved and downloaded the entire CDN hosted plotly.js within it.

The expected HTML file should have reference to CDN hosted Plotly.js file

<html>
<head><meta charset="utf-8" /></head>
<body>
    <div>                        <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
        <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.2.min.js"></script>                <div id="f7c2c6fa-f9f3-40a5-a200-76f48ea8dd58" class="plotly-graph-div" style="height:100%; width:100%;"></div>            <script type="text/javascript">                                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById("f7c2c6fa-f9f3-40a5-a200-76f48ea8dd58")) {                    Plotly.newPlot(

References:

  • Plotly chart generation code is attached here: plotly-charts.py-
  • Expected HTML file content: top_10_gdp_pie_chart.html
  • Actual HTML file content from result.html: its huge 4 MB containing mainly plotly.js code

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el ejemplo adjunto plotly-charts.py y sigue la ruta del resultado de Sandbox.run_code que produce results[0].html. Compárala con la top_10_gdp_pie_chart.html esperada; se considera terminado cuando la salida incluye etiquetas de contenedor HTML y hace referencia a Plotly.js alojado en un CDN en lugar de incrustar la biblioteca completa.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, plotly, python
Área
data-visualization
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.