Skip to content

Commit 997bb56

Browse files
committed
docs: updated API reference
1 parent c0ea689 commit 997bb56

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/api-reference/core/Codebase.mdx

+15-15
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-L1561" />
14+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L117-L1566" />
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#L1192-L1279" />
92+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1196-L1283" />
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#L865-L905" />
127+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L865-L909" />
128128

129129
<ParameterWrapper>
130130
<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#L970-L1002" />
237+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L974-L1006" />
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#L1533-L1535" />
260+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1538-L1540" />
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#L1537-L1561" />
268+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1542-L1566" />
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#L1289-L1304" />
284+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1293-L1308" />
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#L1443-L1523" />
301+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1448-L1528" />
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#L1327-L1394" />
309+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1331-L1398" />
310310

311311
<ParameterWrapper>
312312
<Parameter
@@ -359,7 +359,7 @@ 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#L1397-L1440" />
362+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1401-L1445" />
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;)"/>
@@ -465,7 +465,7 @@ 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#L1525-L1531" />
468+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1530-L1536" />
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=""/>
@@ -624,15 +624,15 @@ Resets the codebase by
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#L1281-L1287" />
627+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1285-L1291" />
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#L1306-L1324" />
635+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1310-L1328" />
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#L1056-L1070" />
664+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1060-L1074" />
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#L1008-L1021" />
681+
<GithubLinkNote link="https://github.com/codegen-sh/codegen/blob/develop/src/codegen/sdk/core/codebase.py#L1012-L1025" />
682682

683683
<ParameterWrapper>
684684
<Parameter

0 commit comments

Comments
 (0)