Outputting LLM calls to PDF viewer

Hey! Is it possible to have the outputs of AIP logic functions be directed to a PDF that is downloadable (and possibly viewable through a PDF viewer widget in workshop)?

1 Like

Hi! You need an object set that stores that AIP logic output in an attachment. You can do this using a function that creates a new objects and assigns the output to the attachment property. The newly created attachment can be viewed in workshop using the following widget: https://www.palantir.com/docs/foundry/workshop/widgets-pdf-viewer.

documentation for how to create the attachment in functions: https://www.palantir.com/docs/foundry/functions/api-attachments#create-attachments

How do I grab the output of the logic function and give it to an object?

Another widget similar to PDF viewer is an embedded notepad document

You can view your object properties in a word style document.

In this notional example I have an object type (email) with properties (email id, date/time sent, to, body, etc)

i am able to insert these object properties within my document. (as is shown via the inserting of the body property of the email object type)

just food for thought!

1 Like

Thanks! Any advice on how to insert these properties dynamically? (Upon the execution of an AIP Logic Function)

One way I did it was:

  1. Make AIP logic function
  2. Back an action with AIP logic function (screenshot)
  3. Make workshop widget 1 (button group)
  4. Button group Widget setup
    • on click β€”> action you just made on step 2
    • parameter defaults β€”> workshop app variables to match your AIP logic function input
  5. Make a workshop widget 2 (notepad template)
    • Make a template that has whatever properties you want to display
    • https://www.palantir.com/docs/foundry/notepad/templates-overview/

hopefully this gets you started.

Do you need to be able to have a new template each time?

1 Like

Something that you can do is find a way to create it as an object that holds the PDF and then in workshop display that object as a list and it’ll show the PDF objects!

2 Likes

This thread is fabulous! You all have really helpful insights.

To add on, what I ended up doing was (1) I parsed relevant PDF output into a new object set in pipeline builder, then (2) went back to the workshop display where I created two new widgets, an object list and an object viewer. Then, I (3) set the on-click event for the viewer to set the clicked object as the active object, and set the viewer to always display the on-click active object. That way, I had a consistent way of viewing the output. :slightly_smiling_face: