Skip to content

Commit

Permalink
Remove duplicate imports (#27886)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmb3 authored and jakule committed Jun 29, 2023
1 parent a622f83 commit 587046c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions integrations/operator/controllers/resources/testlib/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
core "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiruntime "k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand All @@ -55,7 +54,7 @@ import (
var scheme = apiruntime.NewScheme()

func init() {
utilruntime.Must(v1.AddToScheme(scheme))
utilruntime.Must(core.AddToScheme(scheme))
utilruntime.Must(resourcesv1.AddToScheme(scheme))
utilruntime.Must(resourcesv2.AddToScheme(scheme))
utilruntime.Must(resourcesv3.AddToScheme(scheme))
Expand Down
7 changes: 3 additions & 4 deletions lib/assist/assist.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/gravitational/teleport/api/gen/proto/go/assist/v1"
assistpb "github.com/gravitational/teleport/api/gen/proto/go/assist/v1"
pluginsv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/plugins/v1"
"github.com/gravitational/teleport/lib/ai"
"github.com/gravitational/teleport/lib/ai/model"
Expand Down Expand Up @@ -123,7 +122,7 @@ func (a *Assist) GenerateSummary(ctx context.Context, message string) (string, e
// loadMessages loads the messages from the database.
func (c *Chat) loadMessages(ctx context.Context) error {
// existing conversation, retrieve old messages
messages, err := c.authClient.GetAssistantMessages(ctx, &assistpb.GetAssistantMessagesRequest{
messages, err := c.authClient.GetAssistantMessages(ctx, &assist.GetAssistantMessagesRequest{
ConversationId: c.ConversationID,
Username: c.Username,
})
Expand Down Expand Up @@ -196,8 +195,8 @@ func (c *Chat) ProcessComplete(ctx context.Context,

// write the user message to persistent storage and the chat structure
c.chat.Insert(openai.ChatMessageRoleUser, userInput)
if err := c.authClient.CreateAssistantMessage(ctx, &assistpb.CreateAssistantMessageRequest{
Message: &assistpb.AssistantMessage{
if err := c.authClient.CreateAssistantMessage(ctx, &assist.CreateAssistantMessageRequest{
Message: &assist.AssistantMessage{
Type: string(MessageKindUserMessage),
Payload: userInput, // TODO(jakule): Sanitize the payload
CreatedTime: timestamppb.New(c.assist.clock.Now().UTC()),
Expand Down

0 comments on commit 587046c

Please sign in to comment.