본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Artifact previews

원문 보기 위키 갱신

Artifact previews (산출물 미리보기)

생성형 AI 채팅에서 AI 생성 산출물(artifact)을 표시하는 방법을 다룹니다. 산출물 미리보기는 인라인(inline) 미리보기와 캔버스(canvas) 미리보기의 두 가지 방식으로 표시할 수 있으며, 각각 다른 사용자 요구와 상호작용 모델에 부합합니다. 이 페이지에서는 핵심 UX 개념, 선택 기준, 인라인·캔버스 미리보기, 일반 가이드라인, 작성 가이드라인, 접근성 가이드라인을 다룹니다.

출처: 문서

본문

생성형 AI 채팅에서 AI 생성 산출물을 표시하는 방법.

핵심 UX 개념 (Key UX concepts)

AI가 생성한 산출물 (Artifacts generated by AI)

산출물은 문서, 이미지, 코드, 워크플로우 같은 AI 생성 출력물입니다. 이 산출물은 일반적으로 라벨과 설명, 메타데이터와 관련 동작을 포함하는 미리보기로 렌더링됩니다.

산출물 미리보기의 유형 (Types of artifact previews)

채팅 경험 내에서 생성된 산출물을 두 가지 방식으로 표시할 수 있으며, 각각 서로 다른 사용자 요구와 상호작용 모델을 충족합니다:

  • 인라인 미리보기: 빠른 이해를 강조하며 채팅 인터페이스 내에서 download 나 copy 같은 상황별 상호작용을 가능하게 합니다.
  • 캔버스 미리보기: 채팅에 표시되며 사용자가 콘텐츠를 보고 상호작용할 수 있는 인접한 영역에서 전체 산출물을 보여주도록 확장됩니다.

기준 (Criteria)

인라인 미리보기 (Inline previews) 캔버스 미리보기 (Canvas previews)
산출물 복잡성 (Artifact complexity) 간단하고 자족적인 콘텐츠. 예: 다운로드할 수 있는 AI 생성 .csv. 사용자가 조절할 수 있는 복잡하고 상호작용적인 콘텐츠. 예: forms나 wizards를 포함하는 AI 생성 캔버스.
콘텐츠 길이 (Content length) 짧음. 예: CLI 명령을 위한 코드 스니펫. 김. 예: AI가 작성한 방대한 문서.
주요 사용자 의도 (Primary user intent) 빠른 인지와 기본 동작. 자세한 검토, 편집 또는 상호작용.
주요 동작 (Key actions) 빠른 동작. 예: 다운로드, 복사, 공유. 복잡한 동작. 예: 편집, 주석 달기, 작업이나 워크플로우 완료.
상호작용 깊이 (Interaction depth) 최소. 사용자는 산출물을 열지 않고도 동작할 수 있습니다. 복잡. 사용자는 콘텐츠 안에서 탐색하거나 작업해야 합니다.
대화 흐름 (Conversation flow) 대화의 흐름을 유지하는 것이 중요합니다. 산출물이 핵심 포커스가 됩니다.

인라인 미리보기 (Inline previews)

코드 스니펫 (Code snippets)

item card을 사용해 문법 하이라이트, 언어 표시기, 복사 동작과 함께 대화에 직접 표시되는 짧은 블록입니다. 사용자가 즉시 복사해 붙여넣을 수 있는 빠른 참조, 예시, 스니펫에 이상적입니다.

Generative AI assistant

대화형 어시스턴트로, S3 업로드를 기록하는 가장 간단한 Lambda 함수를 요청하는 사용자와 그에 대한 코드 스니펫을 응답으로 제공하는 예시와 함께, item card과 CodeView로 표시된 코드 조각을 보여줍니다.

import React from 'react';
import ChatBubble from '@cloudscape-design/chat-components/chat-bubble';
import Button from '@cloudscape-design/components/button';
import Box from '@cloudscape-design/components/box';
import { CodeView } from '@cloudscape-design/code-view';
import pythonHighlight from '@cloudscape-design/code-view/highlight/python';
import Container from '@cloudscape-design/components/container';
import CopyToClipboard from '@cloudscape-design/components/copy-to-clipboard';
import Header from '@cloudscape-design/components/header';
import ItemCard from '@cloudscape-design/components/item-card';
import SpaceBetween from '@cloudscape-design/components/space-between';
import { genAiAvatar, genAiName, userAvatar, userName } from '../genai-common/avatars';
import CustomGenAIChatFooter from '../gen-ai-response-regeneration/custom-gen-ai-chat-footer';
import '../genai-common/styles.scss';

