{"_id":"@clairview/ai-alt-text-writer-operation","name":"@clairview/ai-alt-text-writer-operation","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@clairview/ai-alt-text-writer-operation","description":"Use Clarifai to create captions for your image files.","icon":"extension","version":"1.0.1","license":"MIT","keywords":["clairview","clairview-extension","clairview-extension-operation"],"type":"module","clairview:extension":{"type":"operation","path":{"app":"dist/app.js","api":"dist/api.js"},"source":{"app":"src/app.ts","api":"src/api.ts"},"host":"^10.10.0","sandbox":{"enabled":true,"requestedScopes":{"log":{},"request":{"methods":["POST"],"urls":["https://api.clarifai.com/v2/**"]}}}},"scripts":{"build":"clairview-extension build","dev":"clairview-extension build -w --no-minify","link":"clairview-extension link"},"devDependencies":{"@clairview/extensions-sdk":"12.1.1","@types/node":"^20.11.26","typescript":"^5.4.2","vue":"^3.4.21"},"_id":"@clairview/ai-alt-text-writer-operation@1.0.1","gitHead":"8dfc241481f03cec86411d70eea59812650d88a9","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-FdplORpGDnqtbSHqRgF9W4XFC+e7p4oZqjX511vN7wOH1HhqPFzwG8uOsGbQIL9fIQBGtK3vQuQ8H8T/sigdFA==","shasum":"2241079286b52fd87031eb0bef5f8cb8c3f907f6","tarball":"https://registry.npmjs.org/@clairview/ai-alt-text-writer-operation/-/ai-alt-text-writer-operation-1.0.1.tgz","fileCount":4,"unpackedSize":4990,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSNaLmcyFKZY0Xny2ke2lhU4Cyucp4nJsfcrvEHNc/6AiBdK8mjMRTrJ/RFcfrXswW2mvTGvNzbwMCllfbKTj5Vgw=="}]},"_npmUser":{"name":"clairview","email":"developers@clairview.io"},"directories":{},"maintainers":[{"name":"clairview","email":"developers@clairview.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ai-alt-text-writer-operation_1.0.1_1730455112938_0.36575093098650524"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-01T09:58:32.815Z","1.0.1":"2024-11-01T09:58:33.098Z","modified":"2024-11-01T09:58:33.352Z"},"maintainers":[{"name":"clairview","email":"developers@clairview.io"}],"description":"Use Clarifai to create captions for your image files.","keywords":["clairview","clairview-extension","clairview-extension-operation"],"license":"MIT","readme":"# AI Alt Text Writer Operation\n\nCreate captions for your images within Clairview Files with this custom operation, using [Clarifai](https://www.clarifai.com).\n\n![The AI Alt Text Writer operation, showing available options](https://raw.githubusercontent.com/clairview/extension-ai-alt-text-writer/main/docs/options.png)\n\nThis operation requires two options to be set - first a personal access token from [Clarifai](https://www.clarifai.com) (you can find this in your personal settings under [Security](https://clarifai.com/settings/security)), and a link to the image file. The operation will return a string containing a text that describes the image.\n\nYou can use the operation to then save the result to a file description or item, or run further automation on the output.\n\n## Output\n\nThis operation will output the text that was generated from the provided image:\n\n```json\n\"a photograph of a man standing in front of a large explosion of smoke\"\n```\n\n## Flow Setup\n\n### Automatically Write Alt Text For New Files\n\nCreate a Flow with an **Event Hook** action trigger and a scope of `files.upload`. Use the AI Alt Text Writer operation, setting the File URL to `https://your-clairview-project-url/assets/{{ $trigger.key }}`, being sure to provide your specific Clairview Project URL.\n\nThis will work if your file is public, but if it isn't, you can append `?access_token=token` to the File URL, replacing the value with a valid user token that has access to the file.\n\nThis operation will trigger on every new file upload, regardless of location or filetype. You may wish to add a conditional step between the trigger and transcription operation. The following condition rule will check that the file is an image:\n\n```json\n{\n    \"$trigger\": {\n        \"payload\": {\n            \"type\": {\n                \"_contains\": \"image\"\n            }\n        }\n    }\n}\n```\n\n### Write Alt Text On-Demand\n\nCreate a Flow with a **Manual** trigger and select a collection with a file field, which should contain an image file. Set the Location to Item Page Only. To receive the file ID create a **Read Data** operation for the same collection, setting IDs to `{{ $trigger.body.keys[0] }}`.\n\nUse the AI Alt Text Writer operation, setting the File URL to `https://your-clairview-project-url/assets/{{ $last.file_field_name }}`, being sure to provide your specific Clairview Project URL and file field name.\n","readmeFilename":"README.md"}