Skip to content

convert_to_graph_documents encounter type error str has no content property #24294

Closed Answered by dosubot bot
Jeffhaha asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there, @Jeffhaha! I'm here to help with any bugs, questions, or contributions you might have. Let's see what's going on with the issue you've encountered.

To resolve the AttributeError: 'str' object has no attribute 'content' when using the convert_to_graph_documents method from the LLMGraphTransformer class, ensure that the raw_schema is correctly cast to a dictionary before accessing its attributes. Specifically, in the process_response method, the raw_schema should be cast to a dictionary if it is not already one.

Here is the relevant part of the process_response method with the necessary correction:

def process_response(self, document: Document) -> GraphDocument:
    """
    Proc…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Jeffhaha
Comment options

@dosubot
Comment options

Answer selected by Jeffhaha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant