Thanks for that idea. Actually I try to figure out Power Automate as a middleware, but AZURE itself would be next choice.
Original Message:
Sent: 11-29-2023 00:37
From: Max Gill
Subject: Data Actions: read Information from response header / AZURE AI Language
You could always create an Azure Function between the AI service and Genesys. Genesys would call the Azure Function, which would then call the sync AI service and wait for the response before communicating it back to Genesys
------------------------------
Maksim Gill
Eccentex (Advanced Case and Email Management Platform for Genesys)
https://www.eccentex.com/genesys
Original Message:
Sent: 11-28-2023 02:14
From: Christoph Domaschke
Subject: Data Actions: read Information from response header / AZURE AI Language
Hello Maksim,
thanks for your detailed response. I was not aware of the synchronous possibilities of that API. Unfortunately my use cases involves "custom text classification" that seems to be only aviable asynchronous. But I will keep your response in mind for later usage of Language AI / openAI.
Best regards
Christoph
------------------------------
Christoph Domaschke
CRONBANK AG
Original Message:
Sent: 11-27-2023 13:40
From: Max Gill
Subject: Data Actions: read Information from response header / AZURE AI Language
Azure AI - Language
We standardize many of our AI services on Azure and we are very happy. Depending on the Azure AI Language task, some are synchronous responses (like Language Detection or Sentiment Analysis), while others are async with a JobID (like text summarization).
The "EntityRecognition", "KeyPhraseExtraction", and "PiiEntityRecognition" tasks can either be called sync or async. Azure supports the async model if you want to complete analysis on multiple text blocks.
For example, this API returns a result immediately:
POST {Endpoint}/language/:analyze-text?api-version=2023-04-01
https://learn.microsoft.com/en-us/rest/api/language/text-analysis-runtime/analyze-text?view=rest-language-2023-04-01&tabs=HTTP
While this API returns a JobID:
POST {Endpoint}/language/analyze-text/jobs?api-version=2023-04-01
https://learn.microsoft.com/en-us/rest/api/language/text-analysis-runtime/submit-job?view=rest-language-2023-04-01&tabs=HTTP#keyphraselrotask
I see that you are using the async version. Try switching to something like:
endpointUri = cogSvcEndpoint + "language/:analyze-text?api-version=2022-05-01"; //use the latest API, this is just from an older code block I quickly found//create JSON payloadjsonBody = new JObject( new JProperty("kind", "EntityRecognition"), new JProperty("parameters", new JObject( new JProperty("modelVersion", "latest") )), new JProperty("analysisInput", new JObject( new JProperty("documents", new JArray( new JObject( new JProperty("id", 1), new JProperty("language", "EN"), new JProperty("text", "Cats like to break iPhones, vases, cups and London magnet.") ) ) ) ) ));
The results of that API call would look something like this:
{ "kind": "EntityRecognitionResults", "results": { "documents": [ { "id": "1", "entities": [ { "text": "iPhones", "category": "Product", "offset": 19, "length": 7, "confidenceScore": 0.99 }, { "text": "vases", "category": "Product", "offset": 28, "length": 5, "confidenceScore": 0.99 }, { "text": "cups", "category": "Product", "offset": 35, "length": 4, "confidenceScore": 0.99 }, { "text": "London", "category": "Location", "subcategory": "City", "offset": 44, "length": 6, "confidenceScore": 0.87 }, { "text": "magnets", "category": "Product", "offset": 51, "length": 7, "confidenceScore": 0.54 } ], "warnings": [] } ], "errors": [], "modelVersion": "2023-09-01" }}
I created a little Azure AI Language tester in our product, so you can see Azure has some pretty powerful capabilities:
![](https://higherlogicdownload.s3.amazonaws.com/GENESYS/MessageImages/1478c6b96ad442599470e53b79cb06c2.png)
Azure OpenAI
I do want to add that most of our AI development has been shifting to Azure OpenAI whereby we'll ask it to extract the key information we want. It works better when customers misspell text or have confusing sentence structures. The downside is that you have to do prompt engineering to have it respond in a consistent JSON, it can take a few seconds, and there is no volume pricing. Plus it's not available in every Azure region.
Objectively, Azure OpenAI provides better results on all text analysis tasks if you have a solid prompt. And translations are more contextually correct than standard translations.
We provide both options to our customers because each have their pluses and minuses. Plus we have some self-trained ones for specialized use-cases.
Here is an example:
Using Azure AI - Language (example):
![](https://higherlogicdownload.s3.amazonaws.com/GENESYS/MessageImages/764c47cd35c647fe898c40f3a71f73ad.png)
Using Azure OpenAI (example):
![](https://higherlogicdownload.s3.amazonaws.com/GENESYS/MessageImages/17dc5a4861dc4684a09e11cff3172dcb.png)
------------------------------
Maksim Gill
Eccentex (Advanced Case and Email Management Platform for Genesys)
https://www.eccentex.com/genesys
Original Message:
Sent: 11-24-2023 02:11
From: Christoph Domaschke
Subject: Data Actions: read Information from response header / AZURE AI Language
Hi Anton,
thanks for your funded opinion. I will commission a programmer with that middleware. Thanks for your hint about DataAction timeouts. Robert suggested to use the participant-data-API to deliver the result will do the trick.
I tried my luck in the developer forum without a response.
Thanks for you help and your time!
Best regards
Christoph
------------------------------
Christoph Domaschke
CRONBANK AG
Original Message:
Sent: 11-23-2023 15:05
From: Anton Vroon
Subject: Data Actions: read Information from response header / AZURE AI Language
Hi Christoph,
This makes sense, categorizing emails in Genesys natively is pretty simple with just doing contain expressions so can see why you want to go down this path.
With DataActions, you can apply variables as inputs to header items, but I don't think you can assign the response header items to variables which is what you are after. You would yes instead need some middleware or lambda for example which you would create a DataAction call to, that would send the API request, grab the header info, then send the API request to get the result, then return that to the DataAction results.
Only issue there might be the time it takes so be careful with the DataAction timeout settings.
If you haven't already provided the above details to your post on the Developer Forum I would suggest you do so in case some one there knows of any extra tricks.
------------------------------
Anton Vroon
Original Message:
Sent: 11-23-2023 02:34
From: Christoph Domaschke
Subject: Data Actions: read Information from response header / AZURE AI Language
Thanks für joning this discussion,
I will explain the details:
- I want to use AZURE AI Language, "Custom text classification" to classify my emails to different categories.
- I want to send the e-mail-text via an API call.
- As explained I need to find a way to get that information from the header. Data Actions by Genesys Cloud do not seem to have the possibility to access data from the response header.
I really apreciate, that you and Robert are spending your time on my problem. Thanks!
Best regards,
Christoph
------------------------------
Christoph Domaschke
CRONBANK AG
Original Message:
Sent: 11-22-2023 15:22
From: Anton Vroon
Subject: Data Actions: read Information from response header / AZURE AI Language
I think to help out further than what Robert has already suggested, we really need to know a bit more information.
Like what are your trying to do here, what is the context, there might be a way to natively do what you are after in Genesys without the need for custom integration.
What is the API call you are making, and it might be more of a question for MS if there response you are getting isn't right. Certainly the documentation for Azure Text Analysis returns results in standard JSON format, so it seems very odd that you are getting the response in a header.
------------------------------
Anton Vroon
Original Message:
Sent: 11-22-2023 02:03
From: Christoph Domaschke
Subject: Data Actions: read Information from response header / AZURE AI Language
Hello Robert,
I am really excited to get an answer to my topic, but actually I am completly lost. What is the connection between an SMS and my AZURE-AI-Language-API-Call?
Best regards
Christoph
------------------------------
Christoph Domaschke
CRONBANK AG
Original Message:
Sent: 11-21-2023 23:59
From: Robert Wakefield-Carl
Subject: Data Actions: read Information from response header / AZURE AI Language
After you create the SMS with the agentless API, you can take that Conversation ID and use a Patch to update the attributes on the conversation using https://developer.genesys.cloud/devapps/api-explorer-standalone#patch-api-v2-conversations-messages--conversationId--participants--participantId--attributes, then you can use the conversation details API when the SMS comes back to read those attributes. The only problem may be if the reply comes after 72 hours, you may not have the session still open, so you many need to use a query to find the last SMS to that number and get that conversation ID to read from. A bit of work, but I think it is doable. @Anton Vroon, what do you think - any other idea?
------------------------------
Robert Wakefield-Carl
ttec Digital
Sr. Director - Innovation Architects
Robert.WC@ttecdigital.com
https://www.ttecDigital.com
https://RobertWC.Blogspot.com
Original Message:
Sent: 11-10-2023 02:32
From: Christoph Domaschke
Subject: Data Actions: read Information from response header / AZURE AI Language
Hello community,
I try to integrate AZURE AI Language services, custom text classification. Problem is: I am able to send the request with a data action, via API but the response is empty. The information I need is in the header (location of the job I started). How do I access informations in the header?
Is there a way like $.headers.attributename ? In developer Forum there was no single answer to that question. Maybe you can help?
Best regards
Christoph
#ArchitectureandDesign
#Integrations
#Unsure/Other
------------------------------
Christoph Domaschke
CRONBANK AG
------------------------------