-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Hi,
I was trying to use workspace documents in user message doing something like this -
fileBlocks := []anthropic.BetaContentBlockParamUnion{}
for _, fileId := range fileIds {
fileBlocks = append(fileBlocks, anthropic.BetaContentBlockParamUnion{
OfDocument: &anthropic.BetaRequestDocumentBlockParam{
Source: anthropic.BetaRequestDocumentBlockSourceUnionParam{
OfFile: &anthropic.BetaFileDocumentSourceParam{
FileID: fileId,
},
},
CacheControl: anthropic.NewBetaCacheControlEphemeralParam(),
},
})
}
messages := []anthropic.BetaMessageParam{
anthropic.NewBetaUserMessage(
fileBlocks...,
),
anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock(prompt)),
}I am getting this error -
{
type: 'error',
error: {
type: 'invalid_request_error',
message: "messages.0.content.0.document.source: Input tag 'file' found using 'type' does not match any of the expected tags: 'base64', 'content', 'text', 'url'"
},
request_id: 'req_011CTR6XtLRRed3fcm7ad2Mr'
}Is this not supported yet? or should the message be constructed in another way?
ferranbt
Metadata
Metadata
Assignees
Labels
No labels