Skip to content

Commit c70f302

Browse files
committed
Remove agent and AI APIs
1 parent 75527bb commit c70f302

151 files changed

Lines changed: 1452 additions & 41035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/api-reference/core/Codebase.mdx

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -87,41 +87,6 @@ import {Attribute} from '/snippets/Attribute.mdx';
8787

8888
## Methods
8989
<HorizontalDivider />
90-
### <span className="text-primary">ai</span>
91-
Generates a response from the AI based on the provided prompt, target, and context.
92-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/codebase.py#L1196-L1283" />
93-
94-
<ParameterWrapper>
95-
<Parameter
96-
name="prompt"
97-
type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">str</code> }
98-
description="The text prompt to send to the AI."
99-
defaultValue=""
100-
/>
101-
<Parameter
102-
name="target"
103-
type={ <><a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>| None</span></> }
104-
description="An optional editable object (like a function, class, etc.) that provides the main focus for the AI's response."
105-
defaultValue="None"
106-
/>
107-
<Parameter
108-
name="context"
109-
type={ <><a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>| list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>] | dict[str,</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>| list[</span> <a href="/api-reference/core/Editable" style={ {fontWeight: "inherit", fontSize: "inherit"} }>Editable</a> <span>]] | None</span></> }
110-
description="Additional context to help inform the AI's response."
111-
defaultValue="None"
112-
/>
113-
<Parameter
114-
name="model"
115-
type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">str</code> }
116-
description="The AI model to use for generating the response. Defaults to &quot;gpt-4o&quot;."
117-
defaultValue="&quot;gpt-4o&quot;"
118-
/>
119-
</ParameterWrapper>
120-
121-
122-
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">str</code> } description="The generated response from the AI."/>
123-
124-
12590
### <span className="text-primary">checkout</span>
12691
Checks out a git branch or commit and syncs the codebase graph to the new state.
12792
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/codebase.py#L865-L909" />
@@ -622,14 +587,6 @@ Resets the codebase by
622587
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
623588

624589

625-
### <span className="text-primary">set_ai_key</span>
626-
Sets the OpenAI key for the current Codebase instance.
627-
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/codebase.py#L1285-L1291" />
628-
629-
630-
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
631-
632-
633590
### <span className="text-primary">set_session_options</span>
634591
Sets the session options for the current codebase.
635592
<GithubLinkNote link="https://github.com/codegen-sh/graph-sitter/blob/develop/src/graph_sitter/core/codebase.py#L1310-L1328" />
@@ -647,12 +604,6 @@ Sets the session options for the current codebase.
647604
description="The maximum duration in seconds for a session"
648605
defaultValue=""
649606
/>
650-
<Parameter
651-
name="max_ai_requests"
652-
type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">int, optional</code> }
653-
description="The maximum number of AI requests"
654-
defaultValue=""
655-
/>
656607
</ParameterWrapper>
657608

658609

@@ -699,4 +650,3 @@ Visualizes a NetworkX graph or Plotly figure.
699650
<Return return_type={ <code className="text-sm bg-gray-100 px-2 py-0.5 rounded">None</code> } description=""/>
700651

701652

702-

docs/api-reference/openapi3.json

Lines changed: 0 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -165,160 +165,6 @@
165165
}
166166
}
167167
},
168-
"/v1/organizations/{org_id}/agent/run": {
169-
"post": {
170-
"tags": ["agents", "agents", "agents"],
171-
"summary": "Create Agent Run",
172-
"description": "Create a new agent run.\n\nCreates and initiates a long-running agent process based on the provided prompt.\nThe process will complete asynchronously, and the response contains the agent run ID\nwhich can be used to check the status later. The requesting user must be a member\nof the specified organization.\n\nRate limit: 10 requests per minute.",
173-
"operationId": "create_agent_run_v1_organizations__org_id__agent_run_post",
174-
"parameters": [
175-
{
176-
"name": "org_id",
177-
"in": "path",
178-
"required": true,
179-
"schema": { "type": "integer", "title": "Org Id" }
180-
},
181-
{
182-
"name": "authorization",
183-
"in": "header",
184-
"required": false,
185-
"schema": { "title": "Authorization" }
186-
}
187-
],
188-
"requestBody": {
189-
"required": true,
190-
"content": {
191-
"application/json": {
192-
"schema": { "$ref": "#/components/schemas/CreateAgentRunInput" }
193-
}
194-
}
195-
},
196-
"responses": {
197-
"200": {
198-
"description": "Successful Response",
199-
"content": {
200-
"application/json": {
201-
"schema": { "$ref": "#/components/schemas/AgentRunResponse" }
202-
}
203-
}
204-
},
205-
"429": {
206-
"content": {
207-
"application/json": {
208-
"schema": {
209-
"$ref": "#/components/schemas/APIRateLimitErrorResponse"
210-
}
211-
}
212-
},
213-
"description": "Too Many Requests"
214-
},
215-
"402": {
216-
"content": {
217-
"application/json": {
218-
"schema": {
219-
"$ref": "#/components/schemas/AgentRunLimitReachedErrorResponse"
220-
}
221-
}
222-
},
223-
"description": "Payment Required"
224-
},
225-
"403": {
226-
"content": {
227-
"application/json": {
228-
"schema": {
229-
"$ref": "#/components/schemas/PermissionsErrorResponse"
230-
}
231-
}
232-
},
233-
"description": "Forbidden"
234-
},
235-
"422": {
236-
"description": "Validation Error",
237-
"content": {
238-
"application/json": {
239-
"schema": { "$ref": "#/components/schemas/HTTPValidationError" }
240-
}
241-
}
242-
}
243-
}
244-
}
245-
},
246-
"/v1/organizations/{org_id}/agent/run/{agent_run_id}": {
247-
"get": {
248-
"tags": ["agents", "agents", "agents"],
249-
"summary": "Get Agent Run",
250-
"description": "Retrieve the status and result of an agent run.\n\nReturns the current status, progress, and any available results for the specified agent run.\nThe agent run must belong to the specified organization. If the agent run is still in progress,\nthis endpoint can be polled to check for completion.\n\nRate limit: 60 requests per 30 seconds.",
251-
"operationId": "get_agent_run_v1_organizations__org_id__agent_run__agent_run_id__get",
252-
"parameters": [
253-
{
254-
"name": "agent_run_id",
255-
"in": "path",
256-
"required": true,
257-
"schema": { "type": "integer", "title": "Agent Run Id" }
258-
},
259-
{
260-
"name": "org_id",
261-
"in": "path",
262-
"required": true,
263-
"schema": { "type": "integer", "title": "Org Id" }
264-
},
265-
{
266-
"name": "authorization",
267-
"in": "header",
268-
"required": false,
269-
"schema": { "title": "Authorization" }
270-
}
271-
],
272-
"responses": {
273-
"200": {
274-
"description": "Successful Response",
275-
"content": {
276-
"application/json": {
277-
"schema": { "$ref": "#/components/schemas/AgentRunResponse" }
278-
}
279-
}
280-
},
281-
"429": {
282-
"content": {
283-
"application/json": {
284-
"schema": {
285-
"$ref": "#/components/schemas/APIRateLimitErrorResponse"
286-
}
287-
}
288-
},
289-
"description": "Too Many Requests"
290-
},
291-
"403": {
292-
"content": {
293-
"application/json": {
294-
"schema": {
295-
"$ref": "#/components/schemas/PermissionsErrorResponse"
296-
}
297-
}
298-
},
299-
"description": "Forbidden"
300-
},
301-
"404": {
302-
"content": {
303-
"application/json": {
304-
"schema": {
305-
"$ref": "#/components/schemas/AgentRunNotFoundErrorResponse"
306-
}
307-
}
308-
},
309-
"description": "Not Found"
310-
},
311-
"422": {
312-
"description": "Validation Error",
313-
"content": {
314-
"application/json": {
315-
"schema": { "$ref": "#/components/schemas/HTTPValidationError" }
316-
}
317-
}
318-
}
319-
}
320-
}
321-
},
322168
"/v1/organizations": {
323169
"get": {
324170
"tags": ["organizations", "organizations", "organizations"],
@@ -407,70 +253,6 @@
407253
"type": "object",
408254
"title": "APIRateLimitErrorResponse"
409255
},
410-
"AgentRunLimitReachedErrorResponse": {
411-
"properties": {
412-
"message": {
413-
"type": "string",
414-
"title": "Message",
415-
"default": "Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue."
416-
},
417-
"status_code": {
418-
"type": "integer",
419-
"title": "Status Code",
420-
"default": 402
421-
}
422-
},
423-
"type": "object",
424-
"title": "AgentRunLimitReachedErrorResponse"
425-
},
426-
"AgentRunNotFoundErrorResponse": {
427-
"properties": {
428-
"message": {
429-
"type": "string",
430-
"title": "Message",
431-
"default": "Agent run not found."
432-
},
433-
"status_code": {
434-
"type": "integer",
435-
"title": "Status Code",
436-
"default": 404
437-
}
438-
},
439-
"type": "object",
440-
"title": "AgentRunNotFoundErrorResponse"
441-
},
442-
"AgentRunResponse": {
443-
"properties": {
444-
"id": { "type": "integer", "title": "Id" },
445-
"organization_id": { "type": "integer", "title": "Organization Id" },
446-
"status": {
447-
"anyOf": [{ "type": "string" }, { "type": "null" }],
448-
"title": "Status"
449-
},
450-
"created_at": {
451-
"anyOf": [{ "type": "string" }, { "type": "null" }],
452-
"title": "Created At"
453-
},
454-
"web_url": {
455-
"anyOf": [{ "type": "string" }, { "type": "null" }],
456-
"title": "Web Url"
457-
},
458-
"result": {
459-
"anyOf": [{ "type": "string" }, { "type": "null" }],
460-
"title": "Result"
461-
}
462-
},
463-
"type": "object",
464-
"required": ["id", "organization_id"],
465-
"title": "AgentRunResponse",
466-
"description": "Represents an agent run in API responses"
467-
},
468-
"CreateAgentRunInput": {
469-
"properties": { "prompt": { "type": "string", "title": "Prompt" } },
470-
"type": "object",
471-
"required": ["prompt"],
472-
"title": "CreateAgentRunInput"
473-
},
474256
"HTTPValidationError": {
475257
"properties": {
476258
"detail": {

docs/building-with-graph-sitter/codegen-with-wsl.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ To use WSL with VSCode:
5858

5959
You can read more about Developing in WSL [here](https://code.visualstudio.com/docs/remote/wsl).
6060

61-
<Tip>
62-
If you plan on using Codegen's MCP (Model Context Protocol) or LSP (Language Server Protocol) features, running VSCode through WSL is highly recommended.
63-
</Tip>
64-
6561
## Troubleshooting
6662

67-
- **I have trouble connecting to MCP or LSP from VSCode**: Windows and WSL run on two different network environments. WSL does come with a compatibility layer called [NAT (Network Address Translation)](https://learn.microsoft.com/en-us/windows/wsl/networking#default-networking-mode-nat) as a translation layer between the two environments, but it can sometimes cause issues. On machines running Windows 11 22H2 and higher, try switching to [Mirrored mode networking](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking) to see if that fixes the issue.
63+
- **I have trouble connecting development tools from VSCode**: Windows and WSL run on two different network environments. WSL does come with a compatibility layer called [NAT (Network Address Translation)](https://learn.microsoft.com/en-us/windows/wsl/networking#default-networking-mode-nat) as a translation layer between the two environments, but it can sometimes cause issues. On machines running Windows 11 22H2 and higher, try switching to [Mirrored mode networking](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking) to see if that fixes the issue.
6864
- **WSL takes up too much memory after running Codegen**: This is a known issue with WSL. Memory does not get properly released after running a memory-intensive process like Codegen. Try killing the WSL process using `wsl --shutdown` to free up memory. ([GitHub Issue for WSL](https://github.com/microsoft/WSL/issues/4166))
6965
- **WSL hangs and pins the CPU at 100% when I try to run Codegen**: This could be because of WSL running out of memory. Try killing the WSL process using `wsl --shutdown` and then try running Graph-sitter again. If that doesn't work, try [downloading more RAM](https://downloadmoreram.com/).
7066

docs/building-with-graph-sitter/comments-and-docstrings.mdx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ for file in codebase.files:
147147
indentation and maintains the existing comment style.
148148
</Note>
149149

150-
## Special APIs and AI Integration
150+
## Special APIs
151151

152152
### Google Style Docstrings
153153

@@ -160,31 +160,6 @@ func_b = symbol_a.get_method("funcB")
160160
func_b.docstring.to_google_docstring(func_b)
161161
```
162162

163-
### Using AI for Documentation
164-
165-
Graph-sitter integrates with LLMs to help generate and improve documentation. You can use the [Codebase.ai(...)](/api-reference/core/Codebase#ai) method to:
166-
167-
- Generate comprehensive docstrings
168-
- Update existing documentation
169-
- Convert between documentation styles
170-
- Add parameter descriptions
171-
172-
```python
173-
# Generate a docstring using AI
174-
function = codebase.get_function("my_function")
175-
176-
new_docstring = codebase.ai(
177-
"Generate a comprehensive docstring in Google style",
178-
target=function
179-
context={
180-
# provide additional context to the LLM
181-
'usages': function.usages,
182-
'dependencies': function.dependencies
183-
}
184-
)
185-
function.set_docstring(new_docstring)
186-
```
187-
188163
### Documentation Coverage
189164

190165
You can analyze and improve documentation coverage across your codebase:
@@ -200,4 +175,4 @@ for function in codebase.functions:
200175

201176
coverage = (documented / total * 100) if total > 0 else 0
202177
print(f"Documentation coverage: {coverage:.1f}%")
203-
```
178+
```

0 commit comments

Comments
 (0)