Neos Studio
Configure agents and features
To configure agents and AI functionality of Neos Studio you need to configure this dotnet user secrets :
API end point
dotnet user-secrets set "AI:AzureOpenAI:ApiEndpoint" "[Your API endpoint]" --id "GroupeIsa.Neos.Designer.AspNetCore"
API Key
dotnet user-secrets set "AI:AzureOpenAI:ApiKey" "[Your API key]" --id "GroupeIsa.Neos.Designer.AspNetCore"
Choose an agent for the smart search
dotnet user-secrets set "AI:SmartSearchModel" "AzureGpt54" --id "GroupeIsa.Neos.Designer.AspNetCore"
Choose an agent for the smart localizable string translation
dotnet user-secrets set "AI:SmartLocalizableStringModel" "AzureGpt54" --id "GroupeIsa.Neos.Designer.AspNetCore"
Choose an agent for auto-suggest
dotnet user-secrets set "AI:AutoSuggestModel" "AzureGpt54" --id "GroupeIsa.Neos.Designer.AspNetCore"
Database of embeddings
dotnet user-secrets set "AI:MemoryDb:ConnectionString" "The connection string" --id GroupeIsa.Neos.Designer.AspNetCore
Chatbot Agents
Neos Studio provides a set of agents to help you to create entities, search for documentation, create templates and more.
Entity creation
This agent is used to create a new entity and persist it in the database.
For example to create a new entity of type Product with the name Product in the Core module, you can ask the assistant to create a new entity with the following sentence:
Created an entity named Product in the 'Core' module.
The properties of this entity are:
- Id (Auto increment type key)
- Name (string)
- QuantityInStock(Integer)
Entity proposal
This agent is used to propose a new entity to the user. It works like the entity creation agent but it does not persist the entity in the database and open the entity editor to let the user modify the entity before persisting it.
Documentation Neos
This agent is used to search for documentation about Neos. You can ask the assistant to search for documentation about a specific topic.
For example, you can ask the assistant how to access to the authenticated user in a server method :
How to access to the user in a server method?
Chatbot answer :
To access the user in a server method in the Neos Framework, you need to inject theIUserInfoAccessorinterface into your server method class. Here’s an example of how to do this:/// <summary> /// Represents the implementation of the <see cref="IMyServerMethod"/> interface. /// </summary> public class MyServerMethod : IMyServerMethod { private readonly IUserInfoAccessor _userInfoAccessor; /// <summary> /// Initializes a new instance of the <see cref="MyServerMethod"/> class. /// </summary> /// <param name="userInfoAccessor">User info accessor.</param> public MyServerMethod(IUserInfoAccessor userInfoAccessor) { _userInfoAccessor = userInfoAccessor; } /// <inheritdoc/> public void Execute() { IUserInfo? user = _userInfoAccessor.User; // You can now use the user information as needed } }In this example, the
IUserInfoAccessoris injected into the constructor of your server method class, allowing you to access the current user information within theExecutemethod. For more details, you can refer to the official documentation here.
From 2.2 version, the assistant can also provide answer from the neos community forum.
How to create a entity global filter with a condition on the permission of the current user?
Chatbot answer : To create a global filter for an entity in the Neos Framework that includes a condition based on the permissions of the current user, you can follow these steps:
- Check Permissions: You cannot directly check permissions in a global filter. Instead, you need to handle this in the entity view side. You can use the
IFunctionAuthorizerservice to determine if the current user has the required permissions.- Append Filter: In the retrieving rule of your entity view, you can append a filter to the query based on the permission check. Here’s an example of how you might implement this:
if (!(await _functionAuthorizer.IsAllowedAsync("FunctionName"))) { args.AppendFilter(...); // Add your filter condition here }
- Future Enhancements: There are discussions about potentially allowing permission checks directly in global filters in future versions of Neos, which would simplify this process. For more detailed information, you can refer to the community discussions on this topic here.
Explore and search
The assistant can help you to explore and search in the cluster. You can ask the assistant to search for a specific entity, for code.
For example :
- you can ask the assistant to get the number of UI views in the cluster :
How many UI views are there?
- you can ask the assistant to find references to a specific code :
What are the references to the text 'DeferredFileReference' in the code?
AI Features
Image creator
The assistant can create a svg image for you. You can ask the assistant to create an image from a prompt in the Image entry.
For example :
- you can create a icon with the following prompt :
Create a icon-like image representing a magnifying glass
- you can create a animated svg image with the following prompt :
Create an animated svg image with a circle that moves from left to right.
Create an animated image with 3 small blue balls aligned horizontally with a cyclic animation.
You can then add the image by accepting the generated image.