Hello,
I want to pass array object eg:
"messages": [ { "role": "user", "content": "Hello, how are you?" }],
this in message field . I have done this with the help of javascript and deserialzied the json in messagelist datatype still unable to achieve the desired output . Can anyone help me with this?
Thankyou!!!
Hi Niharika,
First, create the structure for the following JSON:
{
"messages": [
"role": "user",
"content": "Hello, how are you?"
}
]
Structure -
You can create the structure using the JSON provided above. Right-click on the structure, and you'll find an option to "Add Structure from JSON." Select this to generate the structure.
After creating the structure, treat the "messages" as an array object. Then, assign the appropriate structure values in the request message.
I already have a structure
Could you please share your OML so that I can review and update it?
Thank You,
Vipin Yadav
Hello @Niharika Tiwari,It appears that your API account currently has no balance.
I have made adjustments to the example to complete the logic for sending a message and receiving a response. Please ensure that you use an API account token with sufficient balance to see the example in action.
Note: JavaScript should not be used for this type of logic as it exposes data on the client side and can be maliciously manipulated. The technique demonstrated here should be the chosen method for implementation. To ensure even greater security, API actions should not be called from the client side. Instead, a server-side action should be implemented to handle this. This way, we can guarantee that our logic is protected and not exposed to manipulation.
The issue is resolved thankyou so much for the solution.
This is the example i have tried in my app .
I cannot share the actual app oml sorry for that.