const pythonCode = `def lambda_handler(event, context):
    bucket = event['Records'][0]['s3']['bucket']['name']
    key = event['Records'][0]['s3']['object']['key']
    print(f"New file uploaded: {key} in bucket {bucket}")
    return {'statusCode': 200}`;

export default function GenAiArtifactPreviewCodeSnippets() {
  return (
    <Container
      header={<Header variant="h3">Generative AI assistant</Header>}
      footer={<CustomGenAIChatFooter actionButtonIconName="send" actionButtonAriaLabel="Send message" />}
    >
      <div role="region" aria-label="Chat" className="chat-region">
        <SpaceBetween size="xs">
          <ChatBubble type="outgoing" ariaLabel={`${userName} at 05:37:30pm`} avatar={userAvatar}>
            Show me the simplest Lambda function to log S3 uploads
          </ChatBubble>

          <ChatBubble type="incoming" ariaLabel={`${genAiName} at 05:37:35pm`} avatar={genAiAvatar}>
            Here is a snippet of the simplest Lambda function to log S3 uploads.
          </ChatBubble>

          <div className="chat-bubble-indentation">
            <ItemCard
              variant="embedded"
              header={
                <Box fontSize="heading-xs" fontWeight="bold">
                  Python
                </Box>
              }
              actions={
                <SpaceBetween direction="horizontal" size="xxs">
                  <Button iconName="download" variant="icon" ariaLabel="Download code" />
                  <CopyToClipboard
                    copyButtonText="Copy"
                    copyErrorText="Code failed to copy"
                    copySuccessText="Code copied"
                    textToCopy={pythonCode}
                    variant="icon"
                  />
                </SpaceBetween>
              }
            >
              <CodeView content={pythonCode} highlight={pythonHighlight} ariaLabel="Python Lambda function" />
            </ItemCard>
          </div>
        </SpaceBetween>
      </div>
    </Container>
  );
}

미디어 (Media)

이미지, 차트, 다이어그램, 동영상 같은 생성된 미디어는 item card을 사용해 인라인 미리보기로 표시됩니다. 여기에는 파일 이름, 메타데이터, 다운로드나 확장을 위한 동작이 포함될 수 있습니다. 이렇게 하면 사용자가 별도의 뷰어에서 열 필요 없이 시각적 콘텐츠를 즉시 보고 평가할 수 있습니다. 이미지 같은 생성된 산출물을 확장하려면 image magnifier에 대한 안내를 따르세요.

Generative AI assistant

행복한 코기 개 이미지 생성을 요청하는 사용자와 그 이미지를 제공하는 어시스턴트의 예시로, item card 안에 이미지, 파일 이름(dog-portrait.jpg), 메타데이터(886 × 408 - 487 KB), 다운로드·전체 화면 보기 동작을 보여줍니다.

import React from 'react';
import ChatBubble from '@cloudscape-design/chat-components/chat-bubble';
import Button from '@cloudscape-design/components/button';
import Box from '@cloudscape-design/components/box';
import Container from '@cloudscape-design/components/container';
import Header from '@cloudscape-design/components/header';
import ItemCard from '@cloudscape-design/components/item-card';
import SpaceBetween from '@cloudscape-design/components/space-between';
import { genAiAvatar, genAiName, userAvatar, userName } from '../genai-common/avatars';
import CustomGenAIChatFooter from '../gen-ai-response-regeneration/custom-gen-ai-chat-footer';
import '../genai-common/styles.scss';
import './media.scss';

export default function GenAiArtifactPreviewMedia() {
  return (
    <Container
      header={<Header variant="h3">Generative AI assistant</Header>}
      footer={<CustomGenAIChatFooter actionButtonIconName="send" actionButtonAriaLabel="Send message" />}
    >
      <div role="region" aria-label="Chat" className="chat-region">
        <SpaceBetween size="xs">
          <ChatBubble type="outgoing" ariaLabel={`${userName} at 05:37:30pm`} avatar={userAvatar}>
            Create an image of a happy corgi dog.
          </ChatBubble>

          <ChatBubble type="incoming" ariaLabel={`${genAiName} at 05:37:35pm`} avatar={genAiAvatar}>
            Here you go - an image of a happy corgi dog.
          </ChatBubble>

          <div className="chat-bubble-indentation media-card">
            <ItemCard
              variant="embedded"
              header={
                <Box fontSize="heading-xs" fontWeight="bold">
                  dog-portrait.jpg
                </Box>
              }
              description="886 × 408 - 487 KB"
              disableContentPaddings
              actions={
                <SpaceBetween direction="horizontal" size="xxs">
                  <Button iconName="download" variant="icon" ariaLabel="Download image" />
                  <Button iconName="expand" variant="icon" ariaLabel="View fullscreen" />
                </SpaceBetween>
              }
            >
              <div className="media-image-wrapper">
                <img
                  src="/a-portrait-of-a-happy-corgi-dog.jpg"
                  alt="A portrait of a happy corgi dog"
                  className="media-image"
                />
              </div>
            </ItemCard>
          </div>
        </SpaceBetween>
      </div>
    </Container>
  );
}

다운로드 전용 파일 (Download-only files)

문서와 생성된 파일은 파일 이름, 크기 메타데이터, 다운로드 동작과 함께 item card을 사용해 다운로드 가능한 산출물로 표시됩니다. 이 형식은 사용자가 먼저 열거나 보지 않고 로컬에 저장해야 하는 파일에 잘 작동합니다.

Generative AI assistant

범주와 비용이 있는 월별 예산 .csv 파일 생성을 요청하는 사용자와 jd-budget.csv(1.82 MB) 파일을 제공하는 어시스턴트의 예시로, item card 안에 파일 아이콘, 파일 이름, 크기, 다운로드 동작을 보여줍니다.

import React from 'react';
import ChatBubble from '@cloudscape-design/chat-components/chat-bubble';
import Button from '@cloudscape-design/components/button';
import Box from '@cloudscape-design/components/box';
import Container from '@cloudscape-design/components/container';
import Header from '@cloudscape-design/components/header';
import Icon from '@cloudscape-design/components/icon';
import ItemCard from '@cloudscape-design/components/item-card';
import SpaceBetween from '@cloudscape-design/components/space-between';
import { genAiAvatar, genAiName, userAvatar, userName } from '../genai-common/avatars';
import chatBubbleActions from '../gen-ai-response-regeneration/chat-action';
import CustomGenAIChatFooter from '../gen-ai-response-regeneration/custom-gen-ai-chat-footer';
import '../genai-common/styles.scss';

export default function GenAiArtifactPreviewDownloadOnlyFiles() {
  return (
    <Container
      header={<Header variant="h3">Generative AI assistant</Header>}
      footer={<CustomGenAIChatFooter actionButtonIconName="send" actionButtonAriaLabel="Send message" />}
    >
      <div role="region" aria-label="Chat" className="chat-region">
        <SpaceBetween size="xs">
          <ChatBubble type="outgoing" ariaLabel={`${userName} at 05:37:30pm`} avatar={userAvatar}>
            Please create a .csv of my monthly budget with categories and expenses
          </ChatBubble>

          <ChatBubble
            type="incoming"
            ariaLabel={`${genAiName} at 05:37:35pm`}
            avatar={genAiAvatar}
            actions={chatBubbleActions}
          >
            Here is a .csv with your monthly budget and expenses. Let me know if you need any changes to the format or
            categories.
          </ChatBubble>

          <div className="chat-bubble-indentation fit-content">
            <ItemCard
              variant="embedded"
              icon={<Icon name="file" />}
              header={
                <Box fontSize="heading-xs" fontWeight="bold">
                  jd-budget.csv
                </Box>
              }
              description="1.82 MB"
              actions={<Button iconName="download" variant="icon" ariaLabel="Download file" />}
            />
          </div>
        </SpaceBetween>
      </div>
    </Container>
  );
}

캔버스 미리보기 (Canvas previews)

