[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"github-stars":3,"marketplace-site-banners":110,"anthropic":115},{"id":4,"node_id":5,"name":6,"full_name":7,"private":8,"owner":9,"html_url":27,"description":28,"fork":8,"url":29,"forks_url":30,"keys_url":31,"collaborators_url":32,"teams_url":33,"hooks_url":34,"issue_events_url":35,"events_url":36,"assignees_url":37,"branches_url":38,"tags_url":39,"blobs_url":40,"git_tags_url":41,"git_refs_url":42,"trees_url":43,"statuses_url":44,"languages_url":45,"stargazers_url":46,"contributors_url":47,"subscribers_url":48,"subscription_url":49,"commits_url":50,"git_commits_url":51,"comments_url":52,"issue_comment_url":53,"contents_url":54,"compare_url":55,"merges_url":56,"archive_url":57,"downloads_url":58,"issues_url":59,"pulls_url":60,"milestones_url":61,"notifications_url":62,"labels_url":63,"releases_url":64,"deployments_url":65,"created_at":66,"updated_at":67,"pushed_at":68,"git_url":69,"ssh_url":70,"clone_url":71,"svn_url":27,"homepage":72,"size":73,"stargazers_count":74,"watchers_count":74,"language":75,"has_issues":76,"has_projects":76,"has_downloads":76,"has_wiki":8,"has_pages":8,"has_discussions":76,"forks_count":77,"mirror_url":78,"archived":8,"disabled":8,"open_issues_count":79,"license":80,"allow_forking":76,"is_template":8,"web_commit_signoff_required":8,"has_pull_requests":76,"pull_request_creation_policy":85,"topics":86,"visibility":26,"forks":77,"open_issues":79,"watchers":74,"default_branch":106,"temp_clone_token":78,"custom_properties":107,"organization":108,"network_count":77,"subscribers_count":109},7122594,"MDEwOlJlcG9zaXRvcnk3MTIyNTk0","directus","directus\u002Fdirectus",false,{"login":6,"id":10,"node_id":11,"avatar_url":12,"gravatar_id":13,"url":14,"html_url":15,"followers_url":16,"following_url":17,"gists_url":18,"starred_url":19,"subscriptions_url":20,"organizations_url":21,"repos_url":22,"events_url":23,"received_events_url":24,"type":25,"user_view_type":26,"site_admin":8},15967950,"MDEyOk9yZ2FuaXphdGlvbjE1OTY3OTUw","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F15967950?v=4","","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus","https:\u002F\u002Fgithub.com\u002Fdirectus","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Ffollowers","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Ffollowing{\u002Fother_user}","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Fgists{\u002Fgist_id}","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Fstarred{\u002Fowner}{\u002Frepo}","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Fsubscriptions","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Forgs","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Frepos","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Fevents{\u002Fprivacy}","https:\u002F\u002Fapi.github.com\u002Fusers\u002Fdirectus\u002Freceived_events","Organization","public","https:\u002F\u002Fgithub.com\u002Fdirectus\u002Fdirectus","The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fforks","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fkeys{\u002Fkey_id}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fcollaborators{\u002Fcollaborator}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fteams","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fhooks","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fissues\u002Fevents{\u002Fnumber}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fevents","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fassignees{\u002Fuser}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fbranches{\u002Fbranch}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Ftags","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fgit\u002Fblobs{\u002Fsha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fgit\u002Ftags{\u002Fsha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fgit\u002Frefs{\u002Fsha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fgit\u002Ftrees{\u002Fsha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fstatuses\u002F{sha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Flanguages","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fstargazers","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fcontributors","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fsubscribers","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fsubscription","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fcommits{\u002Fsha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fgit\u002Fcommits{\u002Fsha}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fcomments{\u002Fnumber}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fissues\u002Fcomments{\u002Fnumber}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fcontents\u002F{+path}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fcompare\u002F{base}...{head}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fmerges","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002F{archive_format}{\u002Fref}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fdownloads","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fissues{\u002Fnumber}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fpulls{\u002Fnumber}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fmilestones{\u002Fnumber}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fnotifications{?since,all,participating}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Flabels{\u002Fname}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Freleases{\u002Fid}","https:\u002F\u002Fapi.github.com\u002Frepos\u002Fdirectus\u002Fdirectus\u002Fdeployments","2012-12-12T01:35:36Z","2026-07-18T05:08:19Z","2026-07-17T21:10:45Z","git:\u002F\u002Fgithub.com\u002Fdirectus\u002Fdirectus.git","git@github.com:directus\u002Fdirectus.git","https:\u002F\u002Fgithub.com\u002Fdirectus\u002Fdirectus.git","https:\u002F\u002Fdirectus.com",447310,36507,"TypeScript",true,4850,null,399,{"key":81,"name":82,"spdx_id":83,"url":78,"node_id":84},"other","Other","NOASSERTION","MDc6TGljZW5zZTA=","all",[87,88,89,90,91,92,6,93,94,95,96,97,98,99,100,101,102,103,104,105],"api","app","cms","composable","data-visualization","database","graphql","headless-cms","javascript","mariadb","mssql","mysql","no-code","node","postgresql","sql","sqlite","typescript","vue","main",{},{"login":6,"id":10,"node_id":11,"avatar_url":12,"gravatar_id":13,"url":14,"html_url":15,"followers_url":16,"following_url":17,"gists_url":18,"starred_url":19,"subscriptions_url":20,"organizations_url":21,"repos_url":22,"events_url":23,"received_events_url":24,"type":25,"user_view_type":26,"site_admin":8},326,[111],{"id":112,"icon":78,"content":113,"link":114,"include_paths":78,"exclude_paths":78},"5cf2f5f6-aecf-4395-8c23-69de326fdf02","Directus V12 is here","https:\u002F\u002Fdirectus.com\u002Fresources\u002Fv12-built-for-the-whole-team",{"metadata":78,"logo":116,"helpful_resources":117,"extensions":121,"date_updated":123,"user_updated":124,"date_created":125,"user_created":126,"sort":78,"id":127,"category":128,"description":129,"slug":130,"name":131,"content":132,"website":133,"status":134,"external_resources":135,"extensionDetails":136},"25023bb9-8069-4ce3-ae65-dab167d964e5",[118],{"title":119,"url":120},"Anthropic API Documentation","https:\u002F\u002Fdocs.anthropic.com\u002F",[122],"@directus-labs\u002Fai-writer-operation","2025-07-30T17:40:52.165Z","1a9ab95a-93bc-4908-af85-0d42bb6e6aa6","2025-07-11T14:29:17.086Z","1cd0a355-b103-477d-9375-61e88f3110f8","28f136e6-7d80-40f6-8f48-bf90ba45086b","AI","Leverage Claude AI for content generation, analysis, and intelligent content workflows with advanced reasoning","anthropic","Anthropic","\u003Cp>Anthropic is an AI company known for Claude, a large language model designed to generate, analyze, and process content with a high level of reasoning. Businesses and developers use Claude to handle tasks like writing, summarizing, and understanding complex text.\u003C\u002Fp>\n\u003Cp>When integrated with Directus, Anthropic&rsquo;s Claude AI can help automate content creation and editorial workflows. For example, with the @directus-labs\u002Fai-writer-operation extension, users can generate articles, product descriptions, or summaries directly inside Directus. This makes it easy to keep content fresh, accurate, and tailored to your needs without manual writing or heavy lifting. Claude&rsquo;s advanced language abilities also support data analysis.\u003C\u002Fp>\n\u003Cp>You can use it to review large sets of content, spot patterns, and extract key information. For anyone managing content-heavy projects or large datasets in Directus, this integration offers a simple way to boost productivity and ensure quality.\u003C\u002Fp>\n\u003Cp>To learn more, visit Anthropic&rsquo;s website: https:\u002F\u002Fwww.anthropic.com\u003C\u002Fp>","https:\u002F\u002Fwww.anthropic.com","published",[],[137],{"name":122,"description":138,"verified":8,"id":139,"readme":140,"type":141,"last_updated":142,"host_version":143,"downloads":144,"total_downloads":221,"sandbox":76,"license":233,"publisher":234,"versions":240,"formatted_name":382,"formatted_readme":383,"formatted_description":138,"featured_image":384,"images":385,"repository_url":265,"recent_downloads_7_days":387,"recent_downloads_30_days":388},"Use OpenAI, Claude, Meta and Mistral Text Generation APIs to generate text.","8c20b301-38aa-48a7-99c4-3142338da1b2","# AI Writer Operation\n\nGenerate text based on a written prompt within Directus Flows with this custom operation, powered by [OpenAI's Text Generation API]([https:\u002F\u002F.com](https:\u002F\u002Fopenai.com\u002Fproduct)), [Anthropic](https:\u002F\u002Fwww.anthropic.com\u002F) [MistralAi  (via Replicate)](https:\u002F\u002Freplicate.com\u002Fmistralai\u002Fmistral-7b-v0.1) and [Meta's LLama (via Replicate)](https:\u002F\u002Freplicate.com\u002Fmeta\u002Fmeta-llama-3.1-405b-instruct).\n\n![The AI Writer operation, showing a masked OpenAI API Key field, model and prompt selection fields, and a multiline text input.](https:\u002F\u002Fraw.githubusercontent.com\u002Fdirectus-labs\u002Fextensions\u002Fmain\u002Fpackages\u002Fai-writer-operation\u002Fdocs\u002Foptions.png)\n\n## Configuration\nThis operation contains some configuration options - an Api-Key, a selection of which model and prompt to use, and a text input. The text input can contain references like `{{$last.data}}` to refer to data available in the current flow. The prompt can be customised further using the optional Messages repeater field. The operation returns a string of the transformed or generated text.\n\n![The output showing a string that has been grammatically fixed.](https:\u002F\u002Fraw.githubusercontent.com\u002Fdirectus-labs\u002Fextensions\u002Fmain\u002Fpackages\u002Fai-writer-operation\u002Fdocs\u002Foutput.png)\n\n### API-Keys\nYou can generate your API-Keys on the follosing sites:\n- [OpenAI](https:\u002F\u002Fplatform.openai.com\u002Fapi-keys)\n- [Anthropic](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fworkspaces\u002Fdefault\u002Fkeys)\n- [Replicate](https:\u002F\u002Freplicate.com\u002Faccount\u002Fapi-tokens)\n\n## Custom Prompts\n\nFor a completely custom prompt using the \"Create custom prompt\" type, you will need to create a **system** message at the start of the message thread so that the Text Generation API knows how it should respond. Examples of initial system prompts can be found in the config objects of each built-in prompt in the [source code of this extension](https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextension-ai-writer-operation\u002Ftree\u002Fproduction\u002Fsrc\u002Fprompts). OpenAI also provides a solid overview of [how to write good prompts](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fprompt-engineering).\n\n## Customising Responses (Advanced users)\n\nThe Messages repeater can be used to create or extend seed prompts to OpenAI's Text Generation API. The Messages repeater creates an array of messages that form a conversation thread. The Text Generation API will refer to the thread to determine how it should respond to further user prompts. The content in the Text field is used as the last user prompt sent to the Text Generation API before receiving the final response. This response is forwarded to the next operation in the flow as a string.\n\nMessages can be simulated as coming from one of three roles:\n\n* **System** — Modifies the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. An initial system message is already included for each prompt type. Using this option will add further system messages to the thread.\n* **User** — User provided requests or comments for the assistant to respond to\n* **Assistant** — Example responses generated by the Text Generation API to help provide hints on how the Generative Text API should respond.\n\n[OpenAI's Documentation](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Ftext-generation\u002Fchat-completions-api) explains further how the underlying API and models work. It may be helpful to read these to better understand the underlying process. The following quote from the documentation is important for understanding the Message Thread format and intent:\n\n> Typically, a conversation is formatted with a system message first, followed by alternating user and assistant messages.\n\nGetting a desired output works best when following the format of creating a **system** message first followed by alternating between **user**, then **assistant** responses. Each of the preset prompt types available in the drop down field include a system message except for the \"Create Custom Prompt\" option which allows you a lot more flexibility.\n\n### Extending Built-in Prompts\n\nYou can add more messages to the conversation thread, before getting your final response, by adding them to the Messages repeater field. These are injected at the end of the built-in seed thread and before the final prompt is sent.\n\nThis can be useful for:\n\n* Providing examples of the expected behaviour\n* Injecting content from your Directus instance to show the type of tone used in your project\n* Providing clarifying instructions - the [Editor prompt](https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextension-ai-writer-operation\u002Ftree\u002Fproduction\u002Fsrc\u002Fprompts\u002Feditor.js) makes use of this as Chat GPT-3.5 can get confused when given a prompt to edit that looks like a new instruction\n\nKeep in mind that OpenAI pricing charges for both [tokens](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Ftext-generation\u002Fmanaging-tokens) received *and* sent. Longer seed threads will result in higher usage costs.\n","operation","2026-03-10T20:46:32.467Z","^10.0.0 || ^11.0.0",[145,148,151,154,157,160,163,166,169,172,175,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,227,230],{"date":146,"count":147},"2026-06-17",50,{"date":149,"count":150},"2026-06-18",91,{"date":152,"count":153},"2026-06-19",69,{"date":155,"count":156},"2026-06-20",19,{"date":158,"count":159},"2026-06-21",13,{"date":161,"count":162},"2026-06-22",64,{"date":164,"count":165},"2026-06-23",29,{"date":167,"count":168},"2026-06-24",33,{"date":170,"count":171},"2026-06-25",63,{"date":173,"count":174},"2026-06-26",48,{"date":176,"count":156},"2026-06-27",{"date":178,"count":179},"2026-06-28",12,{"date":181,"count":182},"2026-06-29",88,{"date":184,"count":185},"2026-06-30",80,{"date":187,"count":188},"2026-07-01",125,{"date":190,"count":191},"2026-07-02",126,{"date":193,"count":194},"2026-07-03",75,{"date":196,"count":197},"2026-07-04",32,{"date":199,"count":200},"2026-07-05",41,{"date":202,"count":203},"2026-07-06",94,{"date":205,"count":206},"2026-07-07",77,{"date":208,"count":209},"2026-07-08",113,{"date":211,"count":212},"2026-07-09",87,{"date":214,"count":215},"2026-07-10",90,{"date":217,"count":218},"2026-07-11",47,{"date":220,"count":221},"2026-07-12",0,{"date":223,"count":224},"2026-07-13",107,{"date":226,"count":209},"2026-07-14",{"date":228,"count":229},"2026-07-15",78,{"date":231,"count":232},"2026-07-16",98,"MIT",{"username":235,"verified":76,"id":236,"github_username":235,"github_name":237,"github_blog":238,"github_bio":78,"github_location":78,"github_company":78,"github_avatar_url":239},"bryantgillespie","85f85c84-9af0-4ba7-a30f-3617605d412b","Bryant Gillespie","https:\u002F\u002Fwww.bryantgillespie.com","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F23302570?v=4",[241,262,282,299,314,330,346,364],{"version":242,"package":139,"publisher":236,"type":141,"host_version":143,"publish_date":243,"verified":8,"id":244,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":245,"unpacked_size":246,"sandbox":76,"sandbox_requested_scopes":247,"license":233,"bundled":258,"maintainers":259},"1.4.1","2025-05-29T20:21:42.088Z","32125e1a-7d7b-4701-a3b2-8176fe9cbb0b",5,88512,{"request":248,"log":256,"sleep":257},{"urls":249,"methods":253},[250,251,252],"https:\u002F\u002Fapi.openai.com\u002Fv1\u002F**","https:\u002F\u002Fapi.anthropic.com\u002Fv1\u002F**","https:\u002F\u002Fapi.replicate.com\u002Fv1\u002F**",[254,255],"POST","GET",{},{},[],[260,261],12578,12579,{"version":263,"package":139,"publisher":236,"type":141,"host_version":143,"publish_date":142,"verified":8,"id":264,"url_repository":265,"url_homepage":266,"url_bugs":267,"file_count":268,"unpacked_size":269,"sandbox":76,"sandbox_requested_scopes":270,"license":233,"bundled":276,"maintainers":277},"1.4.3","3780982e-9cf9-4800-9dff-4d72d9389826","https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextensions.git","https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextensions#readme","https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextensions\u002Fissues",4,88179,{"request":271,"log":274,"sleep":275},{"urls":272,"methods":273},[250,251,252],[254,255],{},{},[],[278,279,280,281],13908,13909,13910,13911,{"version":283,"package":139,"publisher":284,"type":141,"host_version":285,"publish_date":286,"verified":8,"id":287,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":268,"unpacked_size":288,"sandbox":76,"sandbox_requested_scopes":289,"license":233,"bundled":294,"maintainers":295},"1.1.0","8486d50d-a6bc-45c6-8627-60f3c144732c","^10.10.0","2024-03-18T19:00:48.993Z","50719a3e-f647-4061-b29e-e31a6bc7e3fe",17800,{"request":290,"log":293},{"urls":291,"methods":292},[250],[254],{},[],[296,297,298],10589,10590,10591,{"version":300,"package":139,"publisher":236,"type":141,"host_version":285,"publish_date":301,"verified":8,"id":302,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":268,"unpacked_size":303,"sandbox":76,"sandbox_requested_scopes":304,"license":233,"bundled":309,"maintainers":310},"1.2.0","2024-05-16T17:21:39.573Z","88a2e516-1fa2-40d3-b27d-649e24aff962",18185,{"request":305,"log":308},{"urls":306,"methods":307},[250],[254],{},[],[311,312,313],10867,10868,10869,{"version":315,"package":139,"publisher":284,"type":141,"host_version":143,"publish_date":316,"verified":8,"id":317,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":268,"unpacked_size":318,"sandbox":76,"sandbox_requested_scopes":319,"license":233,"bundled":325,"maintainers":326},"1.3.0","2024-11-05T14:45:32.956Z","b276a118-ee2d-428a-98dd-5ebc473623f0",82926,{"request":320,"log":323,"sleep":324},{"urls":321,"methods":322},[250,251,252],[254,255],{},{},[],[327,328,329],11549,11550,11551,{"version":331,"package":139,"publisher":284,"type":141,"host_version":143,"publish_date":332,"verified":8,"id":333,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":268,"unpacked_size":334,"sandbox":76,"sandbox_requested_scopes":335,"license":233,"bundled":341,"maintainers":342},"1.3.1","2024-11-18T17:03:42.240Z","b9534a05-19a0-4f19-912b-729086969eef",182240,{"request":336,"log":339,"sleep":340},{"urls":337,"methods":338},[250,251,252],[254,255],{},{},[],[343,344,345],11580,11581,11582,{"version":347,"package":139,"publisher":236,"type":141,"host_version":143,"publish_date":348,"verified":8,"id":349,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":245,"unpacked_size":350,"sandbox":76,"sandbox_requested_scopes":351,"license":233,"bundled":357,"maintainers":358},"1.4.2","2025-09-19T13:35:49.200Z","cc0eacb9-614c-48b5-9853-986f5cc25bd8",88822,{"request":352,"log":355,"sleep":356},{"urls":353,"methods":354},[250,251,252],[254,255],{},{},[],[359,360,361,362,363],13092,13093,13094,13095,13096,{"version":365,"package":139,"publisher":366,"type":141,"host_version":143,"publish_date":367,"verified":8,"id":368,"url_repository":78,"url_homepage":78,"url_bugs":78,"file_count":268,"unpacked_size":369,"sandbox":76,"sandbox_requested_scopes":370,"license":233,"bundled":376,"maintainers":377},"1.4.0","74ce2e77-733a-4e9a-b96d-93bf6264f622","2025-01-22T14:28:37.768Z","d1df7e14-ea60-429a-b2bd-3801720447d9",86353,{"request":371,"log":374,"sleep":375},{"urls":372,"methods":373},[250,251,252],[254,255],{},{},[],[378,379,380,381],11853,11854,11855,11856,"AI Writer Operation","\u003Ch1>AI Writer Operation\u003C\u002Fh1>\n\u003Cp>Generate text based on a written prompt within Directus Flows with this custom operation, powered by \u003Ca href=\"\">OpenAI's Text Generation API\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fwww.anthropic.com\u002F\">Anthropic\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Freplicate.com\u002Fmistralai\u002Fmistral-7b-v0.1\">MistralAi  (via Replicate)\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Freplicate.com\u002Fmeta\u002Fmeta-llama-3.1-405b-instruct\">Meta's LLama (via Replicate)\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdirectus-labs\u002Fextensions\u002Fmain\u002Fpackages\u002Fai-writer-operation\u002Fdocs\u002Foptions.png\" alt=\"The AI Writer operation, showing a masked OpenAI API Key field, model and prompt selection fields, and a multiline text input.\">\u003C\u002Fp>\n\u003Ch2>Configuration\u003C\u002Fh2>\n\u003Cp>This operation contains some configuration options - an Api-Key, a selection of which model and prompt to use, and a text input. The text input can contain references like \u003Ccode>{{$last.data}}\u003C\u002Fcode> to refer to data available in the current flow. The prompt can be customised further using the optional Messages repeater field. The operation returns a string of the transformed or generated text.\u003C\u002Fp>\n\u003Cp>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdirectus-labs\u002Fextensions\u002Fmain\u002Fpackages\u002Fai-writer-operation\u002Fdocs\u002Foutput.png\" alt=\"The output showing a string that has been grammatically fixed.\">\u003C\u002Fp>\n\u003Ch3>API-Keys\u003C\u002Fh3>\n\u003Cp>You can generate your API-Keys on the follosing sites:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Fplatform.openai.com\u002Fapi-keys\">OpenAI\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fworkspaces\u002Fdefault\u002Fkeys\">Anthropic\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Freplicate.com\u002Faccount\u002Fapi-tokens\">Replicate\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Custom Prompts\u003C\u002Fh2>\n\u003Cp>For a completely custom prompt using the \"Create custom prompt\" type, you will need to create a \u003Cstrong>system\u003C\u002Fstrong> message at the start of the message thread so that the Text Generation API knows how it should respond. Examples of initial system prompts can be found in the config objects of each built-in prompt in the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextension-ai-writer-operation\u002Ftree\u002Fproduction\u002Fsrc\u002Fprompts\">source code of this extension\u003C\u002Fa>. OpenAI also provides a solid overview of \u003Ca href=\"https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fprompt-engineering\">how to write good prompts\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2>Customising Responses (Advanced users)\u003C\u002Fh2>\n\u003Cp>The Messages repeater can be used to create or extend seed prompts to OpenAI's Text Generation API. The Messages repeater creates an array of messages that form a conversation thread. The Text Generation API will refer to the thread to determine how it should respond to further user prompts. The content in the Text field is used as the last user prompt sent to the Text Generation API before receiving the final response. This response is forwarded to the next operation in the flow as a string.\u003C\u002Fp>\n\u003Cp>Messages can be simulated as coming from one of three roles:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>System\u003C\u002Fstrong> — Modifies the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. An initial system message is already included for each prompt type. Using this option will add further system messages to the thread.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>User\u003C\u002Fstrong> — User provided requests or comments for the assistant to respond to\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Assistant\u003C\u002Fstrong> — Example responses generated by the Text Generation API to help provide hints on how the Generative Text API should respond.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Ftext-generation\u002Fchat-completions-api\">OpenAI's Documentation\u003C\u002Fa> explains further how the underlying API and models work. It may be helpful to read these to better understand the underlying process. The following quote from the documentation is important for understanding the Message Thread format and intent:\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Typically, a conversation is formatted with a system message first, followed by alternating user and assistant messages.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>Getting a desired output works best when following the format of creating a \u003Cstrong>system\u003C\u002Fstrong> message first followed by alternating between \u003Cstrong>user\u003C\u002Fstrong>, then \u003Cstrong>assistant\u003C\u002Fstrong> responses. Each of the preset prompt types available in the drop down field include a system message except for the \"Create Custom Prompt\" option which allows you a lot more flexibility.\u003C\u002Fp>\n\u003Ch3>Extending Built-in Prompts\u003C\u002Fh3>\n\u003Cp>You can add more messages to the conversation thread, before getting your final response, by adding them to the Messages repeater field. These are injected at the end of the built-in seed thread and before the final prompt is sent.\u003C\u002Fp>\n\u003Cp>This can be useful for:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Providing examples of the expected behaviour\u003C\u002Fli>\n\u003Cli>Injecting content from your Directus instance to show the type of tone used in your project\u003C\u002Fli>\n\u003Cli>Providing clarifying instructions - the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdirectus-labs\u002Fextension-ai-writer-operation\u002Ftree\u002Fproduction\u002Fsrc\u002Fprompts\u002Feditor.js\">Editor prompt\u003C\u002Fa> makes use of this as Chat GPT-3.5 can get confused when given a prompt to edit that looks like a new instruction\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Keep in mind that OpenAI pricing charges for both \u003Ca href=\"https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Ftext-generation\u002Fmanaging-tokens\">tokens\u003C\u002Fa> received \u003Cem>and\u003C\u002Fem> sent. Longer seed threads will result in higher usage costs.\u003C\u002Fp>\n","https:\u002F\u002Fraw.githubusercontent.com\u002Fdirectus-labs\u002Fextensions\u002Fmain\u002Fpackages\u002Fai-writer-operation\u002Fdocs\u002Foptions.png",[384,386],"https:\u002F\u002Fraw.githubusercontent.com\u002Fdirectus-labs\u002Fextensions\u002Fmain\u002Fpackages\u002Fai-writer-operation\u002Fdocs\u002Foutput.png",396,1840]