Golang http api return an Error: socket hang up #1208
Unanswered
zarkopopovski
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my Go API, I'm making a request to OpenAI, but I can't return the OpenAI response as the response of my endpoint. My endpoint is returning an empty response along with the error: 'socket hang up'. What's interesting is that the API isn't throwing any errors, it just closes the socket. How can I fix this issue?
This is the code:
output, err := llm.GenerateContent(ctx, content,
llms.WithMaxTokens(1024),
llms.WithTemperature(0),
)
if err != nil {
log.Fatal(err)
}
I tried setting up logs and catching errors, but there’s no error — the API just isn't returning anything. Is anyone else experiencing a similar problem?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions