Skip to content

Commit fcf9a72

Browse files
Add the missing required parameter
1 parent 16ddb3d commit fcf9a72

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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) }

0 commit comments

Comments
 (0)