-
Notifications
You must be signed in to change notification settings - Fork 4
feat: AI Chat #346
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: AI Chat #346
Conversation
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
…o the built in handler
|
Check out the recent updates to your Headless Platform preview environment:
Learn more about preview environments in our documentation. |
Fran-A-Dev
left a comment
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.
LGTM
kellenmace
left a comment
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.
Looks great, overall! Nice job, Alex! Left just a few comments
| - You can use the 'smartSearchTool' to find information relating to Faust. | ||
| - WP Engine Smart Search is a powerful tool for finding information about Faust. | ||
| - After the 'smartSearchTool' provides results (even if it's an error or no information found) | ||
| - You MUST then formulate a conversational response to the user based on those results but also use the tool if the users query is deemed plausible. |
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.
This line seems like it should be combined with the one before it. And "users query" should be "user's query". Not that that matters too much- I'm sure the LLM would understand it just fine either way :)
| `; | ||
|
|
||
| const systemPromptContent = ` | ||
| - You are a friendly and helpful AI assistant that provides Developers help with their coding tasks and learning, as relevant to Faust.js, WPGraphQL, and headless WordPress. |
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.
"Developers" -> "developers"
|
|
||
| const systemPromptContent = ` | ||
| - You are a friendly and helpful AI assistant that provides Developers help with their coding tasks and learning, as relevant to Faust.js, WPGraphQL, and headless WordPress. | ||
| - Format your responses using Github Flavored Markdown. |
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.
"Github Flavored Markdown" -> "GitHub-flavored Markdown"
(notice the capital "H" in GitHub)
| - Make sure to format links as [link text](path). | ||
| - Make sure to link out to the source of the information you provide. | ||
| - Prefer new information over old information. | ||
| - Do not invent information. Stick to the data provided by the tool. |
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.
Instructions: don't hallucinate ever. k thanks, bye! :D
| }, | ||
| onStepFinish: async (result) => { | ||
| if (result.usage) { | ||
| console.log( |
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.
Should this be removed before going to prod? Otherwise, if you want it to be a "permanent" console.log statement- what I like to do in my apps is use console.info(). So then you can search the codebase for "console.info" to find the "permanent" log statements and "console.log" to find the temporary ones left over from debugging. So you could use that convention, if you like.
| status, | ||
| } = useChat(); | ||
|
|
||
| useEffect(() => { |
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.
Using useEffect to initialize data like this after the component has already rendered once isn't ideal. I think useChat provides an initialMessages prop we can use instead, like this:
const {
messages,
input,
handleInputChange,
handleSubmit,
setMessages,
status } = useChat({
initialMessages: [
{
role: "assistant",
content: "Hey there! I'm an AI driven chat assistant here to help you with Faust.js! I'm trained on the documentation and can help you with coding tasks, learning, and more. What can I assist you with today?",
id: "welcome-intro",
},
],
});
| Google Sans, | ||
| Helvetica Neue, | ||
| sans-serif; | ||
| /* Choose a font that matches, Arial is a common sans-serif */ |
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.
These code comments could be removed
Description
Adds a chat feature that integrates with Google Vertex AI to provide answers to questions on Faust and how to solve problems.
Todo
Notes
Closes #338
Includes code from #339 will resolve one that's merged