openai-go
openai-go copied to clipboard
The official Go library for the OpenAI API
Hi. I noticed that unmarshaling response_format field in ChatCompletionNewParams is incorrect due to a forgotten union registration. ```go package main import ( "fmt" "github.com/openai/openai-go" ) func main() { body :=...
I write a simple api to test the lib using Llama (vllm) as backend, everything work fine if I don't send a tool. I'm sure is not the model because...
this patch fixes an issue where some openai compatible clients return a tool json delta of "[]" when they are not performing tool requests. this tool call json is valid...
I was attempting to use this library in a Go project that is targeting WASI preview 2 and using Tinygo to compile to that target. Due to some unimplemented portions...
## Description The WithBaseURL function is not safe for concurrent use. When called from multiple goroutines simultaneously, it may generate URLs with double slashes (//) due to non-atomic path manipulation....
- fix the issue where the pollstatus was not working correctly - fix the issue where the vectorstoreid was not being passed correctly in example Error logs: ``` go run...
I love this helper ``` func (r Response) OutputText() string { var outputText strings.Builder for _, item := range r.Output { for _, content := range item.Content { if content.Type...
I first used the batch API, but found that I couldn't seem to upload files. So I'm wondering if there are any examples for me to refer to.
Can anyone provide an example of an inference model? There is no inference output field in openai.ChatCompletionChunkChoiceDelta. It can only be seen in json. Is there any way to extract...
Using the snippet below: ``` chunk = openai.ChatCompletionChunk{} err := json.Unmarshal([]byte(`[]`), &chunk) fmt.Printf("%+v\n", err) ``` The err is nil and the chunk is successfully unmarshalled, though it will have empty...