Add OpenAI Mock Server (#31)
* add constants for completions, refactor usage, add test server Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com> * append v1 endpoint to test Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com> * add makefile for easy targets Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com> * lint files & add linter Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com> * disable real API tests in short mode Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com> Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
This commit is contained in:
6
api.go
6
api.go
@@ -15,7 +15,7 @@ func newTransport() *http.Client {
|
||||
}
|
||||
}
|
||||
|
||||
// Client is OpenAI GPT-3 API client
|
||||
// Client is OpenAI GPT-3 API client.
|
||||
type Client struct {
|
||||
BaseURL string
|
||||
HTTPClient *http.Client
|
||||
@@ -23,7 +23,7 @@ type Client struct {
|
||||
idOrg string
|
||||
}
|
||||
|
||||
// NewClient creates new OpenAI API client
|
||||
// NewClient creates new OpenAI API client.
|
||||
func NewClient(authToken string) *Client {
|
||||
return &Client{
|
||||
BaseURL: apiURLv1,
|
||||
@@ -33,7 +33,7 @@ func NewClient(authToken string) *Client {
|
||||
}
|
||||
}
|
||||
|
||||
// NewOrgClient creates new OpenAI API client for specified Organization ID
|
||||
// NewOrgClient creates new OpenAI API client for specified Organization ID.
|
||||
func NewOrgClient(authToken, org string) *Client {
|
||||
return &Client{
|
||||
BaseURL: apiURLv1,
|
||||
|
||||
Reference in New Issue
Block a user