Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix image_url #343

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Markdown node parser."""
from llama_index.core.bridge.pydantic import Field, BaseModel
from typing import Any, Iterator, List, Optional, Sequence
import json

from llama_index.core.node_parser.interface import NodeParser
from llama_index.core.node_parser import SentenceSplitter
Expand Down Expand Up @@ -88,7 +87,7 @@ def _format_tree_nodes(
)
nodes_list.append(image_node)
image_info = ImageInfo(image_url=node.content)
chunk_images_list.append(json.dumps(image_info.__dict__))
chunk_images_list.append(image_info.__dict__)
return ""
if not node.children:
return node.content
Expand Down Expand Up @@ -249,7 +248,7 @@ def traverse_tree(
)
nodes_list.append(image_node)
image_info = ImageInfo(image_url=child.content)
chunk_images_list.append(json.dumps(image_info.__dict__))
chunk_images_list.append(image_info.__dict__)
else:
chunk_text += "\n" + self._format_tree_nodes(
child, doc_node, ref_doc, nodes_list, chunk_images_list
Expand Down
Loading