선택 가능한 미리보기 (Selectable preview)

산출물 미리보기를 사용하면 사용자가 생성된 콘텐츠와 상호작용하고 action card을 사용해 인접한 패널에서 전체 산출물을 점진적으로 렌더링할 수 있습니다. 예: 사용자가 AI 생성 문서 산출물 미리보기를 선택하면 그 내용이 사이드 패널에 표시됩니다. 사용자가 다운로드나 공유 같은 2차 동작 없이 콘텐츠를 미리 보거나 읽는 것이 주요 동작인 경우에 사용하세요.

Generative AI assistant

다중 리전 배포 전략에 대한 아키텍처 개요 작성을 요청하는 사용자와 multi-region-architecture.md(18.7 KB) 산출물을 제공하는 어시스턴트의 예시입니다. 산출물 미리보기(action card 사용)를 선택하면 문서 내용이 인접한 패널에 표시됩니다.

multi-region-architecture.md

Multi-Region Architecture Overview

이 문서는 가용성을 높이고 지연 시간을 줄이며 데이터 상주 요구 사항을 충족하기 위해 여러 AWS 리전에 애플리케이션을 배포하기 위한 아키텍처를 설명합니다.

Regional topology

기본 리전은 us-east-1이며 eu-west-1과 ap-southeast-1에 active-active 배포가 있습니다. 각 리전은 Application Load Balancer, Fargate의 Amazon ECS 서비스, 글로벌 테이블이 활성화된 Regional Amazon DynamoDB 테이블로 구성된 독립적인 스택을 실행합니다.

Traffic routing

Amazon Route 53 대기 시간 기반 라우팅은 사용자를 가장 가까운 정상 리전으로 안내합니다. 상태 확인은 각 리전의 ALB 엔드포인트를 10초 간격으로 모니터링하고 장애 조치(failover) 전에 3회 실패 임계값을 적용합니다. DNS TTL은 장애 발생 시 빠른 재라우팅이 가능하도록 60초로 설정됩니다.

Data replication

  1. DynamoDB global tables - 최종 일관성을 가진 다중 리전, 다중 활성 복제를 제공합니다. 충돌 해결은 항목 타임스탬프 기반의 last-writer-wins를 사용합니다.
  2. Amazon S3 cross-Region replication - 정적 자산과 사용자 업로드는 복제 시간 제어(RTC)로 기본 버킷에서 리전 버킷으로 복제되어 예측 가능한 15분 SLA를 보장합니다.
  3. Amazon ElastiCache Global Datastore - 세션 데이터는 1초 미만의 지연으로 리전 간 복제되어 세션 손실 없는 매끄러운 장애 조치를 가능하게 합니다.

Failover strategy

자동 장애 조치는 Route 53 상태 확인을 통해 DNS 계층에서 처리됩니다. 리전이 비정상이 되면 트래픽은 60~90초 내에 다음으로 낮은 대기 시간의 리전으로 이동합니다. 수동 장애 조치는 Route 53 라우팅 정책을 업데이트하고 영향을 받은 리전의 ECS 서비스를 비활성화하는 런북(runbook)을 통해 가능합니다.

Observability

각 리전은 교차 계정 관측성(cross-account observability)을 사용해 us-east-1의 중앙 집중식 Amazon CloudWatch 대시보드에 지표를 게시합니다. 핵심 지표에는 요청 대기 시간(p50, p99), 오류율, DynamoDB 복제 지연, ECS 작업 상태가 포함됩니다. CloudWatch 알람은 SNS 알림을 트리거하고 임계값이 위반되면 자동으로 인시던트 티켓을 생성합니다.

Cost considerations

다중 리전 배포는 단일 리전에 비해 인프라 비용을 약 2.4배 증가시킵니다. 주요 비용 요인은 리전 간 데이터 전송, DynamoDB 글로벌 테이블 쓰기 용량, 각 리전의 중복 컴퓨팅입니다. 예약 용량과 Savings Plans는 모든 리전에 적용되어 기본 비용을 30~40% 절감합니다.

