otiai10/openaigo

View on GitHub

Showing 4 of 9 total issues

Client has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

func (client *Client) ListModels(ctx context.Context) (resp ModelsListResponse, err error) {
    p := "/models"
    return call(ctx, client, http.MethodGet, p, nil, resp, nil)
}
Severity: Minor
Found in endpoints.go - About 3 hrs to fix

    Method ImageEditRequestBody.ToMultipartFormData has 7 return statements (exceeds 4 allowed).
    Open

    func (body ImageEditRequestBody) ToMultipartFormData() (buf *bytes.Buffer, contenttype string, err error) {
        if body.Image == nil {
            return nil, "", fmt.Errorf("body.Image must not be nil")
        }
        buf = bytes.NewBuffer(nil)
    Severity: Major
    Found in image.go - About 45 mins to fix

      Method Client.RetrieveFileContent has 5 return statements (exceeds 4 allowed).
      Open

      func (client *Client) RetrieveFileContent(ctx context.Context, id string) (res io.ReadCloser, err error) {
          endpoint, err := client.endpoint(fmt.Sprintf("/files/%s/content", id))
          if err != nil {
              return nil, err
          }
      Severity: Major
      Found in endpoints.go - About 35 mins to fix

        Method Funcs.invoke has 5 return statements (exceeds 4 allowed).
        Open

        func (funcs Funcs) invoke(invocation Invocation) any {
            f, ok := funcs[invocation.Name()]
            if !ok {
                return fmt.Sprintf("function not found: `%s`", invocation.Name())
            }
        Severity: Major
        Found in functioncall/invoke.go - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language