Skip to content

Commit a819642

Browse files
authored
docs: fix initialization (#504)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [x ] I have added tests for my changes - [x ] I have updated the documentation or added new documentation as needed
1 parent acb8dca commit a819642

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

docs/building-with-codegen/parsing-codebases.mdx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ codebase = Codebase("./", language="typescript")
4444
To fetch and parse a repository directly from GitHub, use the `from_repo` function.
4545

4646
```python
47-
import codegen
48-
47+
from codegen import Codebase
4948
# Fetch and parse a repository (defaults to /tmp/codegen/{repo_name})
50-
codebase = codegen.from_repo('fastapi/fastapi')
49+
codebase = Codebase.from_repo('fastapi/fastapi')
5150

5251
# Customize temp directory, clone depth, specific commit, or programming language
53-
codebase = codegen.from_repo(
52+
codebase = Codebase.from_repo(
5453
'fastapi/fastapi',
5554
tmp_dir='/custom/temp/dir', # Optional: custom temp directory
5655
commit='786a8ada7ed0c7f9d8b04d49f24596865e4b7901', # Optional: specific commit
@@ -70,18 +69,14 @@ You can customize the behavior of your Codebase instance by passing a `CodebaseC
7069

7170
```python
7271
from codegen import Codebase
73-
from codegen.sdk.codebase.config import CodebaseConfig, GSFeatureFlags, Secrets
72+
from codegen.sdk.codebase.config import CodebaseConfig, Secrets
7473

7574
codebase = Codebase(
7675
"path/to/repository",
7776
config=CodebaseConfig(
7877
secrets=Secrets(
7978
openai_key="your-openai-key" # For AI-powered features
8079
),
81-
feature_flags=GSFeatureFlags(
82-
sync_enabled=True, # Enable graph synchronization
83-
... # Add other feature flags as needed
84-
)
8580
)
8681
)
8782
```

0 commit comments

Comments
 (0)