gpt4 book ai didi

c# - 表单流枚举提示错误

转载 作者:太空宇宙 更新时间:2023-11-03 23:02:13 24 4
gpt4 key购买 nike

当我使用 FormFlow 时,我有一个字段:

public enum Categories
{
[Describe("Inquiry / Help")]
InquiryHelp = 1,
[Describe("Audio / Video & TV")]
AVandTV,
[Describe("Consulting & Data Analysis")]
Consulting,
[Describe("Email / Calendar & Collaboration")]
Email,
[Describe("IDs / Accounts & Access")]
Accounts,
[Describe("Network Services")]
Network,
[Describe("Phone Services")]
Phone,
[Describe("Radio & Microwave Services")]
Radio,
[Describe("Security & Policies")]
Security,
[Describe("Servers & Data Storage")]
Servers,
[Describe("Software & Business Applications")]
Software,
[Describe("Tech Support & Training")]
TechSupport,
[Describe("Websites / Design & Hosting")]
Websites
}

[Optional]
[Describe("the appropriate category")]
[Prompt(new string[] { "Please select the appropriate category for your problem (optional)." })]
public Categories Category { get; set; }

当表单运行时,它看起来像下面这样:

Bot with no enum choices

如果我们删除 Prompt 属性,它将显示所有类别:

All the categories being shown

为什么 Prompt 属性不能与枚举一起使用?

最佳答案

您的提示缺少 {||} pattern element .应该是:

[Prompt("Please select the appropriate category for your problem (optional). {||}")]

关于c# - 表单流枚举提示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42702024/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com