-
Notifications
You must be signed in to change notification settings - Fork 88
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
Code graph pipeline improvements and fixes #414
Merged
Merged
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a8a83ff
Ingest non-code files
alekszievr 399faf9
Fixing review findings
alekszievr a6dfff8
Merge branch 'dev' of https://github.com/topoteretes/cognee into dev
alekszievr 4cee9a1
fix: add allowed extensions
lxobr dbc33a6
fix: adhere UnstructuredDocument.read() to Document
lxobr 5e79dc5
feat: time code graph run and add mock support
lxobr 4802567
Overcome ContextWindowExceededError by checking token count while chu…
alekszievr fbf8fc9
Merge branch 'dev' into COG-949
alekszievr a774191
Adjust AudioDocument and handle None token limit
alekszievr fb13a1b
Handle azure models as well
alekszievr 0dec704
Merge branch 'dev' into COG-949
alekszievr 8ffef50
Add clean logging to code graph example
alekszievr f4397bf
Remove setting envvars from arg
alekszievr 34a9267
Get embedding engine instead of passing it. Get it from vector engine…
alekszievr 97814e3
Get embedding engine instead of passing it in code chunking.
alekszievr d1d81eb
Merge branch 'dev' into COG-949
alekszievr 2e37f85
ruff formatting
alekszievr 5635da6
Adjust unit tests
alekszievr 6762039
Merge remote-tracking branch 'origin/COG-949' into COG-949
alekszievr abb3ea6
Adjust integration tests
alekszievr cdaae16
Handle circular import
alekszievr 626bc76
Set max_tokens in config
alekszievr d7b2186
Adjust SWE-bench script to code graph pipeline call
alekszievr 18bb282
Adjust SWE-bench script to code graph pipeline call
alekszievr 7e10349
Merge branch 'COG-949' of https://github.com/topoteretes/cognee into …
hajdul88 a11b914
Merge branch 'dev' into COG-949
alekszievr 5839ab0
Merge branch 'dev' into COG-949
Vasilije1990 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
from typing import Optional | ||
|
||
from cognee.modules.data.processing.document_types.Document import Document | ||
|
||
|
||
async def extract_chunks_from_documents( | ||
documents: list[Document], chunk_size: int = 1024, chunker="text_chunker" | ||
documents: list[Document], | ||
chunk_size: int = 1024, | ||
chunker="text_chunker", | ||
max_tokens: Optional[int] = None, | ||
): | ||
for document in documents: | ||
for document_chunk in document.read(chunk_size=chunk_size, chunker=chunker): | ||
for document_chunk in document.read( | ||
chunk_size=chunk_size, chunker=chunker, max_tokens=max_tokens | ||
): | ||
yield document_chunk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider type validation for MAX_TOKENS environment variable.
While the type hint correctly indicates
Optional[int]
, the direct use ofos.getenv()
doesn't perform type conversion. This could lead to runtime type errors if the environment variable exists but contains a non-integer value.Apply this diff to add type validation:
📝 Committable suggestion