tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
4.17k stars 582 forks source link

The endpoints of gpt-3.5-turbo-instruct model are different. #995

Open nagisa599 opened 3 weeks ago

nagisa599 commented 3 weeks ago
model ,err := openai.New(openai.WithToken(openapikey.OpenApikey), openai.WithModel("gpt-3.5-turbo-instruct"))
    if err != nil {
        log.Fatal(err)
    }
    completion, err := llms.GenerateFromSinglePrompt(ctx, 
        model, 
        "What is the capital of Japan?",
        llms.WithTemperature(0.5),
        llms.WithStopWords([]string{"\n"}))
2024/08/19 17:07:58 API returned unexpected status code: 404: This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
exit status 1

The chat/completions endpoint is hit as shown below.

tz3 commented 3 weeks ago

Are you sure about the OpenApikey you have inserted correctly?