MCPcopy
hub / github.com/openai/openai-go / WithQuery

Function WithQuery

option/requestoption.go:139–146  ·  view source on GitHub ↗

WithQuery returns a RequestOption that sets the query value to the associated key. It overwrites any value if there was one already present.

(key, value string)

Source from the content-addressed store, hash-verified

137// WithQuery returns a RequestOption that sets the query value to the associated key. It overwrites
138// any value if there was one already present.
139func WithQuery(key, value string) RequestOption {
140 return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error {
141 query := r.Request.URL.Query()
142 query.Set(key, value)
143 r.Request.URL.RawQuery = query.Encode()
144 return nil
145 })
146}
147
148// WithQueryAdd returns a RequestOption that adds the query value to the associated key. It appends
149// onto any existing values.

Callers 3

GetNextPageMethod · 0.92
GetNextPageMethod · 0.92
GetNextPageMethod · 0.92

Calls 2

RequestOptionFuncFuncType · 0.92
EncodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…