【发布时间】:2021-05-01 10:14:43
【问题描述】:
我在 python 网络聊天机器人 (BotFrameWork) 中使用自适应卡片 JSON 时遇到问题,我想知道如何自定义 JSON 元素中的值,这些值是动态的。我解释了更多我必须在一张卡片中列出书籍信息,但标题、作者等......每次都会改变。那么我如何动态填充值呢? 那是我的 json 文件
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "RISULTATI",
"horizontalAlignment": "center",
"spacing": "None",
"size": "Large",
"color": "Attention",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"separator": true,
"spacing": "Medium",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Nome Libro e autore",
"isSubtle": true,
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "Prezzo",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "Disponibilità",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "Link",
"spacing": "Small",
"wrap": true
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": "Genere",
"horizontalAlignment": "Right",
"isSubtle": true,
"weight": "Bolder",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"spacing": "Medium",
"separator": true,
"columns": [
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "Prezzo",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "Disponibilità",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "Link",
"spacing": "Small",
"wrap": true
}
]
}
]
}
]
}
我必须在项目中填写文本值,我应该怎么做?
【问题讨论】:
标签: python json azure botframework