Update all dependencies and migrate to new Google genai SDK

- Update all Go dependencies to latest versions
- Migrate from github.com/google/generative-ai-go/genai to google.golang.org/genai
- Fix google.go to use the new SDK API (NewPartFromText, NewContentFromParts, etc.)
- Update schema package imports to use the new genai package
- Add CLAUDE.md with README maintenance guideline

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-24 15:22:34 -05:00
parent 1927f4d187
commit be99af3597
9 changed files with 150 additions and 166 deletions

25
CLAUDE.md Normal file
View File

@@ -0,0 +1,25 @@
# CLAUDE.md for go-llm
## Build and Test Commands
- Build project: `go build ./...`
- Run all tests: `go test ./...`
- Run specific test: `go test -v -run <TestName> ./...`
- Tidy dependencies: `go mod tidy`
## Code Style Guidelines
- **Indentation**: Use standard Go tabs for indentation.
- **Naming**:
- Use `camelCase` for internal/private variables and functions.
- Use `PascalCase` for exported types, functions, and struct fields.
- Interface names should be concise (e.g., `LLM`, `ChatCompletion`).
- **Error Handling**:
- Always check and handle errors immediately.
- Wrap errors with context using `fmt.Errorf("%w: ...", err)`.
- Use the project's internal `Error` struct in `error.go` when differentiating between error types is needed.
- **Project Structure**:
- `llm.go`: Contains core interfaces (`LLM`, `ChatCompletion`) and shared types (`Message`, `Role`, `Image`).
- Provider implementations are in `openai.go`, `anthropic.go`, and `google.go`.
- Schema definitions for tool calling are in the `schema/` directory.
- **Imports**: Organize imports into groups: standard library, then third-party libraries.
- **Documentation**: Use standard Go doc comments for exported symbols.
- **README.md**: The README.md file should always be kept up to date with any significant changes to the project.