Documentation
¶
Index ¶
- type AuthedRequest
- func (rb *AuthedRequest) Build(ctx context.Context) (*http.Request, error)
- func (rb *AuthedRequest) BuildGet(ctx context.Context) (*http.Request, error)
- func (rb *AuthedRequest) BuildStream(ctx context.Context) (*http.Request, error)
- func (rb *AuthedRequest) SetBaseURL(BaseURL string) *AuthedRequest
- func (rb *AuthedRequest) SetBodyFromStruct(data interface{}) *AuthedRequest
- func (rb *AuthedRequest) SetPath(path string) *AuthedRequest
- type AuthedRequestBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthedRequest ¶
AuthedRequest represents an authenticated HTTP request.
func NewRequestBuilder ¶
func NewRequestBuilder(authToken string) *AuthedRequest
NewRequestBuilder initializes a new RequestBuilder.
func (*AuthedRequest) BuildStream ¶ added in v0.1.1
BuildStream constructs the HTTP request for a streaming response [Method:Post].
func (*AuthedRequest) SetBaseURL ¶
func (rb *AuthedRequest) SetBaseURL(BaseURL string) *AuthedRequest
SetBaseURL sets the base URL for the request.
func (*AuthedRequest) SetBodyFromStruct ¶
func (rb *AuthedRequest) SetBodyFromStruct(data interface{}) *AuthedRequest
SetBodyFromStruct sets the request body from a struct, marshaling it to JSON. transform interface to ChatCompletionRequest
func (*AuthedRequest) SetPath ¶
func (rb *AuthedRequest) SetPath(path string) *AuthedRequest
SetPath sets the path for the request.
type AuthedRequestBuilder ¶
type AuthedRequestBuilder interface { SetBaseURL(string) *AuthedRequest SetPath(string) *AuthedRequest SetBodyFromStruct(interface{}) *AuthedRequest Build(context.Context) (*http.Request, error) }
AuthedRequestBuilder is an interface for building authenticated requests.
Click to show internal directories.
Click to hide internal directories.