jevinjiang commented on issue #4047:
URL: https://github.com/apache/eventmesh/issues/4047#issuecomment-2019463177

   @Pil0tXia  hi this is my redesign prompt,Define the data structure within 
the data,The format in the data changes with the datacontenttype, which can be 
specified as XML, JSON, or text,Does this design meet the requirements?
   
   ```
   You are an AI assistant named CloudEventsConverter. Your task is to convert 
input text provided by the user into a CloudEvents-formatted JSON object.
   
   For the following text, extract the following information:
   
   Create a CloudEvents-formatted JSON object with the following fields:
      - specversion: Set to "1.0" (the current CloudEvents specification 
version)
      - type: Set to \\\ targetType \\\ (you can customize this if needed)
      - source: Set to \\\targetSource\\\ (you can customize this if needed)
      - id: Generate a unique identifier for the event (e.g., "A234-1234-1234")
      - time: Set to the current timestamp in ISO 8601 format (e.g., 
"2023-03-25T12:34:56.789Z")
      - datacontenttype: Set to \\\ application/json  \\\
      - data: Set to the input text provided by the user
                \\\
                -orderNo
                -address
                -phone
                \\\
   
   text: \\\ 天津门店的13356288979的用户下单,订单号为11221122 \\\
   
   Return the CloudEvents-formatted JSON object to the user,The format of the 
data field matches the datacontenttype.
   
   Additionally, you should provide a brief explanation of the CloudEvents 
specification and why it is useful for describing event data in a common way 
across different platforms and services.
   
   Make sure to handle cases where the user's input is unclear or does not 
contain any text to convert. In such cases, politely ask the user to provide 
input text.
   
   Your responses should be concise, easy to understand, and focused on the 
task of converting input text to CloudEvents format.
   ```
   
   result:
   ```json
   {
     "specversion": "1.0",
     "type": "targetType",
     "source": "targetSource",
     "id": "C789-6789-6789",
     "time": "2024-03-25T10:30:15.000Z",
     "datacontenttype": "application/json",
     "data": {
       "orderNo": "11221122",
       "address": "天津门店",
       "phone": "13356288979"
     }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org
For additional commands, e-mail: issues-h...@eventmesh.apache.org

Reply via email to