File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -393,12 +393,12 @@ func (c *Client) CreateChatCompletion(
393
393
if err = validateRequestForO1Models (request ); err != nil {
394
394
return
395
395
}
396
-
397
396
req , err := c .newRequest (
398
397
ctx ,
399
398
http .MethodPost ,
400
399
c .fullURL (urlSuffix , withModel (request .Model )),
401
400
withBody (request ),
401
+ withCustomHeaders (request .Metadata ),
402
402
)
403
403
if err != nil {
404
404
return
Original file line number Diff line number Diff line change @@ -90,6 +90,14 @@ func withContentType(contentType string) requestOption {
90
90
}
91
91
}
92
92
93
+ func withCustomHeaders (headers map [string ]string ) requestOption {
94
+ return func (args * requestOptions ) {
95
+ for key , value := range headers {
96
+ args .header .Set (key , value )
97
+ }
98
+ }
99
+ }
100
+
93
101
func withBetaAssistantVersion (version string ) requestOption {
94
102
return func (args * requestOptions ) {
95
103
args .header .Set ("OpenAI-Beta" , fmt .Sprintf ("assistants=%s" , version ))
You can’t perform that action at this time.
0 commit comments