이미지 및 멀티모달 메시지 사용
에이전트는 종종 이미지와 텍스트를 기억해야합니다. 스크린샷, 문서, 차트 및 사진에는 텍스트 전용 메모리가 보존할 수 없는 세부정보가 포함될 수 있습니다.
이 가이드에서는 다음 방법을 배울 수 있습니다.
- 독립형 이미지 추가 및 스레드 메시지에 이미지 첨부
- 두 종류의 이미지를 검색;
- 원본 이미지 바이트 검색;
- 메시지 텍스트, 이미지 설명 또는 원본 이미지를 사용하도록 자동 메모리 추출 구성
힌트: 패키지 설정은 에이전트 메모리 시작하기를 참조하십시오. 이 예에 대한 로컬 Oracle AI Database가 필요한 경우 로컬에서 Oracle AI Database 실행을 따르십시오.
OracleAgentMemory 클라이언트 생성
이 설명서의 예에서 사용되는 OracleAgentMemory 클라이언트를 만듭니다. Oracle AI Database에 연결하고, 임베더 및 비전 지원 LLM을 구성하고, 이미지 입력에 대한 제한을 설정합니다. 이러한 제한에 대한 설명은 이 가이드 끝에 있는 검토 형식, 제한 및 데이터 처리 를 참조하십시오.
from pathlib import Path
import oracledb
from oracleagentmemory.apis.message import ImageContent, ImageMimeType, Message, TextContent
from oracleagentmemory.core import (
ImageInputLimitConfig,
MemoryExtractionConfig,
MemoryExtractionImageContext,
MemoryExtractionMode,
OracleAgentMemory,
SchemaPolicy,
)
from oracleagentmemory.core.embedders.embedder import Embedder
from oracleagentmemory.core.llms.llm import Llm
embedder = Embedder(model="YOUR_EMBEDDING_MODEL")
vision_llm = Llm(
model="YOUR_VISION_CAPABLE_MODEL",
supports_vision=True,
)
db_pool = oracledb.SessionPool(
user="YOUR DB USER",
password="YOUR DB PASSWORD",
dsn="localhost:1521/...",
)
memory_store_id = "T_IMAGE_GUIDE"
memory = OracleAgentMemory(
connection=db_pool,
embedder=embedder,
llm=vision_llm,
memory_extraction_config=MemoryExtractionConfig(
extract_memories=False,
extraction_mode=MemoryExtractionMode.BACKGROUND,
),
image_input_limit_config=ImageInputLimitConfig(
max_raw_image_bytes=10 * 1024 * 1024,
max_images_per_llm_request=20,
max_total_raw_image_bytes_per_llm_request=50 * 1024 * 1024,
),
schema_policy=SchemaPolicy.CREATE_IF_NECESSARY,
memory_store_id=memory_store_id,
)
image_bytes = Path("sample.png").read_bytes()
클라이언트는 Llm를 만들 때 supports_vision=True를 설정합니다. 선택한 모델 및 제공자 끝점이 이미지 입력을 수락할 때만 이 옵션을 설정합니다. 생략할 경우 Llm는 모델 메타데이터를 확인합니다. 사용 가능한 메타데이터가 없을 경우 Llm는 작은 테스트 이미지를 전송하여 끝점이 이미지 입력을 수락하는지 여부를 확인합니다. supports_vision=True를 설정하면 두 검사가 모두 건너뜁니다. 텍스트 전용 모델이 이미지를 처리할 수 없게 됩니다.
| API 참조: Llm | 이미지 입력 제한 구성 | 메모리 추출 구성 |
독립형 이미지 저장
OracleAgentMemory.add_image()를 사용하여 독립형 이미지를 추가합니다. user_id, agent_id 또는 thread_id 중 하나 이상을 포함합니다. 나중에 list_images() 또는 search()을 호출할 때 일치하는 식별자를 제공해야 합니다.
검색의 경우 SDK는 텍스트 설명이 포함된 이미지를 나타냅니다. 벡터 검색을 사용하면 텍스트 전용 검색에 사용되는 텍스트 임베더와 동일한 설명을 포함하며 이미지 바이트를 포함하지 않습니다. description를 add_image()에 전달하면 SDK에서 해당 텍스트를 사용합니다. 생략할 경우 구성된 비전 지원 LLM이 자동으로 설명을 생성합니다. 다음 예에서는 설명을 제공하므로 이미지를 추가해도 LLM 요청이 생성되지 않습니다.
image_id = memory.add_image(
image_bytes,
mime_type=ImageMimeType.PNG,
user_id="customer_123",
description="A red sample image used by the image support guide.",
metadata={"source": "profile-photo"},
)
images = memory.list_images(user_id="customer_123", limit=10)
stored_image = next(image for image in images if image.id == image_id)
print(stored_image.content)
list_images()는 제공된 user_id, agent_id 또는 thread_id와 일치하는 독립형 이미지를 반환합니다. 각 ImageRecord.content 값에는 이미지 설명이 포함됩니다.
독립형 이미지를 스레드와 연관시키려면 OracleThread.add_image()를 호출합니다. 이 메소드는 스레드 ID와 스레드에 저장된 모든 사용자 또는 에이전트 ID를 사용하므로 다시 전달하지 않습니다.
| API 참조: OracleAgentMemory | 오라클 스레드 | 이미지 레코드 |
이미지의 일부를 메시지 일부로 저장
대화 회전에 대한 컨텍스트를 제공하고 별도로 관리할 필요가 없는 경우 이미지를 스레드 메시지의 일부로 저장합니다.
텍스트 전용 메시지는 content에 대한 문자열을 사용할 수 있습니다. 텍스트 및 이미지가 포함된 메시지의 경우 정렬된 콘텐츠 부분 목록을 전달합니다. SDK는 메시지를 저장 및 검색할 때와 메모리 추출 프롬프트를 작성할 때 해당 순서를 유지합니다.
딕셔너리 형식에서 각 콘텐츠 부분에는 type가 있습니다.
- 텍스트 부분은
{"type": "text", "text": "..."}입니다. - 이미지 부분에는
"type": "image", 원시bytes및mime_type가 포함됩니다.description도 포함할 수 있습니다.
지원되는 mime_type 값은 "image/png", "image/jpeg" 및 "image/webp"입니다.
thread = memory.create_thread(
thread_id="image-support-thread",
user_id="customer_123",
memory_extraction_config=MemoryExtractionConfig(
extract_memories=False,
extraction_mode=MemoryExtractionMode.BACKGROUND,
),
)
message_id = thread.add_messages(
[
{
"role": "user",
"content": [
{"type": "text", "text": "Please remember what is in this image."},
{
"type": "image",
"bytes": image_bytes,
"mime_type": "image/png",
},
],
}
]
)[0]
이 예의 이미지 딕셔너리는 description를 생략하므로 SDK는 비전 지원 LLM이 구성된 이미지 딕셔너리를 생성합니다.
클라이언트는 BACKGROUND를 사용하므로 SDK는 메시지, 대기열 설명 생성 및 생성이 완료되기 전의 반환을 저장합니다. add_messages()가 반환되기 전에 설명이 준비되어야 하는 경우 INLINE를 사용합니다.
생성된 설명을 읽거나 검색하기 전에 wait_for_memory_extraction()을 호출하십시오. 이 메소드는 이 클라이언트가 대기열에 있는 이미지 설명 및 메모리 추출 작업을 기다립니다.
생성이 성공하면 get_message()는 이미지 부품의 ImageContent.description 필드에 설명을 반환합니다.
memory.wait_for_memory_extraction()
stored_message = thread.get_message(message_id)
attached_image = next(
part for part in stored_message.content if isinstance(part, ImageContent)
)
print(attached_image.description)
생성이 실패하거나 대기열에서 작업을 거부하면 이미지가 설명 없이 저장됩니다. 생성된 텍스트를 사용하기 전에 ImageContent.description를 확인하십시오.
딕셔너리 대신 TextContent 및 ImageContent 객체를 사용하여 메시지를 생성할 수도 있습니다. 두 양식 모두 동일한 메시지를 저장합니다.
typed_message_id = thread.add_messages(
[
Message(
role="user",
content=[
TextContent(text="This message uses the typed content API."),
ImageContent(
bytes=image_bytes,
mime_type=ImageMimeType.PNG,
description="A red square on a white background.",
),
],
)
]
)[0]
print(typed_message_id)
이 ImageContent에는 설명이 포함되어 있으므로 SDK는 설명 생성을 위해 이미지를 LLM으로 전송하지 않습니다.
| API 참조: Llm | 메모리 추출 구성 | 메시지 및 메시지 내용 | 오라클 스레드 |
이미지 검색
이미지 설명을 검색하려면 record_types=["image"]를 설정합니다. 메시지에 첨부된 독립형 이미지와 이미지를 모두 검색합니다. 각 결과는 원본 이미지 바이트가 없는 ImageRecord입니다.
설명을 직접 제공하거나 구성된 비전 지원 LLM이 생성하도록 할 수 있습니다. SDK는 제공된 설명과 동일한 방식으로 생성된 설명을 저장하고 검색합니다.
이 설명서에 사용된 기본 VECTOR 전략에서 SDK는 필요한 경우 이미지 설명을 청크로 분할하고 구성된 Embedder로 해당 청크를 포함합니다. 동일한 임베더로 쿼리를 포함하고 결과 벡터를 비교합니다. 이 프로세스는 메시지에 첨부된 독립형 이미지와 이미지에 대해 동일합니다.
다른 검색 전략은 설명을 다르게 처리합니다. KEYWORD는 임베딩을 생성하지 않고 저장된 설명 텍스트를 검색합니다. HYBRID는 구성된 OracleDBEmbedder에서 생성된 벡터와 텍스트 일치를 결합합니다.
다음 예에서는 두 이미지를 모두 검색합니다. 각 결과에는 이미지 ID가 포함됩니다. 첨부된 이미지에는 상위 메시지의 ID도 포함됩니다.
standalone_matches = memory.search(
"red sample image",
user_id="customer_123",
record_types=["image"],
max_results=5,
)
for match in standalone_matches:
print(match.record.id, match.content)
attached_matches = thread.search(
"red square on a white background",
record_types=["image"],
max_results=5,
)
for match in attached_matches:
print(match.record.message_id, match.record.id, match.content)
다음에 나오는 검색 섹션에서는 이러한 ID를 사용하여 원래 바이트를 로드합니다.
record_types=["message"]를 사용할 경우 검색에서 메시지 텍스트만 검사합니다. 메시지에 첨부된 이미지에 대한 설명은 검색하지 않으며 해당 설명에는 record_types=["image"]를 사용합니다.
| API 참조: OracleAgentMemory | 오라클 스레드 | 오라클 검색 결과 | 임베더 |
독립형 이미지 바이트 검색
기본적으로 list_images()는 저장된 바이트가 아닌 이미지 메타데이터 및 설명을 반환합니다. 바이트를 검색하려면 include_bytes=True를 설정하고 일치하는 user_id, agent_id 또는 thread_id와 함께 검색 결과의 이미지 ID를 제공합니다. 이러한 필터는 요청을 하나의 이미지로 제한합니다.
#Raw bytes are omitted by default. To load them, use the image ID returned by
#the search result and pass the same user, agent, or thread ID used when
#adding it.
standalone_match = next(
match for match in standalone_matches if match.record.id == image_id
)
loaded_image = memory.list_images(
image_id=standalone_match.record.id,
user_id="customer_123",
include_bytes=True,
)[0]
| API 참조: OracleAgentMemory | 이미지 레코드 |
메시지에 첨부된 이미지의 바이트 검색
기본적으로 get_message() 및 get_messages()에서 반환된 이미지 부분에는 해당 바이트가 포함되지 않습니다. 이미지를 검색하려면 검색 결과에서 해당 ID를 get_message(..., included_image_ids=[...])로 전달합니다. 검색 결과의 message_id는 검색할 메시지를 식별합니다.
#get_message() omits image bytes unless included_image_ids selects them.
attached_match = next(
match
for match in attached_matches
if match.record.message_id == typed_message_id
)
message_with_bytes = thread.get_message(
attached_match.record.message_id,
included_image_ids=[attached_match.record.id],
)
hydrated_image = next(
part for part in message_with_bytes.content if isinstance(part, ImageContent)
)
| API 참조: 메시지 및 메시지 콘텐츠 | 오라클 스레드 |
메시지에 첨부된 이미지 관리
첨부된 이미지가 상위 메시지에 속합니다. 첨부된 이미지를 바꾸거나 제거하려면 update_message()에 새 메시지 콘텐츠로 전화하십시오. 메시지를 삭제하면 메시지에 첨부된 모든 이미지도 삭제됩니다. delete_image()는 독립형 이미지만 삭제합니다. 첨부된 이미지의 TTL을 직접 업데이트할 수 없습니다.
첨부된 이미지를 추가하면 상위 메시지의 만료 시간이 수신됩니다. update_message()를 사용하면 메시지가 더 빨리 만료되면 SDK는 이미지의 만료 시간도 단축합니다. 메시지의 만료 시간을 연장하거나 ttl_days=None를 사용하여 메시지를 지우면 이미지에 대해 이미 저장된 만료 시간이 연장되거나 지워지지 않습니다. 읽기 및 검색은 이미지 또는 해당 상위 메시지가 만료된 후 이미지를 제외합니다.
| API 참조: 메시지 및 메시지 콘텐츠 | 오라클 스레드 |
자동 메모리 추출 시 선택
메모리 추출 LLM이 수신하는 이미지를 포함하는 메시지 부분을 제어하려면 MemoryExtractionConfig.memory_extraction_image_context를 설정합니다. 이 설정은 추출 프롬프트만 변경합니다. 저장된 메시지를 변경하거나 누락된 이미지 설명을 생성하지는 않습니다.
자동 메모리 추출 이미지 컨텍스트
| 값 | LLM이 수신하는 추출 | 다음 경우에 선택하십시오. |
|---|---|---|
DISABLED |
메시지의 텍스트 부분만 해당합니다. | 추출은 이미지를 무시해야 합니다. 이는 기본값입니다. |
CAPTION |
텍스트 부품 및 이미지 설명(원래 순서) | 설명에는 추출에 필요한 시각적 정보가 포함되어 있거나 LLM 제공자가 이미지 바이트를 수신하지 않아야 합니다. |
IMAGE |
텍스트 부분과 원본 이미지를 원래 순서대로 표시합니다. | 메모리는 설명에 포함되지 않은 시각적 세부 정보에 따라 달라집니다. LLM 및 해당 끝점은 이미지 입력을 받아들여야 합니다. |
다음 예에서는 CAPTION를 사용합니다. memory_extraction_frequency=1를 사용할 경우 첫 번째 메시지 뒤에 추출이 실행됩니다. MemoryExtractionMode.INLINE를 사용할 경우 add_messages()가 반환되기 전에 추출이 완료됩니다.
caption_thread = memory.create_thread(
thread_id="caption-extraction-thread",
user_id="customer_123",
memory_extraction_config=MemoryExtractionConfig(
extract_memories=True,
extraction_mode=MemoryExtractionMode.INLINE,
memory_extraction_frequency=1,
memory_extraction_image_context=MemoryExtractionImageContext.CAPTION,
),
)
caption_thread.add_messages(
[
Message(
role="user",
content=[
TextContent(text="Remember the color and shape in this image."),
ImageContent(
bytes=image_bytes,
mime_type=ImageMimeType.PNG,
description="A red square on a white background.",
),
],
)
]
)
대신 원본 이미지를 보내려면 MemoryExtractionImageContext.CAPTION를 MemoryExtractionImageContext.IMAGE로 바꿉니다. OracleAgentMemory에 구성된 LLM은 이미지 입력을 수락해야 합니다.
CAPTION 모드에서는 추출을 위해 전송된 모든 이미지에 비어 있지 않은 설명이 있어야 합니다. 각 이미지를 추가할 때 description를 제공하거나 설명을 생성하도록 비전 지원 LLM을 구성합니다. MemoryExtractionMode.BACKGROUND를 사용할 경우 동일한 스레드에 대한 메모리 추출 전에 SDK 대기열 설명이 생성됩니다. 추출이 시작될 때 이미지에 설명이 없으면 SDK가 요청을 거부합니다.
MemoryExtractionImageContext.MEMORY는 사용하지 마십시오. 이 값은 나중에 사용하도록 예약되어 있으며 SDK에서 거부합니다.
| API 참조: MemoryExtractionImageContext | 메모리 추출 구성 |
독립형 이미지 업데이트 또는 삭제
독립형 이미지를 추가한 후 update_image()를 사용하여 설명, 메타데이터 또는 바이트를 변경합니다. 설명은 ImageRecord.content에 저장되고 검색을 위해 인덱스화됩니다. 문자열을 전달하여 대체하거나, None를 전달하여 구성된 비전 LLM으로 대체를 생성합니다. description를 생략하면 기존 설명이 변경되지 않은 상태로 유지됩니다.
memory.update_image(
image_id,
description="A red square used by the image support guide.",
metadata={"source": "reviewed-profile-photo"},
)
updated_image = memory.list_images(
image_id=image_id,
user_id="customer_123",
)[0]
print(updated_image.content)
print(updated_image.metadata)
deleted = memory.delete_image(image_id)
print(deleted)
예제에서는 update_image() 뒤에 이미지를 검색하여 새 설명과 메타데이터를 확인합니다. 그런 다음 image_id를 delete_image()에 전달하고 한 이미지가 삭제되었는지 확인합니다.
바이트를 바꾸려면 image 및 mime_type를 함께 전달합니다. 동일한 호출에서 현재 설명을 유지하거나, 새 설명을 제공하거나, 생성된 대체를 description=None로 요청할 수 있습니다. 메시지에 첨부된 이미지와 달리 독립형 이미지는 자체 메타데이터, 시간 기록 및 TTL을 가질 수 있습니다.
| API 참조: OracleAgentMemory | 오라클 검색 결과 |
형식, 제한 및 데이터 처리 검토
이미지를 저장하기 전에 SDK는 바이트를 디코딩하고 형식을 확인합니다. mime_type를 전달할 경우 디코딩된 형식이 일치해야 합니다. SDK는 PNG, JPEG 및 WebP 이미지를 허용하지만 애니메이션 PNG 및 애니메이션 WebP를 거부합니다. 이 검증을 사용 안함으로 설정할 수 없습니다.
기본적으로 원시 이미지는 최대 10MiB일 수 있습니다. 단일 LLM 요청에는 최대 100개의 이미지와 100MiB의 이미지 데이터가 포함될 수 있습니다. ImageInputLimitConfig를 사용하여 배치에 대한 이러한 제한을 낮추거나 문서화된 최대값까지 올립니다. 이 설명서의 시작 부분에서 이미지당 10MiB, 요청당 이미지 20개, 요청당 이미지 데이터 50MiB가 허용됩니다.
Oracle AI Agent Memory는 Oracle AI Database에 이미지 바이트를 저장합니다. 설명을 생성하면 해당 바이트가 구성된 LLM 제공자에게 전송됩니다. 또한 메모리 추출은 IMAGE 모드로 바이트를 전송합니다. CAPTION 모드에서는 메모리 추출이 대신 이미지 설명을 전송합니다. 설명은 원본 이미지의 정보를 표시할 수 있습니다. 설명 생성 또는 메모리 추출을 위해 민감한 이미지를 LLM으로 전송하기 전에 보안 고려 사항을 검토하십시오.
결론
이 가이드에서는 독립형 이미지를 추가하고, 메시지에 이미지를 첨부하고, 이미지 바이트를 검색하고, 이미지 설명을 검색하고, 메시지 텍스트, 이미지 설명 또는 원본 이미지를 사용하도록 자동 메모리 추출을 구성하는 방법을 배웠습니다.
→ 이미지 및 멀티모달 메시지를 사용하는 방법을 배웠을 때 이제 Use Time-to-Live for Messages and Memories로 이동할 수 있습니다.
전체 코드
이 설명서에는 복사 및 실행을 위한 전체 예가 포함되어 있습니다.
#Copyright © 2026 Oracle and/or its affiliates.
#This software is under the Apache License 2.0
#(LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or Universal Permissive License
#(UPL) 1.0 (LICENSE-UPL or https://oss.oracle.com/licenses/upl), at your option.
#Oracle Agent Memory Code Example - Use Images and Multimodal Messages
#---------------------------------------------------------------------
##Configure a vision capable memory client
from pathlib import Path
import oracledb
from oracleagentmemory.apis.message import ImageContent, ImageMimeType, Message, TextContent
from oracleagentmemory.core import (
ImageInputLimitConfig,
MemoryExtractionConfig,
MemoryExtractionImageContext,
MemoryExtractionMode,
OracleAgentMemory,
SchemaPolicy,
)
from oracleagentmemory.core.embedders.embedder import Embedder
from oracleagentmemory.core.llms.llm import Llm
embedder = Embedder(model="YOUR_EMBEDDING_MODEL")
vision_llm = Llm(
model="YOUR_VISION_CAPABLE_MODEL",
supports_vision=True,
)
db_pool = oracledb.SessionPool(
user="YOUR DB USER",
password="YOUR DB PASSWORD",
dsn="localhost:1521/...",
)
memory_store_id = "T_IMAGE_GUIDE"
memory = OracleAgentMemory(
connection=db_pool,
embedder=embedder,
llm=vision_llm,
memory_extraction_config=MemoryExtractionConfig(
extract_memories=False,
extraction_mode=MemoryExtractionMode.BACKGROUND,
),
image_input_limit_config=ImageInputLimitConfig(
max_raw_image_bytes=10 * 1024 * 1024,
max_images_per_llm_request=20,
max_total_raw_image_bytes_per_llm_request=50 * 1024 * 1024,
),
schema_policy=SchemaPolicy.CREATE_IF_NECESSARY,
memory_store_id=memory_store_id,
)
image_bytes = Path("sample.png").read_bytes()
##Store a standalone image
image_id = memory.add_image(
image_bytes,
mime_type=ImageMimeType.PNG,
user_id="customer_123",
description="A red sample image used by the image support guide.",
metadata={"source": "profile-photo"},
)
images = memory.list_images(user_id="customer_123", limit=10)
stored_image = next(image for image in images if image.id == image_id)
print(stored_image.content)
##Add a message with an image dictionary
thread = memory.create_thread(
thread_id="image-support-thread",
user_id="customer_123",
memory_extraction_config=MemoryExtractionConfig(
extract_memories=False,
extraction_mode=MemoryExtractionMode.BACKGROUND,
),
)
message_id = thread.add_messages(
[
{
"role": "user",
"content": [
{"type": "text", "text": "Please remember what is in this image."},
{
"type": "image",
"bytes": image_bytes,
"mime_type": "image/png",
},
],
}
]
)[0]
##Generate an attached image description
memory.wait_for_memory_extraction()
stored_message = thread.get_message(message_id)
attached_image = next(
part for part in stored_message.content if isinstance(part, ImageContent)
)
print(attached_image.description)
##Add typed multimodal message content
typed_message_id = thread.add_messages(
[
Message(
role="user",
content=[
TextContent(text="This message uses the typed content API."),
ImageContent(
bytes=image_bytes,
mime_type=ImageMimeType.PNG,
description="A red square on a white background.",
),
],
)
]
)[0]
print(typed_message_id)
##Search for images
standalone_matches = memory.search(
"red sample image",
user_id="customer_123",
record_types=["image"],
max_results=5,
)
for match in standalone_matches:
print(match.record.id, match.content)
attached_matches = thread.search(
"red square on a white background",
record_types=["image"],
max_results=5,
)
for match in attached_matches:
print(match.record.message_id, match.record.id, match.content)
##Retrieve standalone image bytes
#Raw bytes are omitted by default. To load them, use the image ID returned by
#the search result and pass the same user, agent, or thread ID used when
#adding it.
standalone_match = next(
match for match in standalone_matches if match.record.id == image_id
)
loaded_image = memory.list_images(
image_id=standalone_match.record.id,
user_id="customer_123",
include_bytes=True,
)[0]
##Retrieve attached image bytes
#get_message() omits image bytes unless included_image_ids selects them.
attached_match = next(
match
for match in attached_matches
if match.record.message_id == typed_message_id
)
message_with_bytes = thread.get_message(
attached_match.record.message_id,
included_image_ids=[attached_match.record.id],
)
hydrated_image = next(
part for part in message_with_bytes.content if isinstance(part, ImageContent)
)
##Extract memories from an image description
caption_thread = memory.create_thread(
thread_id="caption-extraction-thread",
user_id="customer_123",
memory_extraction_config=MemoryExtractionConfig(
extract_memories=True,
extraction_mode=MemoryExtractionMode.INLINE,
memory_extraction_frequency=1,
memory_extraction_image_context=MemoryExtractionImageContext.CAPTION,
),
)
caption_thread.add_messages(
[
Message(
role="user",
content=[
TextContent(text="Remember the color and shape in this image."),
ImageContent(
bytes=image_bytes,
mime_type=ImageMimeType.PNG,
description="A red square on a white background.",
),
],
)
]
)
##Update and delete a standalone image
memory.update_image(
image_id,
description="A red square used by the image support guide.",
metadata={"source": "reviewed-profile-photo"},
)
updated_image = memory.list_images(
image_id=image_id,
user_id="customer_123",
)[0]
print(updated_image.content)
print(updated_image.metadata)
deleted = memory.delete_image(image_id)
print(deleted)