Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
chore(all): arrange imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pinglin committed Sep 23, 2024
1 parent 9dc9b88 commit bfac7f7
Show file tree
Hide file tree
Showing 208 changed files with 552 additions and 279 deletions.
3 changes: 2 additions & 1 deletion ai/anthropic/v0/client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package anthropic

import (
"github.com/instill-ai/component/internal/util/httpclient"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/internal/util/httpclient"
)

type anthropicClient struct {
Expand Down
3 changes: 2 additions & 1 deletion ai/anthropic/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"net/http/httptest"
"testing"

qt "github.com/frankban/quicktest"
"google.golang.org/protobuf/types/known/structpb"

qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/base"
"github.com/instill-ai/component/internal/util/httpclient"
"github.com/instill-ai/x/errmsg"
Expand Down
3 changes: 2 additions & 1 deletion ai/anthropic/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package anthropic

import (
"context"
_ "embed"
"fmt"
"slices"
"sync"

_ "embed"

"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"
Expand Down
3 changes: 2 additions & 1 deletion ai/archetypeai/v0/client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package archetypeai

import (
"github.com/instill-ai/component/internal/util/httpclient"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/internal/util/httpclient"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions ai/archetypeai/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"net/http/httptest"
"testing"

"google.golang.org/protobuf/types/known/structpb"

qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/base"
"github.com/instill-ai/component/internal/util/httpclient"
"github.com/instill-ai/x/errmsg"

"google.golang.org/protobuf/types/known/structpb"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions ai/archetypeai/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ package archetypeai
import (
"bytes"
"context"
_ "embed"
"fmt"
"strings"
"sync"

"google.golang.org/protobuf/types/known/structpb"
_ "embed"

"github.com/gofrs/uuid"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"
"github.com/instill-ai/component/internal/util"
"github.com/instill-ai/component/internal/util/httpclient"
Expand Down
5 changes: 3 additions & 2 deletions ai/cohere/v0/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"context"
"sync"

cohereSDK "github.com/cohere-ai/cohere-go/v2"
cohereClientSDK "github.com/cohere-ai/cohere-go/v2/client"
"github.com/cohere-ai/cohere-go/v2/core"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

cohereSDK "github.com/cohere-ai/cohere-go/v2"
cohereClientSDK "github.com/cohere-ai/cohere-go/v2/client"
)

type cohereClient struct {
Expand Down
6 changes: 4 additions & 2 deletions ai/cohere/v0/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"sync"
"testing"

"go.uber.org/zap"

cohereSDK "github.com/cohere-ai/cohere-go/v2"
"github.com/cohere-ai/cohere-go/v2/core"
qt "github.com/frankban/quicktest"
"go.uber.org/zap"

"github.com/cohere-ai/cohere-go/v2/core"
)

func newMockClient() *cohereClient {
Expand Down
6 changes: 4 additions & 2 deletions ai/cohere/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"fmt"
"testing"

"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

cohereSDK "github.com/cohere-ai/cohere-go/v2"
qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/base"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion ai/cohere/v0/embedding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package cohere
import (
"fmt"

"google.golang.org/protobuf/types/known/structpb"

cohereSDK "github.com/cohere-ai/cohere-go/v2"

"github.com/instill-ai/component/base"
"google.golang.org/protobuf/types/known/structpb"
)

type EmbeddingInput struct {
Expand Down
7 changes: 5 additions & 2 deletions ai/cohere/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ package cohere

import (
"context"
_ "embed"
"fmt"
"sync"

_ "embed"

"google.golang.org/protobuf/types/known/structpb"

cohereSDK "github.com/cohere-ai/cohere-go/v2"

"github.com/instill-ai/component/base"
"google.golang.org/protobuf/types/known/structpb"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion ai/cohere/v0/rerank.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package cohere
import (
"fmt"

"google.golang.org/protobuf/types/known/structpb"

cohereSDK "github.com/cohere-ai/cohere-go/v2"

"github.com/instill-ai/component/base"
"google.golang.org/protobuf/types/known/structpb"
)

type RerankInput struct {
Expand Down
4 changes: 3 additions & 1 deletion ai/cohere/v0/text_generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package cohere
import (
"fmt"

"google.golang.org/protobuf/types/known/structpb"

cohereSDK "github.com/cohere-ai/cohere-go/v2"

"github.com/instill-ai/component/base"
"google.golang.org/protobuf/types/known/structpb"
)

type ChatMessage struct {
Expand Down
3 changes: 2 additions & 1 deletion ai/fireworksai/v0/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package fireworksai
import (
"fmt"

"github.com/instill-ai/component/internal/util/httpclient"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/internal/util/httpclient"
)

const (
Expand Down
1 change: 1 addition & 0 deletions ai/fireworksai/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/base"
)

Expand Down
6 changes: 4 additions & 2 deletions ai/fireworksai/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package fireworksai

import (
"context"
_ "embed"
"fmt"
"sync"

"github.com/instill-ai/component/base"
_ "embed"

"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion ai/fireworksai/v0/tasks.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package fireworksai

import (
"github.com/instill-ai/component/base"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"
)

const (
Expand Down
6 changes: 4 additions & 2 deletions ai/fireworksai/v0/tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"fmt"
"testing"

qt "github.com/frankban/quicktest"
"github.com/gojuno/minimock/v3"
"github.com/instill-ai/component/base"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/base"
)

func TestComponent_Tasks(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion ai/groq/v0/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package groq
import (
"fmt"

"github.com/instill-ai/component/internal/util/httpclient"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/internal/util/httpclient"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion ai/groq/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package groq

import (
"context"
_ "embed"
"fmt"
"sync"

_ "embed"

"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"
Expand Down
3 changes: 2 additions & 1 deletion ai/groq/v0/tasks.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package groq

import (
"github.com/instill-ai/component/base"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"
)

type TaskTextGenerationChatInput struct {
Expand Down
3 changes: 2 additions & 1 deletion ai/huggingface/v0/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"strings"

"github.com/go-resty/resty/v2"
"github.com/instill-ai/component/internal/util/httpclient"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/internal/util/httpclient"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion ai/huggingface/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"net/http/httptest"
"testing"

qt "github.com/frankban/quicktest"
"google.golang.org/protobuf/types/known/structpb"

qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/base"
"github.com/instill-ai/component/internal/util/httpclient"
"github.com/instill-ai/x/errmsg"
Expand Down
3 changes: 2 additions & 1 deletion ai/huggingface/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package huggingface

import (
"context"
_ "embed"
"encoding/base64"
"encoding/json"
"fmt"
"sync"

_ "embed"

"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/types/known/structpb"

Expand Down
1 change: 1 addition & 0 deletions ai/instill/v0/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/internal/util"

modelPB "github.com/instill-ai/protogen-go/model/model/v1alpha"
)

Expand Down
3 changes: 2 additions & 1 deletion ai/instill/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package instill

import (
"context"
_ "embed"
"fmt"
"strings"
"sync"
"time"

_ "embed"

"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/structpb"
Expand Down
1 change: 1 addition & 0 deletions ai/instill/v0/text_generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"

modelPB "github.com/instill-ai/protogen-go/model/model/v1alpha"
)

Expand Down
2 changes: 1 addition & 1 deletion ai/instill/v0/text_generation_chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/base64"
"fmt"

"github.com/gabriel-vasile/mimetype"
"google.golang.org/protobuf/types/known/structpb"

"github.com/gabriel-vasile/mimetype"
"github.com/instill-ai/component/ai/openai/v0"
"github.com/instill-ai/component/base"

Expand Down
1 change: 1 addition & 0 deletions ai/instill/v0/text_to_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"

modelPB "github.com/instill-ai/protogen-go/model/model/v1alpha"
)

Expand Down
1 change: 1 addition & 0 deletions ai/instill/v0/vision.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"

"github.com/instill-ai/component/base"

modelPB "github.com/instill-ai/protogen-go/model/model/v1alpha"
)

Expand Down
3 changes: 2 additions & 1 deletion ai/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ package ai
import (
"testing"

qt "github.com/frankban/quicktest"
"github.com/gofrs/uuid"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/structpb"

qt "github.com/frankban/quicktest"

"github.com/instill-ai/component/ai/openai/v0"
"github.com/instill-ai/component/base"
"github.com/instill-ai/x/errmsg"
Expand Down
Loading

0 comments on commit bfac7f7

Please sign in to comment.