-
Notifications
You must be signed in to change notification settings - Fork 52
Support Codebase.from_string
and Codebase.from_files
#630
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
Conversation
codegen-bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files |
src/codegen/sdk/core/codebase.py
Outdated
filename = "test.ts" if prog_lang == ProgrammingLanguage.TYPESCRIPT else "test.py" | ||
|
||
# Create temporary directory | ||
import tempfile |
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.
Why do we not import this top level?
🎉 This PR is included in version 0.41.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Codebase.from_string
Parameters
code: str
-> pass in the code you want to parselanguage: str | ProgrammingLanguage
-> pass in the programming language of the codeRaises error if programming language is not parsed
Codebase.from_files
Parameters
files: dict[str, str]
-> pass in dict of {filename: code, filename: code}language str | ProgrammingLanguage | None
-> pass in programming language of the codeuses .ts, .js, .tsx, .jsx or .py to figure out language support of language not passed in
will not allow mismatched extensions (i.e test.py, and test.ts)