Documentation
¶
Index ¶
Constants ¶
View Source
const ( EndpointCompletion = "/chat/completions" EndpointSearch = "/search" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChatCompletionResponse ¶
type ChatCompletionResponse struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Model string `json:"model"` Choices []Choice `json:"choices"` Usage Usage `json:"usage"` SystemFingerprint string `json:"system_fingerprint"` }
func HandleResponse ¶
func HandleResponse(resp *http.Response) (*ChatCompletionResponse, error)
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
func NewRequestBuilder ¶
func NewRequestBuilder(authToken string) *RequestBuilder
NewRequestBuilder initializes a new RequestBuilder.
func (*RequestBuilder) SetBaseURL ¶
func (rb *RequestBuilder) SetBaseURL(baseURL string) *RequestBuilder
SetBaseURL sets the base URL for the request.
func (*RequestBuilder) SetBodyFromStruct ¶
func (rb *RequestBuilder) SetBodyFromStruct(data interface{}) *RequestBuilder
transform interface to ChatCompletionRequest
func (*RequestBuilder) SetPath ¶
func (rb *RequestBuilder) SetPath(path string) *RequestBuilder
SetPath sets the path for the request.
Click to show internal directories.
Click to hide internal directories.