Skip to content

Commit 8cc3e51

Browse files
codegen-teamtkucar
authored andcommitted
docs: updated API reference
1 parent 057ea27 commit 8cc3e51

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

docs/api-reference/core/Codebase.mdx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx';
1111
import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx';
1212
import {Attribute} from '/snippets/Attribute.mdx';
1313

14-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L117-L1547" />
14+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L117-L1549" />
1515

1616

1717
## Attributes
@@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx';
8989
<HorizontalDivider />
9090
### <span className="text-primary">ai</span>
9191
Generates a response from the AI based on the provided prompt, target, and context.
92-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1178-L1265" />
92+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1180-L1267" />
9393

9494
<ParameterWrapper>
9595
<Parameter
@@ -124,7 +124,7 @@ Generates a response from the AI based on the provided prompt, target, and conte
124124

125125
### <span className="text-primary">checkout</span>
126126
Checks out a git branch or commit and syncs the codebase graph to the new state.
127-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L851-L891" />
127+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L853-L893" />
128128

129129
<ParameterWrapper>
130130
<Parameter
@@ -159,7 +159,7 @@ Checks out a git branch or commit and syncs the codebase graph to the new state.
159159

160160
### <span className="text-primary">commit</span>
161161
Commits all staged changes to the codebase graph and synchronizes the graph with the filesystem if specified.
162-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L789-L801" />
162+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L791-L803" />
163163

164164
<ParameterWrapper>
165165
<Parameter
@@ -176,7 +176,7 @@ Commits all staged changes to the codebase graph and synchronizes the graph with
176176

177177
### <span className="text-primary">create_directory</span>
178178
Creates a directory at the specified path.
179-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L515-L526" />
179+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L512-L528" />
180180

181181
<ParameterWrapper>
182182
<Parameter
@@ -205,7 +205,7 @@ Creates a directory at the specified path.
205205

206206
### <span className="text-primary">create_file</span>
207207
Creates a new file in the codebase with specified content.
208-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L477-L513" />
208+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L477-L510" />
209209

210210
<ParameterWrapper>
211211
<Parameter
@@ -234,7 +234,7 @@ Creates a new file in the codebase with specified content.
234234

235235
### <span className="text-primary">create_pr</span>
236236
Creates a pull request from the current branch to the repository's default branch.
237-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L956-L988" />
237+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L958-L990" />
238238

239239
<ParameterWrapper>
240240
<Parameter
@@ -257,15 +257,15 @@ Creates a pull request from the current branch to the repository's default branc
257257

258258
### <span className="text-primary">create_pr_comment</span>
259259
Create a comment on a pull request
260-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1519-L1521" />
260+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1521-L1523" />
261261

262262

263263
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
264264

265265

266266
### <span className="text-primary">create_pr_review_comment</span>
267267
Create a review comment on a pull request.
268-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1523-L1547" />
268+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1525-L1549" />
269269

270270

271271
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
@@ -281,7 +281,7 @@ A list property that returns all files in the codebase.
281281

282282
### <span className="text-primary">find_by_span</span>
283283
Finds editable objects that overlap with the given source code span.
284-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1275-L1290" />
284+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1277-L1292" />
285285

286286
<ParameterWrapper>
287287
<Parameter
@@ -298,15 +298,15 @@ Finds editable objects that overlap with the given source code span.
298298

299299
### <span className="text-primary">from_files</span>
300300
Creates a Codebase instance from multiple files.
301-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1429-L1509" />
301+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1431-L1511" />
302302

303303

304304
<Return return_type={ <><a href="/api-reference/core/Codebase" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Codebase</a></> } description="A Codebase instance initialized with the provided files"/>
305305

306306

307307
### <span className="text-primary">from_repo</span>
308308
Fetches a codebase from GitHub and returns a Codebase instance.
309-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1313-L1380" />
309+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1315-L1382" />
310310

311311
<ParameterWrapper>
312312
<Parameter
@@ -359,15 +359,15 @@ Fetches a codebase from GitHub and returns a Codebase instance.
359359

360360
### <span className="text-primary">from_string</span>
361361
Creates a Codebase instance from a string of code.
362-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1383-L1426" />
362+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1385-L1428" />
363363

364364

365365
<Return return_type={ <><a href="/api-reference/core/Codebase" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Codebase</a></> } description="A Codebase instance initialized with the provided code Example: >>> # Python code >>> code = &quot;def add(a, b): return a + b&quot; >>> codebase = Codebase.from_string(code, language=&quot;python&quot;) >>> # TypeScript code >>> code = &quot;function add(a: number, b: number): number { return a + b; }&quot; >>> codebase = Codebase.from_string(code, language=&quot;typescript&quot;)"/>
366366

367367

368368
### <span className="text-primary">get_class</span>
369369
Returns a class that matches the given name.
370-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L673-L695" />
370+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L675-L697" />
371371

372372
<ParameterWrapper>
373373
<Parameter
@@ -390,7 +390,7 @@ Returns a class that matches the given name.
390390

