Skip to content

Commit

Permalink
Render Attachment before Data When Both Exist in Input (#1397)
Browse files Browse the repository at this point in the history
# Render Attachment before Data When Both Exist in Input

See comment in
#1396 (review)

When we have a Prompt Input with both attachment and data, most likely
the attachment will be the main focus (e.g. Visual Question Answering)
so we can show it first in the prompt input:

![Screenshot 2024-03-04 at 5 08 17
PM](https://github.com/lastmile-ai/aiconfig/assets/5060851/40ec0a8d-9255-44b7-aebb-f0e46dee44aa)
![Screenshot 2024-03-04 at 5 08 44
PM](https://github.com/lastmile-ai/aiconfig/assets/5060851/9568cae3-e48f-4a1d-a608-e011234c83b4)

Was initially thinking we could order it based on the properties order
in the schema, but just doing this for now since property order in
schema may not be guaranteed when we define it in python and then
serialize it to to client (will just be passing JSON object in response)

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1397).
* __->__ #1397
* #1396
  • Loading branch information
rholinshead authored Mar 4, 2024
2 parents c843134 + f2953f5 commit 47014f2
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ function SchemaRenderer({ input, schema, onChangeInput }: SchemaRendererProps) {

return (
<Flex direction="column">
{dataSchema && (
<DataRenderer
schema={dataSchema}
data={data}
onChangeData={onChangeData}
/>
)}
{attachmentsSchema && (
<AttachmentsRenderer
schema={attachmentsSchema}
onChangeAttachments={onChangeAttachments}
attachments={attachments ?? []}
/>
)}
{dataSchema && (
<DataRenderer
schema={dataSchema}
data={data}
onChangeData={onChangeData}
/>
)}
{/* <JSONRenderer properties={restProperties} data={restData}/> */}
</Flex>
);
Expand Down

0 comments on commit 47014f2

Please sign in to comment.