Skip to content

Commit

Permalink
Merge pull request #941 from Abirdcfly/icon
Browse files Browse the repository at this point in the history
feat: add app icon to conversation list
  • Loading branch information
bjwswang authored Mar 27, 2024
2 parents 0b9848c + 83779b3 commit 7a9b78f
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 2 deletions.
4 changes: 4 additions & 0 deletions apiserver/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2037,6 +2037,10 @@ const docTemplate = `{
"type": "string",
"example": "arcadia"
},
"icon": {
"description": "icon only valid in conversation list api",
"type": "string"
},
"id": {
"type": "string",
"example": "5a41f3ca-763b-41ec-91c3-4bbbb00736d0"
Expand Down
4 changes: 4 additions & 0 deletions apiserver/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,10 @@
"type": "string",
"example": "arcadia"
},
"icon": {
"description": "icon only valid in conversation list api",
"type": "string"
},
"id": {
"type": "string",
"example": "5a41f3ca-763b-41ec-91c3-4bbbb00736d0"
Expand Down
3 changes: 3 additions & 0 deletions apiserver/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ definitions:
app_namespace:
example: arcadia
type: string
icon:
description: icon only valid in conversation list api
type: string
id:
example: 5a41f3ca-763b-41ec-91c3-4bbbb00736d0
type: string
Expand Down
44 changes: 44 additions & 0 deletions apiserver/pkg/chat/chat_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/tmc/langchaingo/memory"
"github.com/tmc/langchaingo/prompts"
langchainschema "github.com/tmc/langchaingo/schema"
"golang.org/x/sync/errgroup"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -403,3 +404,46 @@ func (cs *ChatServer) GetApp(ctx context.Context, appName, appNamespace string)
}

// todo Reuse the flow without having to rebuild req same, not finish, Flow doesn't start with/contain nodes that depend on incomingInput.question

func (cs *ChatServer) FillAppIconToConversations(ctx context.Context, conversations *[]storage.Conversation) error {
if conversations == nil {
return nil
}
appMap := make(map[string]int, len(*conversations))
i := 0
for _, c := range *conversations {
key := fmt.Sprintf("%s/%s", c.AppNamespace, c.AppName)
if _, exist := appMap[key]; exist {
continue
}
appMap[key] = i
i++
}
result := make([]string, len(appMap))
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(10)
for key, index := range appMap {
key, index := key, index
g.Go(func() error {
app := &v1alpha1.Application{}
ns, name, ok := strings.Cut(key, "/")
if !ok {
return nil
}
err := cs.cli.Get(ctx, types.NamespacedName{Namespace: ns, Name: name}, app)
if err != nil {
return err
}
result[index] = app.Spec.Icon
return nil
})
}
if err := g.Wait(); err != nil {
return err
}
for i, c := range *conversations {
c.Icon = result[appMap[fmt.Sprintf("%s/%s", c.AppNamespace, c.AppName)]]
(*conversations)[i] = c
}
return nil
}
2 changes: 2 additions & 0 deletions apiserver/pkg/chat/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type Conversation struct {
User string `gorm:"column:user;type:string;comment:the conversation chat user" json:"-"`
Debug bool `gorm:"column:debug;type:bool;comment:debug mode" json:"-"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:time;comment:the time the conversation deleted at" json:"-"`
// icon only valid in conversation list api
Icon string `gorm:"-" json:"icon,omitempty"`
}

// Message represent a message in storage
Expand Down
6 changes: 5 additions & 1 deletion apiserver/service/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (cs *ChatService) ChatFile() gin.HandlerFunc {
c.JSON(http.StatusBadRequest, chat.ErrorResp{Err: err.Error()})
return
}
if pointer.BoolDeref(app.Spec.EnableUploadFile, false) {
if !pointer.BoolDeref(app.Spec.EnableUploadFile, true) {
c.JSON(http.StatusForbidden, chat.ErrorResp{Err: "file upload is not enabled"})
return
}
Expand Down Expand Up @@ -280,6 +280,10 @@ func (cs *ChatService) ListConversationHandler() gin.HandlerFunc {
c.JSON(http.StatusInternalServerError, chat.ErrorResp{Err: err.Error()})
return
}
if err := cs.server.FillAppIconToConversations(c, &resp); err != nil {
// note: fill app icon is try our best, don't need to return error
klog.FromContext(c.Request.Context()).Error(err, "error fill app icon to conversations")
}
klog.FromContext(c.Request.Context()).V(3).Info("list conversation done", "req", req)
c.JSON(http.StatusOK, resp)
}
Expand Down
1 change: 1 addition & 0 deletions config/samples/app_llmchain_chat_with_bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: base-chat-with-bot
namespace: arcadia
spec:
icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAF3tJREFUeF7tnXl0VEW+x7/VgbBvhrCFkEACsgiyuaCIAXX0eZSnzgMXumPgkc4ocJ7HOTo647yBdxzG8Zz3nOPCkA7jQN8EVFBBHQ8OKi4wIAIuyL5FiGwihBCCAbrrWQ1BCEn6Vt26ne57f/ecPvyR3+9X9ftWfbi36lbVZaCLFCAF6lWAkTakAClQvwIECPUOUqABBQgQ6h6kAAFCfYAUUFOA7iBqupGXSxQgQFzS0JSmmgIEiJpu5OUSBQgQlzQ0pammAAGipht5uUQBAsQlDU1pqilAgKjpRl4uUYAAcUlDU5pqChAgarqRl0sUIEBc0tCUppoCBIiabuTlEgUIEJc0NKWppgABoqYbeblEAQLEJQ1NaaopQICo6UZeLlGAAHFJQ1OaagoQIGq6kZdLFCBAXNLQlKaaAgSImm7k5RIFCBCXNDSlqaYAAaKmG3m5RAECxCUNTWmqKUCAqOlGXi5RgABxSUNTmmoKECBqupGXSxQgQFzS0JSmmgJxBci0adOaVVRUdw+Fwulq6ZCXbgU8nqTqUCi0t6RkTpnu2IkQr9EAmTBhWluPp/pWgN8KsCEATwdYaiKI5uI6Ckj2AuwDj4ctnTdv9kqnaxFzQHy+/HzAMxbgtwBo5nSBHZ5fGcDfBzwLDaPwXSfmGjNAcnML7uWcTwUw0olCUk54FcCLhhFY4S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Ki+OvZg3XSCsgXu9DlzMW+hxAm0QTguprpwJqa/DsrJHZ2FoBEYU++GD+2HCYKW+SN1txsksYBXYbRiBhvzmnHZBz45HHAfw5YZqQKmqbAk2bnkl7+eWX1ae9bKuZucC2AHL2TlIwKhzmH5urBlk5TQHGsM/jYTlz5xZuT+TcbANEiDJp0kO9Tp8+MxtgtySySFR3OQU454uKi4vGyXnFp7WtgIiUxdbJ8vIfnwKYmAbuEJ8yUK30KMDEioqXDKNwtp54jR/FdkBqUnzggYLeTZpgCud8KoCkxk+daqBRgT2M4cXmzfFSIBCo0hi30UPFDJCaTL1e/1DG2H8AXBzqRW/eG70LWKrAUsbYu8nJodfmzJlz0FKkOHWOOSAX6iA2XAFsHGNsCIC2AMSOQfGv+NEVFwqwM4zxCs5RAZz//YPzJouKi2ftiIsq2liJRgXExrwoNCmgRQECRIuMFMSpChAgTm1ZykuLAgSIFhkpiFMVIECc2rKUlxYFCBAtMlIQpypAgDi1ZSkvLQoQIFpkpCBOVYAAcWrLUl5aFCBAtMhIQZyqAAHi1JalvLQoQIBokZGCOFUBAsSpLUt5aVGAANEiIwVxqgIEiFNblvLSogABokVGCuJUBQgQp7Ys5aVFAQJEi4wUxKkKECBObVnKS4sCBIgWGSmIUxUgQJzaspSXFgUIEC0yUhCnKkCAOLVlKS8tChAgWmSkIE5VgABxastSXloUIEC0yEhBnKoAAeLUlqW8tChAgGiRkYI4VQECxKktS3lpUYAA0SIjBXGqAgSIU1uW8tKiAAGiRUYK4lQFCBCntizlpUUBAkSLjBTEqQoQIE5tWcpLiwL/Dx1aN5tr2/UlAAAAAElFTkSuQmCC
displayName: "对话机器人"
description: "和AI对话,品赛博人生"
prologue: "Hello, I am KubeAGI Bot🤖, Tell me something?"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ require (
github.com/tmc/langchaingo v0.1.3
github.com/valyala/fasthttp v1.51.0
github.com/vektah/gqlparser/v2 v2.5.10
golang.org/x/sync v0.5.0
gorm.io/driver/postgres v1.5.4
gorm.io/gorm v1.25.5
k8s.io/api v0.24.2
Expand Down Expand Up @@ -112,7 +113,6 @@ require (
go.opencensus.io v0.24.0 // indirect
go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/tools v0.16.1 // indirect
google.golang.org/api v0.152.0 // indirect
google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect
Expand Down
5 changes: 5 additions & 0 deletions tests/example-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,11 @@ info "8.4 check other chat rest api"
info "8.4.1 conversation list"
resp=$(curl --max-time $TimeoutSeconds -s --show-error -XPOST http://127.0.0.1:8081/chat/conversations --data '{"app_name": "base-chat-with-bot", "app_namespace": "arcadia"}')
echo $resp | jq .
icon=$(echo $resp | jq -r '.[0].icon')
if [[ $icon == "null" ]] || [[ -z $icon ]]; then
echo "should has icon."
exit 1
fi
delete_conversation_id=$(echo $resp | jq -r '.[0].id')
info "8.4.2 message list"
data=$(jq -n --arg conversationID "$delete_conversation_id" '{"conversation_id":$conversationID, "app_name": "base-chat-with-bot", "app_namespace": "arcadia"}')
Expand Down

0 comments on commit 7a9b78f

Please sign in to comment.