391391
### <span className="text-primary">get_directory</span>
392392
Returns Directory by `dir_path`, or full path to the directory from codebase root.
393-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L595-L615" />
393+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L597-L617" />
394394

395395
<ParameterWrapper>
396396
<Parameter
@@ -413,7 +413,7 @@ Returns Directory by `dir_path`, or full path to the directory from codebase roo
413413

414414
### <span className="text-primary">get_file</span>
415415
Retrieves a file from the codebase by its filepath.
416-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L544-L580" />
416+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L546-L582" />
417417

418418
<ParameterWrapper>
419419
<Parameter
@@ -442,7 +442,7 @@ Retrieves a file from the codebase by its filepath.
442442

443443
### <span className="text-primary">get_function</span>
444444
Retrieves a function from the codebase by its name.
445-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L697-L724" />
445+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L699-L726" />
446446

447447
<ParameterWrapper>
448448
<Parameter
@@ -465,15 +465,15 @@ Retrieves a function from the codebase by its name.
465465

466466
### <span className="text-primary">get_modified_symbols_in_pr</span>
467467
Get all modified symbols in a pull request
468-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1511-L1517" />
468+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1513-L1519" />
469469

470470

471471
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">tuple[str, dict[str, str], list[str]]</code> } description=""/>
472472

473473

474474
### <span className="text-primary">get_relative_path</span>
475475
Calculates a relative path from one file to another, removing the extension from the target file.
476-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L734-L765" />
476+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L736-L767" />
477477

478478
<ParameterWrapper>
479479
<Parameter
@@ -496,7 +496,7 @@ Calculates a relative path from one file to another, removing the extension from
496496

497497
### <span className="text-primary">get_symbol</span>
498498
Returns a Symbol by name from the codebase.
499-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L630-L655" />
499+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L632-L657" />
500500

501501
<ParameterWrapper>
502502
<Parameter
@@ -519,7 +519,7 @@ Returns a Symbol by name from the codebase.
519519

520520
### <span className="text-primary">get_symbols</span>
521521
Retrieves all symbols in the codebase that match the given symbol name.
522-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L657-L671" />
522+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L659-L673" />
523523

524524
<ParameterWrapper>
525525
<Parameter
@@ -536,7 +536,7 @@ Retrieves all symbols in the codebase that match the given symbol name.
536536

537537
### <span className="text-primary">git_commit</span>
538538
Stages + commits all changes to the codebase and git.
539-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L771-L787" />
539+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L773-L789" />
540540

541541
<ParameterWrapper>
542542
<Parameter
@@ -559,7 +559,7 @@ Stages + commits all changes to the codebase and git.
559559

560560
### <span className="text-primary">has_directory</span>
561561
Returns a boolean indicating if a directory exists in the codebase.
562-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L582-L593" />
562+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L584-L595" />
563563

564564
<ParameterWrapper>
565565
<Parameter
@@ -576,7 +576,7 @@ Returns a boolean indicating if a directory exists in the codebase.
576576

577577
### <span className="text-primary">has_file</span>
578578
Determines if a file exists in the codebase.
579-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L528-L538" />
579+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L530-L540" />
580580

581581
<ParameterWrapper>
582582
<Parameter
@@ -599,7 +599,7 @@ Determines if a file exists in the codebase.
599599

600600
### <span className="text-primary">has_symbol</span>
601601
Returns whether a symbol exists in the codebase.
602-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L617-L628" />
602+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L619-L630" />
603603

604604
<ParameterWrapper>
605605
<Parameter
@@ -616,23 +616,23 @@ Returns whether a symbol exists in the codebase.
616616

617617
### <span className="text-primary">reset</span>
618618
Resets the codebase by
619-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L832-L849" />
619+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L834-L851" />
620620

621621

622622
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
623623

624624

625625
### <span className="text-primary">set_ai_key</span>
626626
Sets the OpenAI key for the current Codebase instance.
627-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1267-L1273" />
627+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1269-L1275" />
628628

629629

630630
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
631631

632632

633633
### <span className="text-primary">set_session_options</span>
634634
Sets the session options for the current codebase.
635-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1292-L1310" />
635+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1294-L1312" />
636636

637637
<ParameterWrapper>
638638
<Parameter
@@ -661,7 +661,7 @@ Sets the session options for the current codebase.
661661

662662
### <span className="text-primary">should_fix</span>
663663
Returns True if the flag should be fixed based on the current mode and active group.
664-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1042-L1056" />
664+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1044-L1058" />
665665

666666
<ParameterWrapper>
667667
<Parameter
@@ -678,7 +678,7 @@ Returns True if the flag should be fixed based on the current mode and active gr
678678

679679
### <span className="text-primary">visualize</span>
680680
Visualizes a NetworkX graph or Plotly figure.
681-
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L994-L1007" />
681+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L996-L1009" />
682682

683683
<ParameterWrapper>
684684
<Parameter

0 commit comments

Comments
 (0)