-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ai features example #297
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
apps/web/app/api/generate/route.ts
Outdated
}, | ||
{ | ||
role: "user", | ||
content: prompt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, you are right the prompt content is not good enought, I'll add an issue for this after this PR is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank @andrewdoro
@andrewdoro How can I help with the |
@trevorpfiz Still missing right now is the docs for adding the AI stuff. |
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
@SocketSecurity ignore npm/[email protected] |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | [`20.11.24` -> `20.11.25`](https://renovatebot.com/diffs/npm/@types%2fnode/20.11.24/20.11.25) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/20.11.25?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fnode/20.11.25?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fnode/20.11.24/20.11.25?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/20.11.24/20.11.25?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@types/react](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react)) | [`18.2.61` -> `18.2.64`](https://renovatebot.com/diffs/npm/@types%2freact/18.2.61/18.2.64) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2freact/18.2.64?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2freact/18.2.64?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2freact/18.2.61/18.2.64?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2freact/18.2.61/18.2.64?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@types/react-dom](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom)) | [`18.2.19` -> `18.2.21`](https://renovatebot.com/diffs/npm/@types%2freact-dom/18.2.19/18.2.21) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2freact-dom/18.2.21?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2freact-dom/18.2.21?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2freact-dom/18.2.19/18.2.21?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2freact-dom/18.2.19/18.2.21?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [ai](https://sdk.vercel.ai/docs) ([source](https://togithub.com/vercel/ai)) | [`3.0.4` -> `3.0.8`](https://renovatebot.com/diffs/npm/ai/3.0.4/3.0.8) | [![age](https://developer.mend.io/api/mc/badges/age/npm/ai/3.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/ai/3.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/ai/3.0.4/3.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/ai/3.0.4/3.0.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [dotenv-cli](https://togithub.com/entropitor/dotenv-cli) | [`7.3.0` -> `7.4.1`](https://renovatebot.com/diffs/npm/dotenv-cli/7.3.0/7.4.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/dotenv-cli/7.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/dotenv-cli/7.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/dotenv-cli/7.3.0/7.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/dotenv-cli/7.3.0/7.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [eslint-config-next](https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config) ([source](https://togithub.com/vercel/next.js/tree/HEAD/packages/eslint-config-next)) | [`14.1.1` -> `14.1.3`](https://renovatebot.com/diffs/npm/eslint-config-next/14.1.1/14.1.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-config-next/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint-config-next/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint-config-next/14.1.1/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-config-next/14.1.1/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [next](https://nextjs.org) ([source](https://togithub.com/vercel/next.js)) | [`14.1.1` -> `14.1.3`](https://renovatebot.com/diffs/npm/next/14.1.1/14.1.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/next/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/next/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/next/14.1.1/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/next/14.1.1/14.1.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [novel](https://novel.sh) ([source](https://togithub.com/steven-tey/novel)) | [`0.2.7` -> `0.2.11`](https://renovatebot.com/diffs/npm/novel/0.2.7/0.2.11) | [![age](https://developer.mend.io/api/mc/badges/age/npm/novel/0.2.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/novel/0.2.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/novel/0.2.7/0.2.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/novel/0.2.7/0.2.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [typescript](https://www.typescriptlang.org/) ([source](https://togithub.com/Microsoft/TypeScript)) | [`5.3.3` -> `5.4.2`](https://renovatebot.com/diffs/npm/typescript/5.3.3/5.4.2) | [![age](https://developer.mend.io/api/mc/badges/age/npm/typescript/5.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/typescript/5.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/typescript/5.3.3/5.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/typescript/5.3.3/5.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vercel/ai (ai)</summary> ### [`v3.0.8`](https://togithub.com/vercel/ai/releases/tag/ai%403.0.8) [Compare Source](https://togithub.com/vercel/ai/compare/[email protected]@3.0.8) ##### Patch Changes - [`a94aab2`](https://togithub.com/vercel/ai/commit/a94aab2): ai/rsc: optimize streamable value stream size ### [`v3.0.7`](https://togithub.com/vercel/ai/releases/tag/ai%403.0.7) [Compare Source](https://togithub.com/vercel/ai/compare/[email protected]@3.0.7) ##### Patch Changes - [`9a9ae73`](https://togithub.com/vercel/ai/commit/9a9ae73): feat(ai/rsc): readStreamableValue ### [`v3.0.6`](https://togithub.com/vercel/ai/releases/tag/ai%403.0.6) [Compare Source](https://togithub.com/vercel/ai/compare/[email protected]@3.0.6) ##### Patch Changes - [`1355ad0`](https://togithub.com/vercel/ai/commit/1355ad0): Fix: experimental_onToolCall is called with parsed tool args - [`9348f06`](https://togithub.com/vercel/ai/commit/9348f06): ai/rsc: improve dev error and warnings by trying to detect hanging streams - [`8be9404`](https://togithub.com/vercel/ai/commit/8be9404): fix type resolution ### [`v3.0.5`](https://togithub.com/vercel/ai/releases/tag/ai%403.0.5) [Compare Source](https://togithub.com/vercel/ai/compare/[email protected]@3.0.5) ##### Patch Changes - [`a973f1e`](https://togithub.com/vercel/ai/commit/a973f1e): Support Anthropic SDK v0.15.0 - [`e25f3ca`](https://togithub.com/vercel/ai/commit/e25f3ca): type improvements </details> <details> <summary>entropitor/dotenv-cli (dotenv-cli)</summary> ### [`v7.4.1`](https://togithub.com/entropitor/dotenv-cli/compare/v7.4.0...ed62fc71afc952181913aa275d7a002a5178b2d6) [Compare Source](https://togithub.com/entropitor/dotenv-cli/compare/v7.4.0...v7.4.1) ### [`v7.4.0`](https://togithub.com/entropitor/dotenv-cli/releases/tag/v7.4.0): Release better variable usage (`-v`) [Compare Source](https://togithub.com/entropitor/dotenv-cli/compare/v7.3.0...v7.4.0) Releases [https:/entropitor/dotenv-cli/pull/105](https://togithub.com/entropitor/dotenv-cli/pull/105) </details> <details> <summary>vercel/next.js (eslint-config-next)</summary> ### [`v14.1.3`](https://togithub.com/vercel/next.js/compare/v14.1.2...fc38ee190c9b7de09ebff13a17ebd948cf580ec3) [Compare Source](https://togithub.com/vercel/next.js/compare/v14.1.2...v14.1.3) ### [`v14.1.2`](https://togithub.com/vercel/next.js/compare/v14.1.1...f564deef86be32a6b25125ddb8172c7c27d3f19a) [Compare Source](https://togithub.com/vercel/next.js/compare/v14.1.1...v14.1.2) </details> <details> <summary>vercel/next.js (next)</summary> ### [`v14.1.3`](https://togithub.com/vercel/next.js/compare/v14.1.2...fc38ee190c9b7de09ebff13a17ebd948cf580ec3) [Compare Source](https://togithub.com/vercel/next.js/compare/v14.1.2...v14.1.3) ### [`v14.1.2`](https://togithub.com/vercel/next.js/compare/v14.1.1...f564deef86be32a6b25125ddb8172c7c27d3f19a) [Compare Source](https://togithub.com/vercel/next.js/compare/v14.1.1...v14.1.2) </details> <details> <summary>steven-tey/novel (novel)</summary> ### [`v0.2.11`](https://togithub.com/steven-tey/novel/releases/tag/novel%400.2.11) [Compare Source](https://togithub.com/steven-tey/novel/compare/[email protected]@0.2.11) **Full Changelog**: https:/steven-tey/novel/compare/[email protected]@0.2.11 #### What's Changed - feat: add ai features example by [@​andrewdoro](https://togithub.com/andrewdoro) in [https:/steven-tey/novel/pull/297](https://togithub.com/steven-tey/novel/pull/297) - Novel now exports a couple of utilities for dealing with AI cases: ```tsx //this extension is used for highlighting text for the AI import { AIHighlight } from "novel/extensions"; //call this function when entering in AI mode to highlight current selection import { addAIHighlight } from "novel/extensions"; //call this function when AI mode is no longer used import { removeAIHighlight } from "novel/extensions"; //this function returns the current selection in Markdown import { getPrevText } from "novel/extensions"; ``` ##### Implementation You can see an example implementation https:/steven-tey/novel/tree/main/apps/web/components/tailwind/generative **Full Changelog**: https:/steven-tey/novel/compare/[email protected]@0.2.11 ### [`v0.2.10`](https://togithub.com/steven-tey/novel/releases/tag/novel%400.2.10) [Compare Source](https://togithub.com/steven-tey/novel/compare/[email protected]@0.2.10) - Fixes missing types. **Full Changelog**: https:/steven-tey/novel/compare/[email protected]@0.2.10 ### [`v0.2.9`](https://togithub.com/steven-tey/novel/releases/tag/novel%400.2.9) [Compare Source](https://togithub.com/steven-tey/novel/compare/[email protected]@0.2.9) **## Update to 0.2.10, this version is missing type definitions** #### Breaking Changes **`defaultEditorProps` was removed from the library** It was broken into multiple functions that have to be passed in the `editorProps`. - `handleImageDrop`, `handleImagePaste` require a custom uploadFn for uploading images (See guide [here](https://novel.sh/docs/guides/image-upload)) ```tsx import { handleImageDrop, handleImagePaste } from "novel/plugins"; import { handleCommandNavigation } from "novel/extensions"; <EditorContent editorProps={{ handleDOMEvents: { keydown: (_view, event) => handleCommandNavigation(event), }, handlePaste: (view, event) => handleImagePaste(view, event, uploadFn), handleDrop: (view, event, _slice, moved) => handleImageDrop(view, event, moved, uploadFn), }} ``` #### What's Changed - Show grabbing cursor when grabbing drag handle by [@​haydenbleasel](https://togithub.com/haydenbleasel) in [https:/steven-tey/novel/pull/334](https://togithub.com/steven-tey/novel/pull/334) - feat: add custom upload config by [@​andrewdoro](https://togithub.com/andrewdoro) in [https:/steven-tey/novel/pull/335](https://togithub.com/steven-tey/novel/pull/335) **Full Changelog**: https:/steven-tey/novel/compare/[email protected]@0.2.9 ### [`v0.2.8`](https://togithub.com/steven-tey/novel/releases/tag/novel%400.2.8) [Compare Source](https://togithub.com/steven-tey/novel/compare/[email protected]@0.2.8) #### What's Changed - fix: rename updated image type by [@​bouceka](https://togithub.com/bouceka) in [https:/steven-tey/novel/pull/315](https://togithub.com/steven-tey/novel/pull/315) - feat: clear nodes on node selector by [@​brunocroh](https://togithub.com/brunocroh) in [https:/steven-tey/novel/pull/322](https://togithub.com/steven-tey/novel/pull/322) - Miscellaneous fixes by [@​haydenbleasel](https://togithub.com/haydenbleasel) in [https:/steven-tey/novel/pull/321](https://togithub.com/steven-tey/novel/pull/321) - fix: remove drag-handle on drop by [@​brunocroh](https://togithub.com/brunocroh) in [https:/steven-tey/novel/pull/323](https://togithub.com/steven-tey/novel/pull/323) - fix: dont trigger slash-command on codeBlock nodes by [@​brunocroh](https://togithub.com/brunocroh) in [https:/steven-tey/novel/pull/326](https://togithub.com/steven-tey/novel/pull/326) #### New Contributors - [@​bouceka](https://togithub.com/bouceka) made their first contribution in [https:/steven-tey/novel/pull/315](https://togithub.com/steven-tey/novel/pull/315) - [@​haydenbleasel](https://togithub.com/haydenbleasel) made their first contribution in [https:/steven-tey/novel/pull/321](https://togithub.com/steven-tey/novel/pull/321) **Full Changelog**: https:/steven-tey/novel/compare/[email protected]@0.2.8 </details> <details> <summary>Microsoft/TypeScript (typescript)</summary> ### [`v5.4.2`](https://togithub.com/microsoft/TypeScript/releases/tag/v5.4.2): TypeScript 5.4 [Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v5.3.3...v5.4.2) For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/). For the complete list of fixed issues, check out the - [fixed issues query for Typescript 5.4.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+5.4.0%22+is%3Aclosed+). - [fixed issues query for Typescript 5.4.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+5.4.1%22+is%3Aclosed+). - [fixed issues query for Typescript 5.4.2 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+5.4.2%22+is%3Aclosed+). Downloads are available on: - [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Chicago, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/autoblocksai/autoblocks-examples). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMzAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIzMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR adds docs example for the AI features,
I am still not sure if this should be a copy paste code or part of the plugins system.
One thing that is not yet complete, is the required prompt text for running commands. It would be really helpful if someone with more prompt experience can help there 🥹
Things left:
Add direct streaming examplecloses #291