Skip to content

Commit 82e4514

Browse files
docs(eino): add missing Role field in multimodal example (#1496)
1 parent 04e05b9 commit 82e4514

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

content/en/docs/eino/ecosystem_integration/chat_model/chat_model_openai.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,13 @@ func main() {
267267
})
268268
if err != nil { log.Fatalf("NewChatModel failed, err=%v", err) }
269269

270-
multi := &schema.Message{ UserInputMultiContent: []schema.MessageInputPart{
271-
{Type: schema.ChatMessagePartTypeText, Text: "this picture is a landscape photo, what's the picture's content"},
272-
{Type: schema.ChatMessagePartTypeImageURL, Image: &schema.MessageInputImage{ MessagePartCommon: schema.MessagePartCommon{ URL: of("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT11qEDxU4X_MVKYQVU5qiAVFidA58f8GG0bQ&s") }, Detail: schema.ImageURLDetailAuto }},
273-
} }
270+
multi := &schema.Message{
271+
Role: schema.User,
272+
UserInputMultiContent: []schema.MessageInputPart{
273+
{Type: schema.ChatMessagePartTypeText, Text: "this picture is a landscape photo, what's the picture's content"},
274+
{Type: schema.ChatMessagePartTypeImageURL, Image: &schema.MessageInputImage{MessagePartCommon: schema.MessagePartCommon{URL: of("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT11qEDxU4X_MVKYQVU5qiAVFidA58f8GG0bQ&s")}, Detail: schema.ImageURLDetailAuto}},
275+
},
276+
}
274277

275278
resp, err := chatModel.Generate(ctx, []*schema.Message{ multi })
276279
if err != nil { log.Fatalf("Generate failed, err=%v", err) }

content/zh/docs/eino/ecosystem_integration/chat_model/chat_model_openai.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ func main() {
289289
}
290290

291291
multiModalMsg := &schema.Message{
292+
Role: schema.User,
292293
UserInputMultiContent: []schema.MessageInputPart{
293294
{
294295
Type: schema.ChatMessagePartTypeText,

0 commit comments

Comments
 (0)