一直沒找到辦法 突然被我找到了
下面的json 趴那學習去
{
"name": "ocr-text",
"nodes": [
{
"parameters": {
"formTitle": "上传图片",
"formFields": {
"values": [
{
"fieldLabel": "images",
"fieldType": "file",
"acceptFileTypes": ".jpg,.png"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.formTrigger",
"typeVersion": 2.2,
"position": [
-760,
-180
],
"id": "ee04c594-ce2e-428e-8ddf-f0426a4f8be0",
"name": "On form submission",
"webhookId": "6cb14305-2653-423f-a1d9-9591b59187f8"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-360,
-180
],
"id": "63e3faf1-db21-4ddf-8467-e7cf702b9ae8",
"name": "Loop Over Items"
},
{
"parameters": {
"operation": "binaryToPropery",
"binaryPropertyName": "=data",
"destinationKey": "=data",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
-140,
-160
],
"id": "5cfba5ab-adef-4844-ba1e-6deb67cc8809",
"name": "Extract from File"
},
{
"parameters": {
"jsCode": "// 在 Code 节点中运行一次性所有 items\nlet results = [];\nfor (const item of $input.all()) {\n for (const key of Object.keys(item.binary)) {\n results.push({\n json: item.json,\n binary: { data: item.binary[key] },\n });\n }\n}\nreturn results;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-580,
-180
],
"id": "be9fda21-ea0b-4908-aaa1-9538ef2bd551",
"name": "Code"
},
{
"parameters": {
"method": "POST",
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=AIzaSyCA4IdUNqI_Azim_8_ZqXTif6F5-QU7MS8",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"请从图片中提取全部文本内容。严格按照图片中的原有格式和排版进行输出。输出中不得包含任何额外的说明文字、解释、前言、后语或图片中不存在的符号。只输出纯粹的提取结果。\"\n },\n {\n \"inline_data\": {\n \"mime_type\": \"image/jpeg\",\n \"data\": \"{{ $json.data }}\"\n }\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"temperature\": 0.2,\n \"maxOutputTokens\": 65536\n }\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
60,
-160
],
"id": "f407e5d0-0d8d-488c-b4ed-669e08a3c134",
"name": "HTTP Request"
},
{
"parameters": {},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
460,
-100
],
"id": "b8827b1b-6ea3-4797-b722-5ce25be8e75c",
"name": "Wait",
"webhookId": "96ecc73c-b224-4b1d-9817-0fdfb14fe7ab"
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "1dizE2uMw2id5nXyguL486nJZlQ_exECH7-3yGEivVZ8",
"mode": "list",
"cachedResultName": "ocr-text",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dizE2uMw2id5nXyguL486nJZlQ_exECH7-3yGEivVZ8/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dizE2uMw2id5nXyguL486nJZlQ_exECH7-3yGEivVZ8/edit#gid=0"
},
"columns": {
"mappingMode": "autoMapInputData",
"value": {},
"matchingColumns": [],
"schema": [
{
"id": "candidates",
"displayName": "candidates",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "usageMetadata",
"displayName": "usageMetadata",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "modelVersion",
"displayName": "modelVersion",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
260,
-160
],
"id": "92949645-5dce-46b1-9a6a-d38bf5fd10f8",
"name": "Google Sheets",
"credentials": {
"googleSheetsOAuth2Api": {
"id": "bB5yWZ7H611nnPK6",
"name": "Google Sheets account"
}
}
}
],
"pinData": {},
"connections": {
"On form submission": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "d108be40-5ad3-4762-863a-de717b3ef6fa",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "842e089ebeca6cebf71676a6a2ba2cddf5a9039b264a25f6a7ee9230b3376b1b"
},
"id": "nfNK5POhIZI66QjG",
"tags": []
}
之後應該不會有編號了 n8n 就作為我的一個長期項目吧
應用展示
聲音檔案
