{"id":363,"date":"2026-03-28T19:50:39","date_gmt":"2026-03-28T11:50:39","guid":{"rendered":"https:\/\/flycloud.io\/?p=363"},"modified":"2026-10-07T19:51:42","modified_gmt":"2026-10-07T11:51:42","slug":"%e5%a4%9a%e6%a8%a1%e6%80%81-rag-%e5%ae%9e%e6%88%98%ef%bc%9a%e5%9f%ba%e4%ba%8e-gemini-pro-%e6%9e%84%e5%bb%ba%e5%9b%be%e6%96%87%e9%97%ae%e7%ad%94%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/flycloud.io\/en\/2026\/03\/28\/%e5%a4%9a%e6%a8%a1%e6%80%81-rag-%e5%ae%9e%e6%88%98%ef%bc%9a%e5%9f%ba%e4%ba%8e-gemini-pro-%e6%9e%84%e5%bb%ba%e5%9b%be%e6%96%87%e9%97%ae%e7%ad%94%e5%ba%94%e7%94%a8\/","title":{"rendered":"\u591a\u6a21\u6001 RAG \u5b9e\u6218\uff1a\u57fa\u4e8e Gemini Pro \u6784\u5efa\u56fe\u6587\u95ee\u7b54\u5e94\u7528"},"content":{"rendered":"<h2 class=\"wp-block-heading\"><strong>\u4ec0\u4e48\u662f RAG<\/strong><\/h2>\n\n\n\n<p>\u68c0\u7d22\u589e\u5f3a\u751f\u6210 (RAG) \u662f\u4e00\u79cd\u5c06\u5927\u8bed\u8a00\u6a21\u578b (LLM) \u7684\u5f3a\u5927\u529f\u80fd\u4e0e\u4ece\u5916\u90e8\u77e5\u8bc6\u6765\u6e90\u68c0\u7d22\u76f8\u5173\u4fe1\u606f\u7684\u80fd\u529b\u76f8\u7ed3\u5408\u7684\u6280\u672f\u3002\u8fd9\u610f\u5473\u7740 LLM \u4e0d\u4ec5\u4f9d\u8d56\u4e8e\u5176\u5185\u90e8\u8bad\u7ec3\u6570\u636e\uff0c\u8fd8\u53ef\u4ee5\u5728\u751f\u6210\u56de\u7b54\u65f6\u8bbf\u95ee\u5e76\u7eb3\u5165\u6700\u65b0\u7684\u7279\u5b9a\u4fe1\u606f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/936b7eedba773cac.png?hl=zh-cn\" alt=\"936b7eedba773cac.png\"\/><\/figure>\n\n\n\n<p>RAG \u8d8a\u6765\u8d8a\u53d7\u6b22\u8fce\uff0c\u539f\u56e0\u6709\u4ee5\u4e0b\u51e0\u4e2a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u63d0\u9ad8\u51c6\u786e\u6027\u548c\u76f8\u5173\u6027<\/strong>\uff1aRAG \u4f7f LLM \u80fd\u591f\u6839\u636e\u4ece\u5916\u90e8\u6765\u6e90\u68c0\u7d22\u5230\u7684\u4e8b\u5b9e\u4fe1\u606f\u751f\u6210\u66f4\u51c6\u786e\u3001\u66f4\u76f8\u5173\u7684\u56de\u7b54\u3002\u8fd9\u5728\u9700\u8981\u6700\u65b0\u77e5\u8bc6\u7684\u573a\u666f\u4e2d\u5c24\u5176\u6709\u7528\uff0c\u4f8b\u5982\u56de\u7b54\u6709\u5173\u65f6\u4e8b\u7684\u95ee\u9898\u6216\u63d0\u4f9b\u6709\u5173\u7279\u5b9a\u4e3b\u9898\u7684\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u51cf\u5c11\u5e7b\u89c9<\/strong>\uff1aLLM \u6709\u65f6\u4f1a\u751f\u6210\u770b\u4f3c\u5408\u7406\u4f46\u5b9e\u9645\u4e0a\u4e0d\u6b63\u786e\u6216\u65e0\u610f\u4e49\u7684\u56de\u7b54\u3002RAG \u901a\u8fc7\u5bf9\u7167\u5916\u90e8\u6765\u6e90\u9a8c\u8bc1\u751f\u6210\u7684\u4fe1\u606f\u6765\u5e2e\u52a9\u7f13\u89e3\u6b64\u95ee\u9898\u3002<\/li>\n\n\n\n<li><strong>\u66f4\u5f3a\u7684\u9002\u5e94\u6027<\/strong>\uff1aRAG \u4f7f LLM \u80fd\u591f\u66f4\u597d\u5730\u9002\u5e94\u4e0d\u540c\u7684\u9886\u57df\u548c\u4efb\u52a1\u3002\u901a\u8fc7\u5229\u7528\u4e0d\u540c\u7684\u77e5\u8bc6\u6765\u6e90\uff0cLLM \u53ef\u4ee5\u8f7b\u677e\u81ea\u5b9a\u4e49\uff0c\u4ee5\u63d0\u4f9b\u6709\u5173\u5404\u79cd\u4e3b\u9898\u7684\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u589e\u5f3a\u7528\u6237\u4f53\u9a8c<\/strong>\uff1aRAG \u53ef\u4ee5\u63d0\u4f9b\u66f4\u7fd4\u5b9e\u3001\u53ef\u9760\u4e14\u76f8\u5173\u7684\u56de\u7b54\uff0c\u4ece\u800c\u6539\u5584\u6574\u4f53\u7528\u6237\u4f53\u9a8c\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-multi-modal\"><strong>\u4e3a\u4ec0\u4e48\u9009\u62e9\u591a\u6a21\u6001<\/strong><\/h2>\n\n\n\n<p>\u5728\u5f53\u4eca\u8fd9\u4e2a\u6570\u636e\u4e30\u5bcc\u7684\u4e16\u754c\u4e2d\uff0c\u6587\u6863\u901a\u5e38\u4f1a\u7ed3\u5408\u4f7f\u7528\u6587\u672c\u548c\u56fe\u7247\u6765\u5168\u9762\u4f20\u8fbe\u4fe1\u606f\u3002\u4e0d\u8fc7\uff0c\u5927\u591a\u6570\u68c0\u7d22\u589e\u5f3a\u751f\u6210 (RAG) \u7cfb\u7edf\u90fd\u5ffd\u7565\u4e86\u56fe\u7247\u4e2d\u8574\u542b\u7684\u5b9d\u8d35\u6d1e\u89c1\u3002\u968f\u7740\u591a\u6a21\u6001\u5927\u8bed\u8a00\u6a21\u578b (LLM) \u65e5\u76ca\u666e\u53ca\uff0c\u63a2\u7d22\u5982\u4f55\u5728 RAG \u4e2d\u540c\u65f6\u5229\u7528\u89c6\u89c9\u5185\u5bb9\u548c\u6587\u672c\u81f3\u5173\u91cd\u8981\uff0c\u8fd9\u6837\u624d\u80fd\u66f4\u6df1\u5165\u5730\u4e86\u89e3\u4fe1\u606f\u683c\u5c40\u3002<\/p>\n\n\n\n<p><strong>\u591a\u6a21\u6001 RAG \u7684\u4e24\u79cd\u9009\u9879<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u591a\u6a21\u6001\u5d4c\u5165 &#8211;<\/strong> \u591a\u6a21\u6001\u5d4c\u5165\u6a21\u578b\u4f1a\u6839\u636e\u60a8\u63d0\u4f9b\u7684\u8f93\u5165\u751f\u6210 1408 \u7ef4\u5411\u91cf*\uff0c\u53ef\u4ee5\u5305\u542b\u56fe\u7247\u3001\u6587\u672c\u548c\u89c6\u9891\u6570\u636e\u7684\u7ec4\u5408\u3002\u56fe\u7247\u5d4c\u5165\u5411\u91cf\u548c\u6587\u672c\u5d4c\u5165\u5411\u91cf\u4f4d\u4e8e\u540c\u4e00\u8bed\u4e49\u7a7a\u95f4\u4e2d\uff0c\u5e76\u4e14\u5177\u6709\u76f8\u540c\u7684\u7ef4\u5ea6\u3002\u56e0\u6b64\uff0c\u8fd9\u4e9b\u5411\u91cf\u53ef\u4ee5\u4e92\u6362\u7528\u4e8e\u5e94\u7528\u573a\u666f\uff0c\u4f8b\u5982\u6309\u6587\u672c\u641c\u7d22\u56fe\u7247\u6216\u6309\u56fe\u7247\u641c\u7d22\u89c6\u9891\u3002\u4e0d\u59a8\u770b\u770b\u8fd9\u4e2a<a href=\"https:\/\/ai-demos.dev\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u6f14\u793a<\/a>\u3002<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528\u591a\u6a21\u6001\u5d4c\u5165\u6765\u5d4c\u5165\u6587\u672c\u548c\u56fe\u7247<\/li>\n\n\n\n<li>\u4f7f\u7528\u76f8\u4f3c\u5ea6\u641c\u7d22\u529f\u80fd\u540c\u65f6\u68c0\u7d22\u4e24\u8005<\/li>\n\n\n\n<li>\u5c06\u68c0\u7d22\u5230\u7684\u539f\u59cb\u56fe\u7247\u548c\u6587\u672c\u5757\u540c\u65f6\u4f20\u9012\u7ed9<strong><em>\u591a\u6a21\u6001 LLM<\/em><\/strong> \u4ee5\u8fdb\u884c\u56de\u7b54\u5408\u6210<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6587\u672c\u5d4c\u5165<\/strong> &#8211;<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528\u591a\u6a21\u6001 LLM \u751f\u6210\u56fe\u7247\u6587\u672c\u6458\u8981<\/li>\n\n\n\n<li>\u5d4c\u5165\u548c\u68c0\u7d22\u6587\u672c<\/li>\n\n\n\n<li>\u5c06\u6587\u672c\u5757\u4f20\u9012\u7ed9 LLM \u4ee5\u8fdb\u884c\u56de\u7b54\u5408\u6210<\/li>\n<\/ol>\n\n\n\n<p><strong>\u4ec0\u4e48\u662f\u591a\u5411\u91cf\u68c0\u7d22\u5668<\/strong><\/p>\n\n\n\n<p>\u591a\u5411\u91cf\u68c0\u7d22\u91c7\u7528\u6587\u6863\u90e8\u5206\u7684\u6458\u8981\u6765\u68c0\u7d22\u539f\u59cb\u5185\u5bb9\uff0c\u4ee5\u5408\u6210\u56de\u7b54\u3002\u5b83\u53ef\u4ee5\u63d0\u9ad8 RAG \u7684\u8d28\u91cf\uff0c\u5c24\u5176\u662f\u5728\u5904\u7406\u8868\u683c\u3001\u56fe\u8868\u7b49\u5bc6\u96c6\u578b\u4efb\u52a1\u65f6\u3002\u5982\u9700\u4e86\u89e3\u8be6\u60c5\uff0c\u8bf7\u8bbf\u95ee <a href=\"https:\/\/blog.langchain.dev\/semi-structured-multi-modal-rag\/\" target=\"_blank\" rel=\"noreferrer noopener\">Langchain \u7684\u535a\u5ba2<\/a><strong>\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c 1 \u6b65\uff1a\u5b89\u88c5\u548c\u5bfc\u5165\u4f9d\u8d56\u9879<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install -U --quiet langchain langchain_community chromadb &nbsp;langchain-google-vertexai<br>!pip install --quiet \"unstructured&#91;all-docs]\" pypdf pillow pydantic lxml pillow matplotlib chromadb tiktoken<\/code><\/pre>\n\n\n\n<p>\u8f93\u5165\u9879\u76ee ID \u5e76\u5b8c\u6210\u8eab\u4efd\u9a8c\u8bc1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#TODO : ENter project and location<br>PROJECT_ID = \"\"<br>REGION = \"us-central1\"<br><br>from google.colab import auth<br>auth.authenticate_user()<\/code><\/pre>\n\n\n\n<p>\u521d\u59cb\u5316 Vertex AI \u5e73\u53f0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import vertexai<br>vertexai.init(project = PROJECT_ID , location = REGION)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/codelabs.developers.google.cn\/multimodal-rag-gemini?hl=zh_cn#4\">\u7b2c 2 \u6b65\uff1a\u51c6\u5907\u548c\u52a0\u8f7d\u6570\u636e<\/a><\/h2>\n\n\n\n<p>\u6211\u4eec\u4f7f\u7528\u4e00\u4e2a zip \u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b<a href=\"https:\/\/colab.research.google.com\/corgiredirector?site=https%3A%2F%2Fcloudedjudgement.substack.com%2Fp%2Fclouded-judgement-111023&amp;hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\">\u8fd9\u7bc7<\/a>\u535a\u6587\u4e2d\u63d0\u53d6\u7684\u90e8\u5206\u56fe\u7247\u548c PDF\u3002\u5982\u679c\u60a8\u60f3\u9075\u5faa\u5b8c\u6574\u6d41\u7a0b\uff0c\u8bf7\u4f7f\u7528\u539f\u59cb<a href=\"https:\/\/github.com\/langchain-ai\/langchain\/blob\/master\/cookbook\/Multi_modal_RAG.ipynb\" target=\"_blank\" rel=\"noreferrer noopener\">\u793a\u4f8b<\/a>\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u4e0b\u8f7d\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import logging<br>import zipfile<br>import requests<br><br>logging.basicConfig(level=logging.INFO)<br><br>data_url = \"https:\/\/storage.googleapis.com\/benchmarks-artifacts\/langchain-docs-benchmarking\/cj.zip\"<br>result = requests.get(data_url)<br>filename = \"cj.zip\"<br>with open(filename, \"wb\") as file:<br>&nbsp; &nbsp;file.write(result.content)<br><br>with zipfile.ZipFile(filename, \"r\") as zip_ref:<br>&nbsp; &nbsp;zip_ref.extractall()<\/code><\/pre>\n\n\n\n<p>\u4ece\u6587\u6863\u4e2d\u52a0\u8f7d\u6587\u672c\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from langchain_community.document_loaders import PyPDFLoader<br><br>loader = PyPDFLoader(\".\/cj\/cj.pdf\")<br>docs = loader.load()<br>tables = &#91;]<br>texts = &#91;d.page_content for d in docs]<\/code><\/pre>\n\n\n\n<p>\u68c0\u67e5\u7b2c\u4e00\u9875\u7684\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>texts&#91;0]<\/code><\/pre>\n\n\n\n<p>\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u8f93\u51fa<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/2c5c257779c0f52a.png?hl=zh-cn\" alt=\"2c5c257779c0f52a.png\"\/><\/figure>\n\n\n\n<p>\u6587\u6863\u4e2d\u7684\u603b\u9875\u6570<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>len(texts)<\/code><\/pre>\n\n\n\n<p>\u9884\u671f\u8f93\u51fa\u4e3a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/b5700c0c1376abc2.png?hl=zh-cn\" alt=\"b5700c0c1376abc2.png\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c 3 \u6b65\uff1a\u751f\u6210\u6587\u672c\u6458\u8981<\/h2>\n\n\n\n<p>\u9996\u5148\u5bfc\u5165\u5fc5\u9700\u7684\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from langchain_google_vertexai import VertexAI , ChatVertexAI , VertexAIEmbeddings<br>from langchain.prompts import PromptTemplate<br>from langchain_core.messages import AIMessage<br>from langchain_core.output_parsers import StrOutputParser<br>from langchain_core.runnables import RunnableLambda<\/code><\/pre>\n\n\n\n<p>\u83b7\u53d6\u6587\u672c\u6458\u8981<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Generate summaries of text elements<br>def generate_text_summaries(texts, tables, summarize_texts=False):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Summarize text elements<br>&nbsp; &nbsp;texts: List of str<br>&nbsp; &nbsp;tables: List of str<br>&nbsp; &nbsp;summarize_texts: Bool to summarize texts<br>&nbsp; &nbsp;\"\"\"<br><br>&nbsp; &nbsp;# Prompt<br>&nbsp; &nbsp;prompt_text = \"\"\"You are an assistant tasked with summarizing tables and text for retrieval. \\<br>&nbsp; &nbsp;These summaries will be embedded and used to retrieve the raw text or table elements. \\<br>&nbsp; &nbsp;Give a concise summary of the table or text that is well optimized for retrieval. Table or text: {element} \"\"\"<br>&nbsp; &nbsp;prompt = PromptTemplate.from_template(prompt_text)<br>&nbsp; &nbsp;empty_response = RunnableLambda(<br>&nbsp; &nbsp; &nbsp; &nbsp;lambda x: AIMessage(content=\"Error processing document\")<br>&nbsp; &nbsp;)<br>&nbsp; &nbsp;# Text summary chain<br>&nbsp; &nbsp;model = VertexAI(<br>&nbsp; &nbsp; &nbsp; &nbsp;temperature=0, model_name=\"gemini-pro\", max_output_tokens=1024<br>&nbsp; &nbsp;).with_fallbacks(&#91;empty_response])<br>&nbsp; &nbsp;summarize_chain = {\"element\": lambda x: x} | prompt | model | StrOutputParser()<br><br>&nbsp; &nbsp;# Initialize empty summaries<br>&nbsp; &nbsp;text_summaries = &#91;]<br>&nbsp; &nbsp;table_summaries = &#91;]<br><br>&nbsp; &nbsp;# Apply to text if texts are provided and summarization is requested<br>&nbsp; &nbsp;if texts and summarize_texts:<br>&nbsp; &nbsp; &nbsp; &nbsp;text_summaries = summarize_chain.batch(texts, {\"max_concurrency\": 1})<br>&nbsp; &nbsp;elif texts:<br>&nbsp; &nbsp; &nbsp; &nbsp;text_summaries = texts<br><br>&nbsp; &nbsp;# Apply to tables if tables are provided<br>&nbsp; &nbsp;if tables:<br>&nbsp; &nbsp; &nbsp; &nbsp;table_summaries = summarize_chain.batch(tables, {\"max_concurrency\": 1})<br><br>&nbsp; &nbsp;return text_summaries, table_summaries<br><br><br># Get text summaries<br>text_summaries, table_summaries = generate_text_summaries(<br>&nbsp; &nbsp;texts, tables, summarize_texts=True<br>)<br><br>text_summaries&#91;0]<\/code><\/pre>\n\n\n\n<p>\u9884\u671f\u8f93\u51fa\u4e3a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/aa76e4b523d8a958.png?hl=zh-cn\" alt=\"aa76e4b523d8a958.png\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c 4 \u6b65\uff1a\u751f\u6210\u56fe\u7247\u6458\u8981<\/h2>\n\n\n\n<p>\u9996\u5148\u5bfc\u5165\u5fc5\u9700\u7684\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import base64<br>import os<br><br>from langchain_core.messages import HumanMessage<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u56fe\u7247\u6458\u8981<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def encode_image(image_path):<br>&nbsp; &nbsp;\"\"\"Getting the base64 string\"\"\"<br>&nbsp; &nbsp;with open(image_path, \"rb\") as image_file:<br>&nbsp; &nbsp; &nbsp; &nbsp;return base64.b64encode(image_file.read()).decode(\"utf-8\")<br><br><br>def image_summarize(img_base64, prompt):<br>&nbsp; &nbsp;\"\"\"Make image summary\"\"\"<br>&nbsp; &nbsp;model = ChatVertexAI(model_name=\"gemini-pro-vision\", max_output_tokens=1024)<br><br>&nbsp; &nbsp;msg = model(<br>&nbsp; &nbsp; &nbsp; &nbsp;&#91;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HumanMessage(<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;content=&#91;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{\"type\": \"text\", \"text\": prompt},<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"type\": \"image_url\",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"image_url\": {\"url\": f\"data:image\/jpeg;base64,{img_base64}\"},<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br>&nbsp; &nbsp; &nbsp; &nbsp;]<br>&nbsp; &nbsp;)<br>&nbsp; &nbsp;return msg.content<br><br><br>def generate_img_summaries(path):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Generate summaries and base64 encoded strings for images<br>&nbsp; &nbsp;path: Path to list of .jpg files extracted by Unstructured<br>&nbsp; &nbsp;\"\"\"<br><br>&nbsp; &nbsp;# Store base64 encoded images<br>&nbsp; &nbsp;img_base64_list = &#91;]<br><br>&nbsp; &nbsp;# Store image summaries<br>&nbsp; &nbsp;image_summaries = &#91;]<br><br>&nbsp; &nbsp;# Prompt<br>&nbsp; &nbsp;prompt = \"\"\"You are an assistant tasked with summarizing images for retrieval. \\<br>&nbsp; &nbsp;These summaries will be embedded and used to retrieve the raw image. \\<br>&nbsp; &nbsp;Give a concise summary of the image that is well optimized for retrieval.\"\"\"<br><br>&nbsp; &nbsp;# Apply to images<br>&nbsp; &nbsp;for img_file in sorted(os.listdir(path)):<br>&nbsp; &nbsp; &nbsp; &nbsp;if img_file.endswith(\".jpg\"):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img_path = os.path.join(path, img_file)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;base64_image = encode_image(img_path)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img_base64_list.append(base64_image)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;image_summaries.append(image_summarize(base64_image, prompt))<br><br>&nbsp; &nbsp;return img_base64_list, image_summaries<br><br><br># Image summaries<br>img_base64_list, image_summaries = generate_img_summaries(\".\/cj\")<br><br>len(img_base64_list)<br><br>len(image_summaries)<br><br>image_summaries&#91;0]<\/code><\/pre>\n\n\n\n<p>\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u5185\u5bb9\u7684\u8f93\u51fa <img decoding=\"async\" alt=\"fad6d479dd46cb37.png\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37.png?hl=zh-cn\" srcset=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_36.png?hl=zh-cn 36w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_48.png?hl=zh-cn 48w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_72.png?hl=zh-cn 72w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_96.png?hl=zh-cn 96w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_480.png?hl=zh-cn 480w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_720.png?hl=zh-cn 720w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_856.png?hl=zh-cn 856w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_960.png?hl=zh-cn 960w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_1440.png?hl=zh-cn 1440w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_1920.png?hl=zh-cn 1920w,https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/fad6d479dd46cb37_2880.png?hl=zh-cn 2880w\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c 5 \u6b65\uff1a\u6784\u5efa\u591a\u5411\u91cf\u68c0\u7d22<\/h2>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u751f\u6210\u6587\u672c\u548c\u56fe\u7247\u6458\u8981\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u5230 ChromaDB \u5411\u91cf\u5b58\u50a8\u5e93\u4e2d\u3002<\/p>\n\n\n\n<p>\u5bfc\u5165\u6240\u9700\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import uuid<br>from langchain.retrievers.multi_vector import MultiVectorRetriever<br>from langchain.storage import InMemoryStore<br>from langchain_community.vectorstores import Chroma<br>from langchain_core.documents import Document<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u591a\u5411\u91cf\u68c0\u7d22<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def create_multi_vector_retriever(\n\u00a0 \u00a0vectorstore, text_summaries, texts, table_summaries, tables, image_summaries, images\n):\n\u00a0 \u00a0\"\"\"\n\u00a0 \u00a0Create retriever that indexes summaries, but returns raw images or texts\n\u00a0 \u00a0\"\"\"\n\n\u00a0 \u00a0# Initialize the storage layer\n\u00a0 \u00a0store = InMemoryStore()\n\u00a0 \u00a0id_key = \"doc_id\"\n\n\u00a0 \u00a0# Create the multi-vector retriever\n\u00a0 \u00a0retriever = MultiVectorRetriever(\n\u00a0 \u00a0 \u00a0 \u00a0vectorstore=vectorstore,\n\u00a0 \u00a0 \u00a0 \u00a0docstore=store,\n\u00a0 \u00a0 \u00a0 \u00a0id_key=id_key,\n\u00a0 \u00a0)\n\n\u00a0 \u00a0# Helper function to add documents to the vectorstore and docstore\n\u00a0 \u00a0def add_documents(retriever, doc_summaries, doc_contents):\n\u00a0 \u00a0 \u00a0 \u00a0doc_ids = &#91;str(uuid.uuid4()) for _ in doc_contents]\n\u00a0 \u00a0 \u00a0 \u00a0summary_docs = &#91;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Document(page_content=s, metadata={id_key: doc_ids&#91;i]})\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0for i, s in enumerate(doc_summaries)\n\u00a0 \u00a0 \u00a0 \u00a0]\n\u00a0 \u00a0 \u00a0 \u00a0retriever.vectorstore.add_documents(summary_docs)\n\u00a0 \u00a0 \u00a0 \u00a0retriever.docstore.mset(list(zip(doc_ids, doc_contents)))\n\n\u00a0 \u00a0# Add texts, tables, and images\n\u00a0 \u00a0# Check that text_summaries is not empty before adding\n\u00a0 \u00a0if text_summaries:\n\u00a0 \u00a0 \u00a0 \u00a0add_documents(retriever, text_summaries, texts)\n\u00a0 \u00a0# Check that table_summaries is not empty before adding\n\u00a0 \u00a0if table_summaries:\n\u00a0 \u00a0 \u00a0 \u00a0add_documents(retriever, table_summaries, tables)\n\u00a0 \u00a0# Check that image_summaries is not empty before adding\n\u00a0 \u00a0if image_summaries:\n\u00a0 \u00a0 \u00a0 \u00a0add_documents(retriever, image_summaries, images)\n\n\u00a0 \u00a0return retriever\n\n\n# The vectorstore to use to index the summaries\nvectorstore = Chroma(\n\u00a0 \u00a0collection_name=\"mm_rag_cj_blog\",\n\u00a0 \u00a0embedding_function=VertexAIEmbeddings(model_name=\"textembedding-gecko@latest\"),\n)\n\n# Create retriever\nretriever_multi_vector_img = create_multi_vector_retriever(\n\u00a0 \u00a0vectorstore,\n\u00a0 \u00a0text_summaries,\n\u00a0 \u00a0texts,\n\u00a0 \u00a0table_summaries,\n\u00a0 \u00a0tables,\n\u00a0 \u00a0image_summaries,\n\u00a0 \u00a0img_base64_list,\n)\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c 6 \u6b65\uff1a\u6784\u5efa\u591a\u6a21\u6001 RAG<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5b9a\u4e49\u5b9e\u7528\u51fd\u6570<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>import io<br>import re<br><br>from IPython.display import HTML, display<br>from langchain_core.runnables import RunnableLambda, RunnablePassthrough<br>from PIL import Image<br><br><br>def plt_img_base64(img_base64):<br>&nbsp; &nbsp;\"\"\"Disply base64 encoded string as image\"\"\"<br>&nbsp; &nbsp;# Create an HTML img tag with the base64 string as the source<br>&nbsp; &nbsp;image_html = f'&lt;img src=\"data:image\/jpeg;base64,{img_base64}\" \/&gt;'<br>&nbsp; &nbsp;# Display the image by rendering the HTML<br>&nbsp; &nbsp;display(HTML(image_html))<br><br><br>def looks_like_base64(sb):<br>&nbsp; &nbsp;\"\"\"Check if the string looks like base64\"\"\"<br>&nbsp; &nbsp;return re.match(\"^&#91;A-Za-z0-9+\/]+&#91;=]{0,2}$\", sb) is not None<br><br><br>def is_image_data(b64data):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Check if the base64 data is an image by looking at the start of the data<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;image_signatures = {<br>&nbsp; &nbsp; &nbsp; &nbsp;b\"\\xFF\\xD8\\xFF\": \"jpg\",<br>&nbsp; &nbsp; &nbsp; &nbsp;b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",<br>&nbsp; &nbsp; &nbsp; &nbsp;b\"\\x47\\x49\\x46\\x38\": \"gif\",<br>&nbsp; &nbsp; &nbsp; &nbsp;b\"\\x52\\x49\\x46\\x46\": \"webp\",<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;try:<br>&nbsp; &nbsp; &nbsp; &nbsp;header = base64.b64decode(b64data)&#91;:8] &nbsp;# Decode and get the first 8 bytes<br>&nbsp; &nbsp; &nbsp; &nbsp;for sig, format in image_signatures.items():<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if header.startswith(sig):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return True<br>&nbsp; &nbsp; &nbsp; &nbsp;return False<br>&nbsp; &nbsp;except Exception:<br>&nbsp; &nbsp; &nbsp; &nbsp;return False<br><br><br>def resize_base64_image(base64_string, size=(128, 128)):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Resize an image encoded as a Base64 string<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;# Decode the Base64 string<br>&nbsp; &nbsp;img_data = base64.b64decode(base64_string)<br>&nbsp; &nbsp;img = Image.open(io.BytesIO(img_data))<br><br>&nbsp; &nbsp;# Resize the image<br>&nbsp; &nbsp;resized_img = img.resize(size, Image.LANCZOS)<br><br>&nbsp; &nbsp;# Save the resized image to a bytes buffer<br>&nbsp; &nbsp;buffered = io.BytesIO()<br>&nbsp; &nbsp;resized_img.save(buffered, format=img.format)<br><br>&nbsp; &nbsp;# Encode the resized image to Base64<br>&nbsp; &nbsp;return base64.b64encode(buffered.getvalue()).decode(\"utf-8\")<br><br><br>def split_image_text_types(docs):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Split base64-encoded images and texts<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;b64_images = &#91;]<br>&nbsp; &nbsp;texts = &#91;]<br>&nbsp; &nbsp;for doc in docs:<br>&nbsp; &nbsp; &nbsp; &nbsp;# Check if the document is of type Document and extract page_content if so<br>&nbsp; &nbsp; &nbsp; &nbsp;if isinstance(doc, Document):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;doc = doc.page_content<br>&nbsp; &nbsp; &nbsp; &nbsp;if looks_like_base64(doc) and is_image_data(doc):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;doc = resize_base64_image(doc, size=(1300, 600))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;b64_images.append(doc)<br>&nbsp; &nbsp; &nbsp; &nbsp;else:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;texts.append(doc)<br>&nbsp; &nbsp;if len(b64_images) &gt; 0:<br>&nbsp; &nbsp; &nbsp; &nbsp;return {\"images\": b64_images&#91;:1], \"texts\": &#91;]}<br>&nbsp; &nbsp;return {\"images\": b64_images, \"texts\": texts}<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u5b9a\u4e49\u7279\u5b9a\u4e8e\u7f51\u57df\u7684\u56fe\u7247\u63d0\u793a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>def img_prompt_func(data_dict):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Join the context into a single string<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;formatted_texts = \"\\n\".join(data_dict&#91;\"context\"]&#91;\"texts\"])<br>&nbsp; &nbsp;messages = &#91;]<br><br>&nbsp; &nbsp;# Adding the text for analysis<br>&nbsp; &nbsp;text_message = {<br>&nbsp; &nbsp; &nbsp; &nbsp;\"type\": \"text\",<br>&nbsp; &nbsp; &nbsp; &nbsp;\"text\": (<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"You are financial analyst tasking with providing investment advice.\\n\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"You will be given a mixed of text, tables, and image(s) usually of charts or graphs.\\n\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"Use this information to provide investment advice related to the user question. \\n\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f\"User-provided question: {data_dict&#91;'question']}\\n\\n\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"Text and \/ or tables:\\n\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f\"{formatted_texts}\"<br>&nbsp; &nbsp; &nbsp; &nbsp;),<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;messages.append(text_message)<br>&nbsp; &nbsp;# Adding image(s) to the messages if present<br>&nbsp; &nbsp;if data_dict&#91;\"context\"]&#91;\"images\"]:<br>&nbsp; &nbsp; &nbsp; &nbsp;for image in data_dict&#91;\"context\"]&#91;\"images\"]:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;image_message = {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"type\": \"image_url\",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"image_url\": {\"url\": f\"data:image\/jpeg;base64,{image}\"},<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;messages.append(image_message)<br>&nbsp; &nbsp;return &#91;HumanMessage(content=messages)]<br><\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>\u5b9a\u4e49\u591a\u6a21\u6001 RAG \u94fe<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>def multi_modal_rag_chain(retriever):<br>&nbsp; &nbsp;\"\"\"<br>&nbsp; &nbsp;Multi-modal RAG chain<br>&nbsp; &nbsp;\"\"\"<br><br>&nbsp; &nbsp;# Multi-modal LLM<br>&nbsp; &nbsp;model = ChatVertexAI(<br>&nbsp; &nbsp; &nbsp; &nbsp;temperature=0, model_name=\"gemini-pro-vision\", max_output_tokens=1024<br>&nbsp; &nbsp;)<br><br>&nbsp; &nbsp;# RAG pipeline<br>&nbsp; &nbsp;chain = (<br>&nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"context\": retriever | RunnableLambda(split_image_text_types),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\"question\": RunnablePassthrough(),<br>&nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; &nbsp; &nbsp;| RunnableLambda(img_prompt_func)<br>&nbsp; &nbsp; &nbsp; &nbsp;| model<br>&nbsp; &nbsp; &nbsp; &nbsp;| StrOutputParser()<br>&nbsp; &nbsp;)<br><br>&nbsp; &nbsp;return chain<br><br><br># Create RAG chain<br>chain_multimodal_rag = multi_modal_rag_chain(retriever_multi_vector_img)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c 7 \u6b65\uff1a\u6d4b\u8bd5\u67e5\u8be2<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u68c0\u7d22\u76f8\u5173\u6587\u6863<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>query = \"What are the EV \/ NTM and NTM rev growth for MongoDB, Cloudflare, and Datadog?\"<br>docs = retriever_multi_vector_img.get_relevant_documents(query, limit=1)<br><br># We get relevant docs<br>len(docs)<br><br>docs<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;You may get similar output <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/74ecaca749ae459a.png?hl=zh-cn\" alt=\"74ecaca749ae459a.png\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>plt_img_base64(docs&#91;3])<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/989ad388127f5d60.png?hl=zh-cn\" alt=\"989ad388127f5d60.png\"\/><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u9488\u5bf9\u540c\u4e00\u67e5\u8be2\u8fd0\u884c RAG<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>result = chain_multimodal_rag.invoke(query)<br><br>from IPython.display import Markdown as md<br>md(result)<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u793a\u4f8b\uff08\u6267\u884c\u4ee3\u7801\u65f6\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/codelabs.developers.google.cn\/static\/multimodal-rag-gemini\/img\/e5e102eaf10289ab.png?hl=zh-cn\" alt=\"e5e102eaf10289ab.png\"\/><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f RAG \u68c0\u7d22\u589e\u5f3a\u751f\u6210 (RAG) \u662f\u4e00\u79cd\u5c06\u5927\u8bed\u8a00\u6a21\u578b (LLM) \u7684\u5f3a\u5927\u529f\u80fd\u4e0e\u4ece\u5916\u90e8\u77e5\u8bc6\u6765\u6e90\u68c0\u7d22\u76f8\u5173\u4fe1\u606f\u7684\u80fd\u529b\u76f8\u7ed3\u5408\u7684\u6280\u672f\u3002\u8fd9\u610f\u5473\u7740 LLM \u4e0d\u4ec5\u4f9d\u8d56\u4e8e\u5176\u5185\u90e8\u8bad\u7ec3\u6570\u636e\uff0c\u8fd8\u53ef\u4ee5\u5728\u751f\u6210\u56de\u7b54\u65f6\u8bbf\u95ee\u5e76\u7eb3\u5165\u6700\u65b0\u7684\u7279\u5b9a\u4fe1\u606f\u3002 RAG \u8d8a\u6765\u8d8a\u53d7\u6b22\u8fce\uff0c\u539f\u56e0\u6709\u4ee5\u4e0b\u51e0\u4e2a\uff1a \u4e3a\u4ec0\u4e48\u9009\u62e9\u591a\u6a21\u6001 \u5728\u5f53\u4eca\u8fd9\u4e2a\u6570\u636e\u4e30\u5bcc\u7684\u4e16\u754c\u4e2d\uff0c\u6587\u6863\u901a\u5e38\u4f1a\u7ed3\u5408\u4f7f\u7528\u6587\u672c\u548c\u56fe\u7247\u6765\u5168\u9762\u4f20\u8fbe\u4fe1\u606f\u3002\u4e0d\u8fc7\uff0c\u5927\u591a\u6570\u68c0\u7d22\u589e\u5f3a\u751f\u6210 (RAG) \u7cfb\u7edf\u90fd\u5ffd\u7565&hellip;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-ai","category-gcp"],"_links":{"self":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/comments?post=363"}],"version-history":[{"count":1,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/posts\/363\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/media?parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/categories?post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flycloud.io\/en\/wp-json\/wp\/v2\/tags?post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}