- Migrate `compress_image.go` to `internal/imageutil` for better encapsulation. - Reorganize LLM provider implementations into distinct packages (`google`, `openai`, and `anthropic`). - Replace `go_llm` package name with `llm`. - Refactor internal APIs for improved clarity, including renaming `anthropic` to `anthropicImpl` and `google` to `googleImpl`. - Add helper methods and restructure message handling for better separation of concerns.
22 lines
364 B
Go
22 lines
364 B
Go
package llm
|
|
|
|
import "fmt"
|
|
|
|
// Error is essentially just an error, but it is used to differentiate between a normal error and a fatal error.
|
|
type Error struct {
|
|
error
|
|
|
|
Source error
|
|
Parameter error
|
|
}
|
|
|
|
func newError(parent error, err error) Error {
|
|
e := fmt.Errorf("%w: %w", parent, err)
|
|
return Error{
|
|
error: e,
|
|
|
|
Source: parent,
|
|
Parameter: err,
|
|
}
|
|
}
|