Developer forum

Forum » Dynamicweb 10 » AI Text Generation

AI Text Generation

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

I trying to play arounf with the AI text generation. I have set up an API key for OpenIA and a prompt. 

When I try to run the prompt I get an error saying:

One or more errors occurred. (Value cannot be null. (Parameter 'DeploymentName'))

What could I be missing?

Regards / Aki

Stack Trace:

System.AggregateException: One or more errors occurred. (Value cannot be null. (Parameter 'DeploymentName'))
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Dynamicweb.Application.UI.Commands.AI.TextGeneratorCommand.Handle()
   at Dynamicweb.Management.Api.Controllers.Api.DataController.GetCommandResult(Type commandType, Type queryType, String body)
   at Dynamicweb.Management.Api.Controllers.Api.DataController.Post(String command, Object body)
   at lambda_method279(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Seems like we are missing some validation of one of the fields when setting up the service:

You need to add the name of the AI model - e.g. 

  • gpt-35-turbo
  • gpt-4o

See the list here: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models

 
Aki Ruuskanen
Aki Ruuskanen
Reply

OK, I was setting up the "OpenAI Text Generator" and not the "Azure OpenAI Text Generator". That one does not have "Deployment name". 

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Some kind of documentation would be appriciated. At leas I could not find any. 

Can the "Open AI Text Generator" be used? 

It possible to create multiple "Generator configurations". But when creating a promt you cannot choose which generator to use. How does that work?

Regards / Aki

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Aki

I can see that - and the code is very ugly as it do .FirstOrDefault on the generators. So if you have an empty Azure generator configuration, that will be chosen first... So delete all Generators except the one you need. The DeploymentName parameter is part of the Azure version of the generators.

I'll figure out what we will do about the issue.

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

My first attempt was to create a "OpenAI Text Generator". Not the Azure one, because it was easy to get a API-key. But then I got the "Missing Deployment Name" error even though the "OpenAI..." does not have that configuraiont-field. Is that an error or a missing configuration field. 

/Aki

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

As I see it, it gets an instance of the Azure AI generator settings and tries to create an instance of the AzureOpenAIGenerator

How does this list look like in your end?

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Looks like this at the moment. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Nicolai, do you think this issue with the OpenAI generator will be resolved. It wold be nice to have it working in a demo I'm holding in a couple of weeks. 

Regards / Aki

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Aki

Yes, it will be fixed. It has been bugged.

I think we must have missed something when we changed to using Azure AI instead. You can setup the generation using Azure - it is the one we use.

The reasoning for using Azure version is related to data security rules in EU and the use of Open AI which do not guarentee data stays in EU.

BR Nicolai

 

You must be logged in to post in the forum