openai-go icon indicating copy to clipboard operation
openai-go copied to clipboard

Invalid Library v2 Installation Instruction

Open flashlabs opened this issue 4 months ago • 2 comments

User Story:

  • As "Engineer"
  • I want "to be able to install the pinned version as it is described in the README.md file"
  • So "I don't have to figure out what's wrong with the installation instruction"

Acceptance Criteria:

  • The "Installation" instruction in the section "Or to pin the version:" is ready to be copied and run without any issues

Background:

  • Currently when run as-is in the documentation it returns an error:
go get -u 'github.com/openai/[email protected]'
go: github.com/openai/[email protected]: invalid version: go.mod has post-v2 module path "github.com/openai/openai-go/v2" at revision v2.1.0

flashlabs avatar Aug 20 '25 10:08 flashlabs

After executing the go mod tidy, the problem was resolved.

It seems that the problem lies in a version in the go.mod file that does not match the version specified by go get - u xxx@version

Kain-90 avatar Sep 01 '25 08:09 Kain-90

From what I've investigated it just requires a v2 suffix to be added in the package name go get -u 'github.com/openai/openai-go/[email protected]'

flashlabs avatar Sep 01 '25 09:09 flashlabs