import React, { useState } from 'react';
import ChatBubble from '@cloudscape-design/chat-components/chat-bubble';
import ActionCard from '@cloudscape-design/components/action-card';
import Box from '@cloudscape-design/components/box';
import Button from '@cloudscape-design/components/button';
import Header from '@cloudscape-design/components/header';
import Icon from '@cloudscape-design/components/icon';
import SpaceBetween from '@cloudscape-design/components/space-between';
import TextContent from '@cloudscape-design/components/text-content';
import { genAiAvatar, genAiName, userAvatar, userName } from '../genai-common/avatars';
import CustomGenAIChatFooter from '../gen-ai-response-regeneration/custom-gen-ai-chat-footer';
import '../genai-common/styles.scss';
import './selectable-preview.scss';

export default function GenAiArtifactPreviewSelectablePreview() {
  const [artifactOpen, setArtifactOpen] = useState(false);

  return (
    <div className="selectable-preview">
      <div className="chat-panel">
        <div className="chat-header">
          <Header variant="h3">Generative AI assistant</Header>
        </div>

        <div className="chat-content" role="region" aria-label="Chat">
          <SpaceBetween size="xs">
            <ChatBubble type="outgoing" ariaLabel={`${userName} at 05:37:30pm`} avatar={userAvatar}>
              Write an architecture overview for our multi-region deployment strategy
            </ChatBubble>

            <ChatBubble type="incoming" ariaLabel={`${genAiName} at 05:37:35pm`} avatar={genAiAvatar}>
              I&apos;ve drafted an architecture overview covering multi-region topology, data replication, failover
              strategy, and observability for your deployment.
            </ChatBubble>

            <div className="chat-bubble-indentation fit-content">
              <ActionCard
                variant="embedded"
                header={
                  <Box fontSize="heading-xs" fontWeight="bold">
                    multi-region-architecture.md
                  </Box>
                }
                description="18.7 KB"
                icon={<Icon name="arrow-right" />}
                onClick={() => setArtifactOpen(true)}
                ariaLabel="Open multi-region architecture preview"
              />
            </div>
          </SpaceBetween>
        </div>

        <div className="chat-footer">
          <CustomGenAIChatFooter actionButtonIconName="send" actionButtonAriaLabel="Send message" />
        </div>
      </div>

      <div
        className={`artifact-panel${artifactOpen ? ' artifact-panel-open' : ''}`}
        aria-hidden={!artifactOpen}
        inert={!artifactOpen ? true : undefined}
      >
        <Box padding="l">
          <SpaceBetween size="m">
            <Header
              variant="h3"
              actions={
                <SpaceBetween direction="horizontal" size="xxs">
                  <Button iconName="share" variant="icon" ariaLabel="Share document" />
                  <Button iconName="download" variant="icon" ariaLabel="Download document" />
                  <Button
                    iconName="close"
                    variant="icon"
                    ariaLabel="Close artifact"
                    onClick={() => setArtifactOpen(false)}
                  />
                </SpaceBetween>
              }
            >
              multi-region-architecture.md
            </Header>
            <TextContent>
              <h4>Multi-Region Architecture Overview</h4>
              <p>
                This document describes the architecture for deploying the application across multiple AWS Regions to
                improve availability, reduce latency, and meet data residency requirements.
              </p>
              <h4>Regional topology</h4>
              <p>
                The primary Region is us-east-1, with active-active deployments in eu-west-1 and ap-southeast-1. Each
                Region runs an independent stack consisting of an Application Load Balancer, Amazon ECS services on
                Fargate, and a Regional Amazon DynamoDB table with global tables enabled.
              </p>
              <h4>Traffic routing</h4>
              <p>
                Amazon Route 53 latency-based routing directs users to the nearest healthy Region. Health checks monitor
                the ALB endpoint in each Region with a 10-second interval and 3-failure threshold before failover. DNS
                TTL is set to 60 seconds to allow rapid rerouting during incidents.
              </p>
              <h4>Data replication</h4>
              <ol>
                <li>
                  <strong>DynamoDB global tables</strong> - Provides multi-Region, multi-active replication with
                  eventual consistency. Conflict resolution uses last-writer-wins based on item timestamps.
                </li>
                <li>
                  <strong>Amazon S3 cross-Region replication</strong> - Static assets and user uploads replicate from
                  the primary bucket to Regional buckets with replication time control (RTC) for predictable 15-minute
                  SLA.
                </li>
                <li>
                  <strong>Amazon ElastiCache Global Datastore</strong> - Session data replicates across Regions with
                  sub-second lag, enabling seamless failover without session loss.
                </li>
              </ol>
              <h4>Failover strategy</h4>
              <p>
                Automated failover is handled at the DNS layer through Route 53 health checks. If a Region becomes
                unhealthy, traffic shifts to the next-lowest-latency Region within 60-90 seconds. Manual failover is
                available through a runbook that updates Route 53 routing policies and disables the affected
                Region&apos;s ECS services.
              </p>
              <h4>Observability</h4>
              <p>
                Each Region publishes metrics to a centralized Amazon CloudWatch dashboard in us-east-1 using
                cross-account observability. Key metrics include request latency (p50, p99), error rates, DynamoDB
                replication lag, and ECS task health. CloudWatch alarms trigger SNS notifications and automatically
                create incident tickets when thresholds are breached.
              </p>
              <h4>Cost considerations</h4>
              <p>
                Multi-Region deployment increases infrastructure costs by approximately 2.4x compared to a single
                Region. The primary cost drivers are cross-Region data transfer, DynamoDB global table write capacity,
                and redundant compute in each Region. Reserved capacity and Savings Plans are applied across all Regions
                to reduce baseline costs by 30-40%.
              </p>
            </TextContent>
          </SpaceBetween>
        </Box>
      </div>
    </div>
  );
}

