openai-go
openai-go copied to clipboard
The official Go library for the OpenAI API
I want to send files too along with the prompt, so that ai can use that file content and prompt to give the result. I hope it will be considered.
Similar to the PR #435 The parameters are inverted.
# **Description** This PR fixes a panic in `retryDelay` that occurs when the computed `delay` becomes negative due to integer overflow in `time.Duration` for large `retryCount` values # **Problem** *...
## Minimal failing test to reproduce : ``` func Test_Unmarshalling_Output_Text1(t *testing.T) { /* Initial request : { "include": [ "reasoning.encrypted_content" ], "input": [ { "role": "user", "content": [ { "text":...
need an example for conversation history contains image for openai-go v2.*
Added the reasoning content field for the `ChatCompletionChunkChoiceDelta`: ```go // A chat completion delta generated by streamed model responses. type ChatCompletionChunkChoiceDelta struct { ... ReasoningContent string `json:"reasoning_content,nullable"` ... } ```...
I want to stop serializing empty fields, because it breaks openai compatibility downstream, and the openai client in JS cant parse the input properly. This is exclusively for the streaming...
As of now, it is only adding: - CompletionTokens - PromptTokens - TotalTokens
request audio param: audioConfig := realtime.RealtimeAudioConfigParam{ Input: realtime.RealtimeAudioConfigInputParam{ Format: "pcm16", NoiseReduction: realtime.RealtimeAudioConfigInputNoiseReductionParam{ Type: "near_field", }, }, Output: realtime.RealtimeAudioConfigOutputParam{ Format: "pcm16", Voice: "alloy", Speed: openai.Float(1.0), }, } http body log: {"expires_after":{"seconds":10,"anchor":"created_at"},"session":{"model":"gpt-4o-mini-realtime-preview-2024-12-17","instructions":"You...
It seems that the chat completion struct in this repo is missing a field that is recorded in the openai platform's response. The openai docs and ChatCompletion struct https://github.com/openai/openai-[go/blob/c6f74f0a573e87895f699b1e4b89274108be205a/chatcompletion.go#L166](https://www.golinks.io/blob/c6f74f0a573e87895f699b1e4b89274108be205a/chatcompletion.go#L166?trackSource=github) don't...