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

building knowledge graph index error, return metadata (error type: dict_type) #635

Open
zhengwanbo opened this issue Feb 27, 2025 · 1 comment

Comments

@zhengwanbo
Copy link

when build a graph knowledge, use qwen-trubo LLM.

[2025-02-27 13:40:59,221: INFO/ForkPoolWorker-1] Start building knowledge graph index for chunk #b458114c-a339-44cf-a788-509ed730e2fb.
[2025-02-27 13:40:59,231: DEBUG/ForkPoolWorker-1] OpenAI Response Token Usage: 2819
[2025-02-27 13:40:59,234: DEBUG/ForkPoolWorker-1] OpenAI Response Token Usage: 727
[2025-02-27 13:40:59,237: DEBUG/ForkPoolWorker-1] OpenAI Response Token Usage: 3243
[2025-02-27 13:40:59,239: DEBUG/ForkPoolWorker-1] OpenAI Response Token Usage: 3553
[2025-02-27 13:40:59,241: ERROR/ForkPoolWorker-1] app.tasks.build_index.build_kg_index_for_chunk[f8caf1c8-8649-4144-bccc-4530d6d52c72]: Failed to build knowledge graph index for chunk #b458114c-a339-44cf-a788-509ed730e2fb
Traceback (most recent call last):
File "/Users/wanzheng/src/ai_code/autoflow/backend/app/tasks/build_index.py", line 125, in build_kg_index_for_chunk
index_service.build_kg_index_for_chunk(index_session, db_chunk)
File "/Users/wanzheng/src/ai_code/autoflow/backend/app/rag/build_index.py", line 100, in build_kg_index_for_chunk
graph_index.insert_nodes([node])
File "/Users/wanzheng/src/ai_code/autoflow/auto4/lib/python3.11/site-packages/llama_index/core/indices/base.py", line 203, in insert_nodes
self._insert(nodes, **insert_kwargs)
File "/Users/wanzheng/src/ai_code/autoflow/backend/app/rag/knowledge_graph/base.py", line 205, in _insert
self._insert_nodes(nodes)
File "/Users/wanzheng/src/ai_code/autoflow/backend/app/rag/knowledge_graph/base.py", line 135, in _insert_nodes
entities_df, rel_df = extractor.extract(
^^^^^^^^^^^^^^^^^^
File "/Users/wanzheng/src/ai_code/autoflow/backend/app/rag/knowledge_graph/extractor.py", line 161, in extract
pred = self.extract_prog(text=text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/wanzheng/src/ai_code/autoflow/auto4/lib/python3.11/site-packages/dspy/primitives/program.py", line 26, in call
return self.forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/wanzheng/src/ai_code/autoflow/backend/app/rag/knowledge_graph/extractor.py", line 123, in forward
pred_graph = self.prog_graph(
^^^^^^^^^^^^^^^^
File "/Users/wanzheng/src/ai_code/autoflow/auto4/lib/python3.11/site-packages/dspy/primitives/program.py", line 26, in call
return self.forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/wanzheng/src/ai_code/autoflow/auto4/lib/python3.11/site-packages/dspy/functional/functional.py", line 369, in forward
raise ValueError(
ValueError: ('Too many retries trying to get the correct output format. Try simplifying the requirements.', {'knowledge': 'Input should be an object: entities, 0, metadata (error type: dict_type); Input should be an object: entities, 1, metadata (error type: dict_type); Input should be an object: entities, 2, metadata (error type: dict_type); Input should be an object: entities, 3, metadata (error type: dict_type); Input should be an object: entities, 4, metadata (error type: dict_type); Input should be an object: entities, 5, metadata (error type: dict_type); Input should be an object: entities, 6, metadata (error type: dict_type); Input should be an object: entities, 7, metadata (error type: dict_type); Input should be an object: entities, 8, metadata (error type: dict_type); Input should be an object: entities, 9, metadata (error type: dict_type); Input should be an object: entities, 10, metadata (error type: dict_type); Input should be an object: entities, 11, metadata (error type: dict_type); Input should be an object: entities, 12, metadata (error type: dict_type); Input should be an object: entities, 13, metadata (error type: dict_type); Input should be an object: entities, 14, metadata (error type: dict_type); Input should be an object: entities, 15, metadata (error type: dict_type)'})

@zhengwanbo
Copy link
Author

use v0.4.1, any one can help this. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant