MCPcopy
hub / github.com/docker/docker-agent / TestUserMessageWithPDFDocument

Function TestUserMessageWithPDFDocument

pkg/app/transcript/transcript_test.go:106–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestUserMessageWithPDFDocument(t *testing.T) {
107 t.Parallel()
108 msg := session.UserMessage(
109 "Summarise this PDF",
110 chat.MessagePart{Type: chat.MessagePartTypeText, Text: "Summarise this PDF"},
111 chat.MessagePart{
112 Type: chat.MessagePartTypeDocument,
113 Document: &chat.Document{
114 Name: "report.pdf",
115 MimeType: "application/pdf",
116 Size: 251658, // ~245 KB
117 Source: chat.DocumentSource{InlineData: []byte{0x25, 0x50, 0x44, 0x46}},
118 },
119 },
120 )
121 sess := session.New()
122 sess.AddMessage(msg)
123 content := PlainText(sess)
124 golden.Assert(t, content, "user_message_pdf_document.golden")
125}
126
127func TestUserMessageWithTextDocument(t *testing.T) {
128 t.Parallel()

Callers

nothing calls this directly

Calls 5

UserMessageFunction · 0.92
NewFunction · 0.92
PlainTextFunction · 0.85
AssertMethod · 0.80
AddMessageMethod · 0.65

Tested by

no test coverage detected