openai-go
openai-go copied to clipboard
The official Go library for the OpenAI API
Hey there! I'm missing the [rate limit headers](https://platform.openai.com/docs/guides/rate-limits) from the new `Responses` API, they used to be returned from the request with the `Completions` API. Here is what I call:...
i have a function to integrate the history messages. how to do? ``` func (ai AIOfficialGPT) ParseMessages(q *AIParams) []openai.ChatCompletionMessageParamUnion { // system prompt messages := make([]openai.ChatCompletionMessageParamUnion, 0) if len(q.PromptSystem) >...
Hi, It's not go SDK specific, but publishing here as I don't know where should I report API issues. Sometimes it's painful to build tool call requests and responses in...
`examples/beta/assistant-streaming/main.go` sends a query requesting a streamed response. But the code that handles the stream just prints the type of each streamed chunk: ``` for stream.Next() { evt := stream.Current()...
When using the openai-go SDK to create a chat completion with a ChatCompletionAssistantMessageParamContentUnion that includes OfArrayOfContentParts in combination with tool calling & a PDF docucment, the API returns a 400...
Similar to https://github.com/openai/openai-openapi/issues/424 The `embedding` field of the `Embedding` object will be a string, if `encoding_format` is set to `base64`. E.g. ```shell curl -v https://api.openai.com/v1/embeddings \ -H "Authorization: Bearer $OPENAI_API_KEY"...
## 🐛 Bug: ChatCompletion fails with 400 error when prompt contains special characters ### Description When using the `ChatCompletion` function from the `openai_go` library, requests fail with a `400 Bad...
I got a demo of this working and I would like to merge it if there is interest.
I'm trying to create a filter that uses nested compound filters, similar to what is [described in the docs](https://platform.openai.com/docs/guides/retrieval#attribute-filtering): ```json { "type": "or", "filters": [ { "type": "and", "filters": [...
I am getting invalid JSON strings return using Structured Outputs. Unfortunately I cannot share the example because it contains private information. The code I am using is based on the...