mirror of
https://github.com/mudler/LocalAI.git
synced 2026-04-03 22:51:38 -04:00
fix(realtime): Send proper image data to backend (#8547)
* fix(realtime): Allow empty parameters Signed-off-by: Richard Palethorpe <io@richiejp.com> * fix(realtime): Just pass base64 string to backend Signed-off-by: Richard Palethorpe <io@richiejp.com> --------- Signed-off-by: Richard Palethorpe <io@richiejp.com>
This commit is contained in:
committed by
GitHub
parent
2fd026e958
commit
5bdbb10593
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/mudler/LocalAI/core/templates"
|
||||
laudio "github.com/mudler/LocalAI/pkg/audio"
|
||||
"github.com/mudler/LocalAI/pkg/functions"
|
||||
"github.com/mudler/LocalAI/pkg/utils"
|
||||
"github.com/mudler/LocalAI/pkg/grpc/proto"
|
||||
model "github.com/mudler/LocalAI/pkg/model"
|
||||
"github.com/mudler/LocalAI/pkg/reasoning"
|
||||
@@ -949,7 +950,12 @@ func triggerResponse(session *Session, conv *Conversation, c *LockedWebsocket, o
|
||||
case types.MessageContentTypeInputAudio:
|
||||
textContent += content.Transcript
|
||||
case types.MessageContentTypeInputImage:
|
||||
msg.StringImages = append(msg.StringImages, content.ImageURL)
|
||||
img, err := utils.GetContentURIAsBase64(content.ImageURL)
|
||||
if err != nil {
|
||||
xlog.Warn("Failed to process image", "error", err)
|
||||
continue
|
||||
}
|
||||
msg.StringImages = append(msg.StringImages, img)
|
||||
imgIndex++
|
||||
nrOfImgsInMessage++
|
||||
}
|
||||
|
||||
@@ -175,8 +175,8 @@ type ToolFunction struct {
|
||||
// The description of the function, including guidance on when and how to call it, and guidance about what to tell the user when calling (if anything).
|
||||
Description string `json:"description"`
|
||||
|
||||
// The type of the tool, i.e. function.
|
||||
Parameters any `json:"parameters"`
|
||||
// The jsonschema representing the parameters
|
||||
Parameters any `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
func (t ToolFunction) ToolType() ToolType {
|
||||
|
||||
Reference in New Issue
Block a user