Skip to content

Commit

Permalink
document mime type being passed in experiments (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 authored Jan 16, 2025
1 parent 98815a1 commit 7cfffa3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/evaluation/how_to_guides/evaluate_with_attachments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,12 @@ def file_qa(inputs, attachments): # Read the audio bytes from the reader and enc
`,
`The target function you are evaluating must have two positional arguments in order to consume the attachments associated with the example, the first must be called \`inputs\` and the second must be called \`attachments\`.
- The \`inputs\` argument is a dictionary that contains the input data for the example, excluding the attachments.
- The \`attachments\` argument is a dictionary that maps the attachment name to a dictionary containing a presigned url and a reader of the bytes content of the file. Either can be used to read the bytes of the file:
- The \`attachments\` argument is a dictionary that maps the attachment name to a dictionary containing a presigned url, mime_type, and a reader of the bytes content of the file. You can use either the presigned url or the reader to get the file contents.
Each value in the attachments dictionary is a dictionary with the following structure:
\`\`\`
{
"presigned_url": str,
"mime_type": str,
"reader": BinaryIO
}
\`\`\`
Expand Down Expand Up @@ -310,8 +311,9 @@ image_answer: imageCompletion.choices[0].message.content,
`In the TypeScript SDK, the \`config\` argument is used to pass in the attachments to the target function if \`includeAttachments\` is set to \`true\`.\n
The \`config\` will contain \`attachments\` which is an object mapping the attachment name to an object of the form:\n
\`\`\`
{\n
{
presigned_url: string,
mime_type: string,
}
\`\`\``
),
Expand Down

0 comments on commit 7cfffa3

Please sign in to comment.