Merge branch 'master' of https://github.com/SciSharp/BotSharp
This commit is contained in:
commit
5c751b68d2
|
|
@ -8,13 +8,18 @@ public class ElementButton
|
|||
public string Type { get; set; } = "web_url";
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string Url { get; set; }
|
||||
public string? Url { get; set; }
|
||||
|
||||
[Translate]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string Payload { get; set; }
|
||||
[Translate]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Payload { get; set; }
|
||||
|
||||
[JsonPropertyName("is_primary")]
|
||||
public bool IsPrimary { get; set; }
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ public partial class ConversationService
|
|||
message.Files?.Clear();
|
||||
|
||||
// Save payload
|
||||
if (replyMessage != null)
|
||||
if (replyMessage != null && !string.IsNullOrEmpty(replyMessage.Payload))
|
||||
{
|
||||
message.Payload = string.IsNullOrEmpty(replyMessage.Payload) ? message.Content : replyMessage.Payload;
|
||||
message.Payload = replyMessage.Payload;
|
||||
}
|
||||
|
||||
// Before chat completion hook
|
||||
|
|
|
|||
|
|
@ -61,9 +61,11 @@ public class TranslationService : ITranslationService
|
|||
{
|
||||
// Override language if it's Unknown, it's used to output the corresponding language.
|
||||
var states = _services.GetRequiredService<IConversationStateService>();
|
||||
var inputLanguage = string.IsNullOrEmpty(translatedStringList.InputLanguage) ? LanguageType.ENGLISH : translatedStringList.InputLanguage;
|
||||
var languageState = states.GetState("language", inputLanguage);
|
||||
states.SetState("language", languageState, activeRounds: 1);
|
||||
if (!states.ContainsState("language"))
|
||||
{
|
||||
var inputLanguage = string.IsNullOrEmpty(translatedStringList.InputLanguage) ? LanguageType.ENGLISH : translatedStringList.InputLanguage;
|
||||
states.SetState("language", inputLanguage, activeRounds: 1);
|
||||
}
|
||||
|
||||
var translatedTexts = translatedStringList.Texts;
|
||||
var map = new Dictionary<string, string>();
|
||||
|
|
|
|||
|
|
@ -9,5 +9,4 @@ Next action agent is inferred based on user lastest response.
|
|||
Expected user goal agent is {{ expected_user_goal_agent }}.
|
||||
{%- else -%}
|
||||
User goal agent is inferred based on user initial request.
|
||||
{%- endif %}
|
||||
Detect language based on the overall content in [CONVERSATION] and only include user message.
|
||||
{%- endif %}
|
||||
Loading…
Reference in a new issue