Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.24.2
require (
github.com/anthropics/anthropic-sdk-go v1.6.2
github.com/invopop/jsonschema v0.13.0
github.com/sashabaranov/go-openai v1.30.3
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sashabaranov/go-openai v1.30.3 h1:TEdRP3otRXX2A7vLoU+kI5XpoSo7VUUlM/rEttUqgek=
github.com/sashabaranov/go-openai v1.30.3/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
Expand Down
74 changes: 74 additions & 0 deletions gpt_version/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# GPT Version Agents

This directory contains GPT-powered versions of the coding agents, converted from the original Anthropic Claude versions. Each file is a standalone program that provides different tool capabilities.

## Files Overview

- `chat_gpt.go` - Basic chat functionality without tools
- `read_gpt.go` - Chat with file reading capability
- `list_files_gpt.go` - Chat with file reading and listing capabilities
- `bash_tool_gpt.go` - Chat with file operations and bash command execution
- `code_search_tool_gpt.go` - Chat with file operations, bash, and code search using ripgrep
- `edit_tool_gpt.go` - Chat with file operations, bash, and file editing capabilities

## Usage

Each program is standalone. To run any of them:

```bash
# For basic chat
go run gpt_version/chat_gpt.go

# For file reading agent
go run gpt_version/read_gpt.go

# For file listing agent
go run gpt_version/list_files_gpt.go

# For bash command agent
go run gpt_version/bash_tool_gpt.go

# For code search agent
go run gpt_version/code_search_tool_gpt.go

# For file editing agent
go run gpt_version/edit_tool_gpt.go
```

## Configuration

All programs use the ChatAnywhere proxy service for accessing OpenAI's API. You can:

1. Set the `OPENAI_API_KEY` environment variable with your API key
2. Or modify the default API key in the source code (line ~32 in each file)

For international users, change the `BaseURL` from `https://api.chatanywhere.tech/v1` to `https://api.chatanywhere.org/v1`.

## Features

### Tools Available

- **read_file**: Read contents of files
- **list_files**: List files and directories
- **bash**: Execute bash commands
- **code_search**: Search code using ripgrep (rg)
- **edit_file**: Edit files by replacing text

### Verbose Mode

All programs support verbose logging:

```bash
go run gpt_version/edit_tool_gpt.go -verbose
```

## Dependencies

- `github.com/sashabaranov/go-openai` - OpenAI Go SDK
- Standard Go libraries

## Notes

- These are standalone programs, not meant to be compiled together
- The linter warnings about redeclared identifiers are expected since each file defines the same types independently
- Each program provides a progressively more feature-rich agent, choose based on your needs
Loading