일반 가이드라인 (General guidelines)

권장 사항 (Do)

  • AI가 생성한 산출물에 속하는 동작과 대화를 명확히 분리하세요. 예: 산출물 미리보기와 관련된 동작을 그 카드 안에 그룹화하고 chat bubble의 버튼 그룹과 관련된 동작은 그대로 두세요.
  • 인라인 산출물 미리보기에 여러 동작이 있을 때는 시각적 혼잡을 줄이고 깔끔한 인터페이스를 유지하기 위해 ellipsis 아이콘이 있는 단일 버튼 드롭다운으로 통합하세요.

권장하지 않는 사항 (Don't)

  • 산출물을 채팅 버블에 중첩하지 마세요. 명확성을 보장하고 가독성을 높이기 위해 각 산출물을 쌓아서 표시하세요. 메시지 구조와 쌓기 패턴에 대한 더 자세한 안내는 generative AI chat pattern을 참고하세요.

작성 가이드라인 (Writing guidelines)

일반 작성 가이드라인 (General writing guidelines)

  • 문장형 대소문자(sentence case)를 사용하되, 고유명사와 브랜드 이름은 맥락에 맞게 대문자화를 유지하세요.

  • headers와 buttons를 제외하고 마침표를 사용하세요. 느낌표는 사용하지 마세요.

  • 현재형 동사와 능동태를 사용하세요.

  • 작성에서 please , thank you , 줄임표( ... ), 앰퍼샌드( & ), e.g. , i.e. , etc. 를 사용하지 마세요.

  • 방향을 지시하는 표현은 피하세요.

    • 예: above 대신 previous 를, below 대신 following 을 사용하세요.
  • 기기 독립적인 표현을 사용하세요.

    • 예: click 대신 choose 나 select 를 사용하세요.

컴포넌트별 가이드라인 (Component-specific guidelines)

산출물 메타데이터 (Artifact metadata)

  • 파일 크기를 KB, MB, GB 같은 표준 단위로 표현하세요.

접근성 가이드라인 (Accessibility guidelines)

일반 접근성 가이드라인 (General accessibility guidelines)

  • 각 컴포넌트에 대한 대체 텍스트와 접근 가능한 리치 인터넷 애플리케이션(ARIA) 영역에 대한 지침을 따르세요.
  • 애플리케이션의 언어 맥락에 맞춘 ARIA 라벨을 정의하세요.
  • 역할(role)과 랜드마크(landmark)에 불필요한 마크업을 추가하지 마세요. 각 컴포넌트에 대한 지침을 따르세요.
  • 논리적이고 예측 가능한 순서로 모든 사용 가능한 콘텐츠에 키보드 기능을 제공하세요. 정보의 흐름이 이해가 되어야 합니다.

더 알아보기 (Learn more)