We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For python documents, we can validate (or replace) GPT's code components extraction by using the ast library: Ex.
ast
def extract_classes_and_functions(source_code): parsed_tree = ast.parse(source_code) classes = [] functions = [] for node in ast.walk(parsed_tree): if isinstance(node, ast.ClassDef): classes.append(node) elif isinstance(node, ast.FunctionDef): functions.append(node) return classes, functions
The text was updated successfully, but these errors were encountered:
This is language-dependent, so maybe could work as part of a set of functions for validation depending in the user's input, and not as an optimization in the pipeline. Right now, the extraction is language-agnostic limited only by Langchain splitter's supported programming languages: https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/code_splitter
Sorry, something went wrong.
betogaona7
No branches or pull requests
For python documents, we can validate (or replace) GPT's code components extraction by using the
ast
library: Ex.The text was updated successfully, but these errors were encountered: