Skip to content

Update agent docs #625

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

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions docs/tutorials/build-code-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ agent.run("Tell me about this repo")

The agent has access to powerful code viewing and manipulation tools powered by Codegen, including:
- `ViewFileTool`: View contents and metadata of files
- `SemanticSearchTool`: Search over code using natural language queries
- `SemanticEditTool`: Make intelligent edits to files
- `RevealSymbolTool`: Analyze symbol dependencies and usages
- `MoveSymbolTool`: Move symbols between files with import handling
- And many more...
- `ReplacementEditTool`: Make regex-based replacement editing on files
- `ListDirectoryTool`: List directory contents
- `SearchTool`: Search for files and symbols
- `CreateFileTool`: Create new files
- `DeleteFileTool`: Delete files
- `RenameFileTool`: Rename files
- `EditFileTool`: Edit files
- `MoveSymbolTool`: Move symbols between files with import handling



<Info>View the full code for the default tools and agent implementation in our [examples repository](https://github.com/codegen-sh/codegen-sdk/tree/develop/src/codegen/extensions/langchain/tools)</Info>

Expand All @@ -48,7 +56,7 @@ agent.run("Tell me about this repo")
```


<Note>Your `ANTHROPIC_API_KEY` and/or `OPENAI_API_KEY` must be set in your env.</Note>
<Note>Your `ANTHROPIC_API_KEY` must be set in your env.</Note>

The default implementation uses `anthropic/claude-3-5-sonnet-latest` for the model but this can be changed through the `model_provider` and `model_name` arguments.

Expand All @@ -66,16 +74,17 @@ The agent comes with a comprehensive set of tools for code analysis and manipula

```python
from codegen.extensions.langchain.tools import (
ViewFileTool,
SemanticSearchTool,
SemanticEditTool,
RevealSymbolTool,
MoveSymbolTool,
EditFileTool,
CreateFileTool,
DeleteFileTool,
EditFileTool,
ListDirectoryTool,
MoveSymbolTool,
RenameFileTool,
ReplacementEditTool,
RevealSymbolTool,
SearchTool,
SemanticEditTool,
ViewFileTool,
)
```

Expand Down