Blueprint Section - Get Started
Get Started
Below, let's take OpenAI as an example to introduce the basic usage of blueprints.
Text chat
Using OpenAI for text chatting.
Create a node in the blueprint by right-clicking, named Send OpenAI Chat Request In World
.
Create an Options node, and set Stream=true, Api Key="your API key from OpenAI"
.
Create Messages, add a System Message and a User Message respectively.
Create a Delegate to receive the output information from the model and print it on the screen.
The complete blueprint looks like this, run the blueprint, and you will see the game screen displaying the message returned by printing the large model.
Generate image from text.
Create an image using OpenAI.
In the blueprint, right-click to create a node named "Send OpenAI Image Request", and set "In Prompt" to "a beautiful butterfly".
Create an Options node, and set Api Key="your API key from OpenAI"
.
Bind the "On Images" event and save the images to the local hard drive.
The complete blueprint looks like this, run the blueprint, and you will see the image saved in the specified location.
Generate text from image.
Use OpenAI Vision to analyze images.
Create a node called Send OpenAI Image Request
by right-clicking on the blueprint.
Create an Options node and set Api Key="your API key from OpenAI"
, then set the model to gpt-4o-mini
.
Create Messages. Create a node "Import File as Texture 2D" first, and read an image from the file system. Convert the image into a format that the plugin can utilize through the node "Create AIChatPlus Texture From Texture2D". Connect the image to the "Images" field of the "AIChatPlus_ChatRequestMessage" node using the "Make Array" node. Set the "Content" field content to "describe this image".
As shown in the figure:
The complete blueprint looks like this, run the blueprint, and you will see the results displayed on the screen.
Original: https://wiki.disenone.site/en
This post is protected by CC BY-NC-SA 4.0 agreement, should be reproduced with attribution.
Visitors. Total Visits. Page Visits.
This post was translated using ChatGPT, please provide feedback in FeedbackPoint out any omissions.